This is a better regression test for the bugs hidden by commit 80fc5d26
('graph-lock: Disable locking for now'). With that commit reverted, it
hangs instantaneously and reliably for me.
It is important to have a reliable test like this, because the following
commits will set out to fix the actual
bdrv_set_file_or_backing_noperm() requires the caller to hold the
AioContext lock for the child node, but we hold the one for the parent
node in bdrv_reopen_parse_file_or_backing(). Take the other one
temporarily.
Signed-off-by: Kevin Wolf
---
block.c | 35 +--
1
bdrv_set_backing() requires the caller to hold the AioContext lock for
@backing_hd. Take it in bdrv_open_backing_file() before calling the
function.
Signed-off-by: Kevin Wolf
---
block.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/block.c b/block.c
index 954b9923d9..d5f8231f31 10064
This series fixes the deadlock that was observed before commit ad128dff
('graph-lock: Disable locking for now'), which just disabled the graph
lock completely as a workaround to get 8.0.1 stable.
In theory the problem is simple: We can't poll while still holding the
lock of a different AioContext.
bdrv_open_inherit() calls several functions for which it needs to hold
the AioContext lock, but currently doesn't. This includes calls in
bdrv_append_temp_snapshot(), for which bdrv_open_inherit() is the only
caller. Fix the locking in these places.
Signed-off-by: Kevin Wolf
---
block.c | 25 +++
blk_insert_bs() requires that callers hold the AioContext lock for the
node that should be inserted. Take it.
Signed-off-by: Kevin Wolf
---
tests/unit/test-block-iothread.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/unit/test-block-iothread.c b/tests/unit/tes
blk_insert_bs() requires that callers hold the AioContext lock for the
node that should be inserted. Take it.
Signed-off-by: Kevin Wolf
---
hw/core/qdev-properties-system.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev
bdrv_attach_child() requires that the caller holds the AioContext lock
for the new child node. Take it in bdrv_open_child() and document that
the caller must not hold any AioContext apart from the main AioContext.
Signed-off-by: Kevin Wolf
---
block.c | 13 +++--
1 file changed, 11 inser
Now that bdrv_graph_wrlock() temporarily drops the AioContext lock that
its caller holds, it can poll without causing deadlocks. We can now
re-enable graph locking.
This reverts commit ad128dff0bf4b6f971d05eb4335a627883a19c1d.
Signed-off-by: Kevin Wolf
---
block/graph-lock.c | 25 --
bdrv_root_attach_child() requires callers to hold the AioContext lock
for child_bs. Take it in block_job_add_bdrv() before calling the
function.
Signed-off-by: Kevin Wolf
---
blockjob.c | 17 -
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/blockjob.c b/blockjob.c
If the caller keeps the AioContext lock for a block node in an iothread,
polling in bdrv_graph_wrlock() deadlocks if the condition isn't
fulfilled immediately.
Now that all callers make sure to actually have the AioContext locked
when they call bdrv_replace_child_noperm() like they should, we can
The function can move the child node to a different AioContext. In this
case, it also must take the AioContext lock for the new context before
calling functions that require the caller to hold the AioContext for the
child node.
Signed-off-by: Kevin Wolf
---
block.c | 21 -
1
On 6/5/23 10:57, Kevin Wolf wrote:
void bdrv_graph_rdlock_main_loop(void)
@@ -296,18 +276,13 @@ void assert_bdrv_graph_readable(void)
{
/* reader_count() is slow due to aio_context_list_lock lock contention */
/* TODO Reenable when wrlock is reenabled */
There's still a TODO her
Am 05.06.2023 um 11:06 hat Paolo Bonzini geschrieben:
> On 6/5/23 10:57, Kevin Wolf wrote:
> > void bdrv_graph_rdlock_main_loop(void)
> > @@ -296,18 +276,13 @@ void assert_bdrv_graph_readable(void)
> > {
> > /* reader_count() is slow due to aio_context_list_lock lock
> > contention */
>
This patch series add a new extension - zoned format - to the
qcow2 driver thereby allowing full zoned storage emulation on
the qcow2 img file. Users can attach such a qcow2 file to the
guest as a zoned device.
To create a qcow2 file with zoned format, use command like this:
$ qemu-img create
To configure the zoned format feature on the qcow2 driver, it
requires following arguments: the device size, zoned profile,
zoned model, zone size, zone capacity, number of conventional
zones, limits on zone resources (max append sectors, max open
zones, and max_active_zones).
To create a qcow2 fi
Add the specs for the zoned format feature of the qcow2 driver. Once
the zoned_profile is set to `zbc`, then the qcow2 file can be taken
as zoned devices and passed through by virtio-blk device to the guest.
Signed-off-by: Sam Li
---
docs/system/qemu-block-drivers.rst.inc | 31 ++
By adding zone operations and zoned metadata, the zoned emulation
capability enables full emulation support of zoned device using
a qcow2 file. The zoned device metadata includes zone type,
zoned device state and write pointer of each zone, which is stored
to an array of unsigned integers.
Each zo
The zoned format feature can be tested by:
$ tests/qemu-iotests/check zoned-qcow2
Signed-off-by: Sam Li
---
tests/qemu-iotests/tests/zoned-qcow2 | 110 +++
tests/qemu-iotests/tests/zoned-qcow2.out | 87 ++
2 files changed, 197 insertions(+)
create mode 1
On 6/2/23 16:08, Hanna Czenczek wrote:
On 29.05.23 17:15, Alexander Ivanov wrote:
We need to fix leak after deduplication in the next patch. Move leak
fixing to a separate helper parallels_fix_leak() and add
parallels_get_leak_size() helper wich used in parallels_fix_leak() and
parallels_chec
ping?
On 28/3/23 23:01, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé
GCC9 is confused when building with CFLAG -O3:
hw/scsi/megasas.c: In function ‘megasas_scsi_realize’:
hw/scsi/megasas.c:2387:26: error: duplicated ‘if’ condition
[-Werror=duplicated-cond]
2387 |
On Mon, Jun 05, 2023 at 06:41:06PM +0800, Sam Li wrote:
> To configure the zoned format feature on the qcow2 driver, it
> requires following arguments: the device size, zoned profile,
> zoned model, zone size, zone capacity, number of conventional
> zones, limits on zone resources (max append secto
On 6/5/23 15:44, Philippe Mathieu-Daudé wrote:
ping?
On 28/3/23 23:01, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé
GCC9 is confused when building with CFLAG -O3:
hw/scsi/megasas.c: In function ‘megasas_scsi_realize’:
hw/scsi/megasas.c:2387:26: error: duplicated ‘if’ cond
When processing vectored guest requests that are not aligned to the
storage request alignment, we pad them by adding head and/or tail
buffers for a read-modify-write cycle.
The guest can submit I/O vectors up to IOV_MAX (1024) in length, but
with this padding, the vector can exceed that limit. As
Test that even vectored IO requests with 1024 vector elements that are
not aligned to the device's request alignment will succeed.
Reviewed-by: Eric Blake
Reviewed-by: Vladimir Sementsov-Ogievskiy
Signed-off-by: Hanna Czenczek
Message-Id: <20230411173418.19549-5-hre...@redhat.com>
---
tests/qe
From: Alexander Ivanov
Don't let high_off be more than the file size even if we don't fix the
image.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
Message-Id: <20230424093147.197643-3-alexander.iva...@virtuozzo.com>
Reviewed-by: Hanna Cz
From: Alexander Ivanov
BAT is written in the context of conventional operations over the image
inside bdrv_co_flush() when it calls parallels_co_flush_to_os() callback.
Thus we should not modify BAT array directly, but call
parallels_set_bat_entry() helper and bdrv_co_flush() further on. After
th
From: Alexander Ivanov
Replace the way we use mutex in parallels_co_check() for simplier
and less error prone code.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Message-Id: <20230424093147.197643-12-alexander.iva...@virtuozzo.com>
Reviewed-by: Hanna Czenczek
Signed-off-by: Hann
From: Alexander Ivanov
Exclude out-of-image clusters from allocated and fragmented clusters
calculation.
Signed-off-by: Alexander Ivanov
Message-Id: <20230424093147.197643-9-alexander.iva...@virtuozzo.com>
Reviewed-by: Hanna Czenczek
Signed-off-by: Hanna Czenczek
---
block/parallels.c | 6 ++
From: Jean-Louis Dupond
When we for example have a sparse qcow2 image and discard: unmap is enabled,
there can be a lot of fragmentation in the image after some time. Especially on
VM's
that do a lot of writes/deletes.
This causes the qcow2 image to grow even over 110% of its virtual size,
becau
From: Alexander Ivanov
We will add more and more checks so we need a better code structure
in parallels_co_check. Let each check performs in a separate loop
in a separate helper.
Signed-off-by: Alexander Ivanov
Message-Id: <20230424093147.197643-10-alexander.iva...@virtuozzo.com>
Reviewed-by: H
From: Alexander Ivanov
This helper will be reused in next patches during parallels_co_check
rework to simplify its code.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
Message-Id: <20230424093147.197643-5-alexander.iva...@virtuozzo.com>
R
From: Alexander Ivanov
data_end field in BDRVParallelsState is set to the biggest offset present
in BAT. If this offset is outside of the image, any further write will
create the cluster at this offset and/or the image will be truncated to
this offset on close. This is definitely not correct.
Ra
From: Alexander Ivanov
We will add more and more checks so we need a better code structure
in parallels_co_check. Let each check performs in a separate loop
in a separate helper.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
Message-Id:
bdrv_pad_request() was the main user of qemu_iovec_init_extended().
HEAD^ has removed that use, so we can remove qemu_iovec_init_extended()
now.
The only remaining user is qemu_iovec_init_slice(), which can easily
inline the small part it really needs.
Note that qemu_iovec_init_extended() offered
From: Alexander Ivanov
Set data_end to the end of the last cluster inside the image. In such a
way we can be sure that corrupted offsets in the BAT can't affect on the
image size. If there are no allocated clusters set image_end_offset by
data_end.
Signed-off-by: Alexander Ivanov
Reviewed-by: D
From: Alexander Ivanov
We will add more and more checks so we need a better code structure in
parallels_co_check. Let each check performs in a separate loop in a
separate helper.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Message-Id: <20230424093147.197643-8-alexander.iva...@v
We want to inline qemu_iovec_init_extended() in block/io.c for padding
requests, and having access to qiov_slice() is useful for this. As a
public function, it is renamed to qemu_iovec_slice().
(We will need to count the number of I/O vector elements of a slice
there, and then later process this
From: Alexander Ivanov
We will add more and more checks so we need a better code structure
in parallels_co_check. Let each check performs in a separate loop
in a separate helper.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
Message-Id:
The following changes since commit 848a6caa88b9f082c89c9b41afa975761262981d:
Merge tag 'migration-20230602-pull-request' of
https://gitlab.com/juan.quintela/qemu into staging (2023-06-02 17:33:29 -0700)
are available in the Git repository at:
https://gitlab.com/hreitz/qemu.git tags/pull-blo
From: Alexander Ivanov
All the offsets in the BAT must be lower than the file size.
Fix the check condition for correct check.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Message-Id: <20230424093147.197643-13-alexander.iva...@virtuozzo.com>
Reviewed-by: Hanna Czenczek
Signed-o
On 6/2/23 16:43, Hanna Czenczek wrote:
On 29.05.23 17:15, Alexander Ivanov wrote:
Cluster offsets must be unique among all the BAT entries. Find duplicate
offsets in the BAT and fix it by copying the content of the relevant
cluster to a newly allocated cluster and set the new cluster offset
The 'old' lib check was added for CentOS 7 which we don't support
anymore.
We don't need to implement particular [get/set]_multipath_config()
helpers: use the defaults.
Philippe Mathieu-Daudé (2):
scsi/qemu-pr-helper: Drop support for 'old' libmultipath API
scsi/qemu-pr-helper: Use defaults [
Commit 1b0578f5c4 ("qemu-pr-helper: Fix build on CentOS 7") added
code to probe for 'old' libmultipath API on CentOS 7. However since
merge commit 8c345b3e6a (June 2021) we don't build/test CentOS 7 as
it felt out of our list of supported distrib versions. Therefore we
can safely remove the 'old' A
Commit b3f1c8c413 ("qemu-pr-helper: use new libmultipath API")
declared the two [get/set]_multipath_config() functions to
satisfy the 'new' API. The library already provides an internal
implementation for these helpers, exposed as weak symbols.
Since our implementation doesn't provide much, we can
On 5/6/23 19:41, Philippe Mathieu-Daudé wrote:
The 'old' lib check was added for CentOS 7 which we don't support
anymore.
We don't need to implement particular [get/set]_multipath_config()
helpers: use the defaults.
Philippe Mathieu-Daudé (2):
scsi/qemu-pr-helper: Drop support for 'old' libm
On 6/5/23 19:41, Philippe Mathieu-Daudé wrote:
Commit b3f1c8c413 ("qemu-pr-helper: use new libmultipath API")
declared the two [get/set]_multipath_config() functions to
satisfy the 'new' API. The library already provides an internal
implementation for these helpers, exposed as weak symbols.
Since
Per the cache(3) man page, sys_icache_invalidate() and
sys_dcache_flush() are declared in .
Signed-off-by: Philippe Mathieu-Daudé
---
util/cacheflush.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/cacheflush.c b/util/cacheflush.c
index 06c2333a60..de35616718 10064
By default, C function prototypes declared in headers are visible,
so there is no need to declare them as 'extern' functions.
Remove this redundancy in a single bulk commit; do not modify:
- meson.build (used to check function availability at runtime)
- pc-bios/
- libdecnumber/
- tests/
Since v2:
- Do not change variable declarations in "block/dmg.h" (danpb)
- Rebased
- Added R-b from v1
v1:
- Remove the 'extern' keyword on function prototypes declared
in header.
- Replace __attribute__((noreturn)) -> G_NORETURN
- Trivial cleanups to keep the previous commits generic.
Based-on
In commit d56fea79f9 ("tcg: Move TCG_{LOW,HIGH} to tcg-internal.h")
we replaced the "_link_error" definitions with modern QEMU_ERROR()
attribute markup. We covered tcg-op.c but forgot to completely
clean tcg-op-vec.c. Do it now.
Signed-off-by: Philippe Mathieu-Daudé
---
tcg/tcg-op-vec.c | 11 ---
Follow QEMU CODING_STYLE, use the type definition.
Signed-off-by: Philippe Mathieu-Daudé
---
include/qemu/uri.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qemu/uri.h b/include/qemu/uri.h
index b43f35a6a6..2875c51417 100644
--- a/include/qemu/uri.h
+++ b/include/q
Under MSYS2, G_NORETURN is expanded to '[[noreturn]]'.
Simpler to use the same definition everywhere, unifying
the code style.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Juan Quintela
---
include/sysemu/os-win32.h | 2 +-
tests/migration/stress.c | 2 +-
2 files changed, 2 insertions(+
On Tue, May 30, 2023 at 08:39:25PM +0200, Juan Quintela wrote:
> Remove the increase in qemu_file_fill_buffer() and add asserts to
> qemu_file_transferred* functions.
>
> Signed-off-by: Juan Quintela
The read side accounting does look a bit weird and never caught my notice..
Maybe worth also to
On Tue, May 30, 2023 at 08:39:26PM +0200, Juan Quintela wrote:
> This way we can read it from any thread.
> I checked that it gives the same value than the current one. We never
> use to qemu_files at the same time.
>
> Signed-off-by: Juan Quintela
The follow up patch may be better to be squash
On 6/5/23 08:45, Hanna Czenczek wrote:
The following changes since commit 848a6caa88b9f082c89c9b41afa975761262981d:
Merge tag 'migration-20230602-pull-request'
ofhttps://gitlab.com/juan.quintela/qemu into staging (2023-06-02 17:33:29
-0700)
are available in the Git repository at:
http
On 6/5/23 10:56, Philippe Mathieu-Daudé wrote:
Per the cache(3) man page, sys_icache_invalidate() and
sys_dcache_flush() are declared in .
Signed-off-by: Philippe Mathieu-Daudé
---
util/cacheflush.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson
I
On 6/5/23 10:56, Philippe Mathieu-Daudé wrote:
In commit d56fea79f9 ("tcg: Move TCG_{LOW,HIGH} to tcg-internal.h")
we replaced the "_link_error" definitions with modern QEMU_ERROR()
attribute markup. We covered tcg-op.c but forgot to completely
clean tcg-op-vec.c. Do it now.
Signed-off-by: Phili
On 6/5/23 10:56, Philippe Mathieu-Daudé wrote:
-static __attribute__((noreturn)) void exit_failure(void)
+static G_NORETURN void exit_failure(void)
I think attr-spec-seq ('[[noreturn]]') has to come before specifiers-and-qualifiers (i.e.
'static').
To me this means that G_NORETURN being rede
On Thu, Jun 1, 2023 at 9:46 AM Niklas Cassel wrote:
>
> From: Niklas Cassel
>
> For NCQ, PxCI is cleared on command queued successfully.
> For non-NCQ, PxCI is cleared on command completed successfully.
> Successfully means ERR_STAT, BUSY and DRQ are all cleared.
>
> A command that has ERR_STAT s
60 matches
Mail list logo