Hi, I have launched a qemu process with the following options related to
emulated disk:
-drive
file=disk.qcow2,if=none,id=disk0,l2-cache-size=8M,format=qcow2,discard=on,detect-zeroes=unmap,aio=io_uring
-device virtio-blk-pci,drive=disk0,scsi=off,bootindex=2
If I download files on guest OS to incr
On 13/12/22 01:02, Richard Henderson wrote:
On 12/12/22 17:05, Philippe Mathieu-Daudé wrote:
@@ -161,7 +161,7 @@ static qmp_virtio_feature_map_t
vhost_user_protocol_map[] = {
};
/* virtio device configuration statuses */
-static qmp_virtio_feature_map_t virtio_config_status_map[] = {
+stati
On 13/12/22 01:14, Richard Henderson wrote:
On 12/12/22 17:05, Philippe Mathieu-Daudé wrote:
The device endianness doesn't change during runtime.
What are you talking about? Of course it does.
The host CPU certainly does, but the virtio device doesn't... Does it?
This check only consider t
On 12/12/22 17:05, Philippe Mathieu-Daudé wrote:
The device endianness doesn't change during runtime.
What are you talking about? Of course it does.
I mean, it doesn't often in practice, because the Linux kernel is compiled for one
endianness and doesn't keep toggling state, but the hooks th
On 12/12/22 17:05, Philippe Mathieu-Daudé wrote:
@@ -161,7 +161,7 @@ static qmp_virtio_feature_map_t vhost_user_protocol_map[] =
{
};
/* virtio device configuration statuses */
-static qmp_virtio_feature_map_t virtio_config_status_map[] = {
+static const qmp_virtio_feature_map_t virtio_c
The monitor decoders are the only functions using the CONFIG_xxx
definitions declared in the target specific CONFIG_DEVICES header.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/virtio/meson.build | 2 +-
hw/virtio/virtio-qmp.c | 631 +
hw/virtio/virtio-
Since virtio_ss[] is added to specific_ss[], rename it as
specific_virtio_ss[] to make it clearer.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/virtio/meson.build | 41 +
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/hw/virtio/meson.build
The current definition of VHOST_USER_MAX_RAM_SLOTS is
target specific. By converting this definition to a runtime
vhost_user_ram_slots_max() helper declared in a target
specific unit, we can have the rest of vhost-user.c target
independent.
To avoid variable length array or using the heap to store
The device endianness doesn't change during runtime.
Cache it in the VirtIODevice state.
Signed-off-by: Philippe Mathieu-Daudé
---
RFC: I'm not sure virtio_init() is the correct place to add this
check. We want to initialize this field once the features are
negociated.
---
hw/virtio/vi
These arrays are only accessed read-only, move them to .rodata.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/virtio/virtio.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5817f4cbc9..f54cc233
In order to avoid target-specific code in VirtIO headers,
move this particular function -- which is only called once
in virtio_init() -- in its own unit.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/virtio/virtio-config.c | 20
include/hw/virtio/virtio-access.h | 19
Since the device endianness doesn't change at runtime,
use the cached value instead of evaluating it on each call.
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/virtio/virtio-access.h | 44 +++
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/inc
Except the following files:
- virtio-config.c
- virtio-qmp.c
- virtio-iommu.c
- virtio-mem.c
- vhost-user-target.c
- vhost-vdpa.c
all other virtio related files are target independent and
can be compiled only once for a system emulation build,
avoiding compiling hundreds of objects.
Signed-off-by:
Currently the inlined virtio_access_is_big_endian() function
"hw/virtio/virtio-access.h" which is used by all I/O accesses
force any virtio device to be built as target-dependent object.
This series isolates the few VirtIO target specific bits, trying
to not impact the performance (a function is u
These config helpers use the target-dependent LD/ST API.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/virtio/meson.build | 1 +
hw/virtio/virtio-config.c | 204 ++
hw/virtio/virtio.c| 190 ---
3 files changed, 205
virtio.c uses target_words_bigendian() which is declared in
"hw/core/cpu.h". Add the missing header to avoid when refactoring:
hw/virtio/virtio.c:2451:9: error: implicit declaration of function
'target_words_bigendian' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
if (target_
On 12/8/22 15:39, Markus Armbruster wrote:
* Global state (GS) API. These functions run under the BQL.
*
* See include/block/block-global-state.h for more information about
- * the GS API.
+ * the GS API.b
*/
One-character typo.
Paolo
On 12/12/22 16:57, Kevin Wolf wrote:
I looks to me like this is a problem with the test case rather than the
change per se. It seems to be fixed with this patch that is already
posted as part of the next series:
[PATCH 09/18] test-bdrv-drain: Fix incorrrect drain assumptions
https://lists.gnu.or
Am 07.12.2022 um 15:12 hat Emanuele Giuseppe Esposito geschrieben:
> Am 07/12/2022 um 14:18 schrieb Kevin Wolf:
> > This series supersedes the first half of Emanuele's "Protect the block
> > layer with a rwlock: part 1". It introduces the basic infrastructure for
> > protecting the block graph (spe
Am 09.12.2022 um 17:53 hat Paolo Bonzini geschrieben:
> On 11/18/22 18:41, Kevin Wolf wrote:
> > In order to make sure that bdrv_replace_child_noperm() doesn't have to
> > poll any more, get rid of the bdrv_parent_drained_begin_single() call.
> >
> > This is possible now because we can require tha
.bdrv_needs_filename is only set for drivers that also set bdrv_file_open,
i.e. protocol drivers.
So we can make the assertion always, it will always pass for those drivers
that use bdrv_open.
Signed-off-by: Paolo Bonzini
---
block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -
The set of BlockDrivers that have .bdrv_file_open coincides with those
that have .protocol_name and guess what---checking drv->bdrv_file_open
is done to see if the driver is a protocol. So check drv->protocol_name
instead.
Signed-off-by: Paolo Bonzini
---
block.c | 13 ++---
1 file chan
The presence of the bdrv_file_open callback is used in some parts of the
code to distinguish protocol and format drivers. Use the existing
.protocol_name field instead, and unify .bdrv_open with .bdrv_file_open.
Paolo
Paolo Bonzini (3):
block: apply assertion more widely
block: do not check
bdrv_file_open and bdrv_open are completely equivalent, they are
never checked except to see which one to invoke. So merge them
into a single callback.
Signed-off-by: Paolo Bonzini
---
block.c | 2 --
block/blkdebug.c | 2 +-
block/blkio.c
Remove it and unify the function with bdrv_drained_end.
Signed-off-by: Paolo Bonzini
---
block/io.c | 21 ++---
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/block/io.c b/block/io.c
index 695c8f3f5faa..c2962adf8d2d 100644
--- a/block/io.c
+++ b/block/io.c
@@ -69,
Since bdrv_drained_end does not poll anymore, it need not jump out of
coroutine context. This in turn enables the removal of the "begin"
field in BdrvCoDrainData.
Signed-off-by: Paolo Bonzini
---
block/io.c | 19 +++
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a
There are a few more lines of code that can be removed around draining
code, but especially the logic can be simplified by removing unnecessary
parameters.
Due to the failure of the block-next branch, the first three patches
drop patches 14+15 of Kevin's drain cleanup series, and then redo
patch 1
When called from within (another) coroutine, aio_co_enter will not
enter a coroutine immediately; instead the new coroutine is scheduled
to run after qemu_coroutine_yield(). This however might cause the
currently-running coroutine to yield without having raised blk->in_flight.
If it was a ->draine
All I/O operations call blk_wait_while_drained() immediately after
blk_inc_in_flight(), except for blk_abort_aio_request() where it
does not hurt to add such a call. Merge the two functions into one,
and add a note about a disturbing lack of thread-safety that will
be fixed shortly.
While at it,
From: Emanuele Giuseppe Esposito
First, use run_job() instead of the current logic to run the
stream job. Then, use auto_finalize=False to be sure that
the job is not automatically deleted once it is done.
In this way, if the job finishes before we want, it is not
finalized yet so the other comm
Protect quiesce_counter and queued_requests with a QemuMutex, so that
they are protected from concurrent access in the main thread (for example
blk_root_drained_end() reached from bdrv_drain_all()) and in the iothread
(where any I/O operation will call blk_inc_in_flight()).
Signed-off-by: Paolo Bo
Only one caller of bdrv_parent_drained_begin_single() passes poll=true;
move the polling to that one caller.
While this requires exposing bdrv_parent_drained_poll_single to outside
block/io.c, this is not a big deal because the bdrv_parent_drained_*_single
functions are really internal between blo
Remove it from the functions, from callers/callees such as
bdrv_do_drained_begin_quiesce() and bdrv_drain_poll(), and
from bdrv_co_yield_to_drain() and BdrvCoDrainData.
Signed-off-by: Paolo Bonzini
---
block.c | 4 ++--
block/io.c | 49
The drained_begin callbacks are not polling, all they do is schedule
any operations that must complete before bdrv_drained_end(). As such,
they can be called before bdrv_co_yield_to_drain(). Thus, the only
remaining task left for bdrv_co_drain_bh_cb() is the BDRV_POLL_WHILE()
loop. This patch ex
From: Emanuele Giuseppe Esposito
This test uses a callback of an I/O function (blk_aio_preadv)
to modify the graph, using bdrv_attach_child.
This is simply not allowed anymore. I/O cannot change the graph.
Before "block/io.c: make bdrv_do_drained_begin_quiesce static
and introduce bdrv_drained_b
From: Emanuele Giuseppe Esposito
Graph initialization functions like blk_new(), bdrv_new() and so on
should not run in a coroutine. In fact, they might invoke a drain
(for example blk_insert_bs eventually calls bdrv_replace_child_noperm)
that in turn can invoke callbacks like bdrv_do_drained_begi
The three global properties allow_aio_context_change,
disable_request_queuing and allow_write_before_eof are
always set for the whole life of a BlockBackend. Make
this clear by removing the possibility of clearing them,
and by marking the corresponding function GLOBAL_STATE_CODE().
Signed-off-by:
exp->common.blk cannot be NULL, nbd_export_delete() is only called from
blk_exp_unref() and in turn that can only happen after blk_exp_add()
has asserted exp->blk != NULL.
Signed-off-by: Paolo Bonzini
---
nbd/server.c | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
diff --g
This reverts commit a4e5c80a45b22359cf9c187f0df4f8544812c55c.
Signed-off-by: Paolo Bonzini
---
block.c | 103 +--
block/io.c | 2 +-
include/block/block-io.h | 8 ---
tests/unit/test-bdrv-drain.c | 10
4 files c
This reverts commit dcc5d4bc2abed4268bf31908193c4369e4c9d005.
Signed-off-by: Paolo Bonzini
---
block.c | 4 ++--
block/io.c | 8 ++--
include/block/block-io.h | 5 +++--
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/block.c b/block.c
index 619
On 12/12/22 12:44, Klaus Jensen wrote:
From: Klaus Jensen
The eventidx and doorbell value are not handling endianness correctly.
Fix this.
Fixes: 3f7fe8de3d49 ("hw/nvme: Implement shadow doorbell buffer support")
Cc: qemu-sta...@nongnu.org
Reported-by: Guenter Roeck
Signed-off-by: Klaus Jense
On Dec 12 12:37, Philippe Mathieu-Daudé wrote:
> On 12/12/22 12:32, Klaus Jensen wrote:
> > From: Klaus Jensen
> >
> > Prior to reading the shadow doorbell cq head, we have to update the
> > eventidx. Otherwise, we risk that the driver will skip an mmio doorbell
> > write. This happens on riscv64
From: Klaus Jensen
Replace various ->parent_obj use with the equivalent QOM accessors.
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Klaus Jensen
---
hw/nvme/ctrl.c | 89 +++---
1 file changed, 48 insertions(+), 41 deletions(-)
diff --git a/hw
From: Klaus Jensen
The eventidx and doorbell value are not handling endianness correctly.
Fix this.
Fixes: 3f7fe8de3d49 ("hw/nvme: Implement shadow doorbell buffer support")
Cc: qemu-sta...@nongnu.org
Reported-by: Guenter Roeck
Signed-off-by: Klaus Jensen
---
hw/nvme/ctrl.c | 19 +
From: Klaus Jensen
Prior to reading the shadow doorbell cq head, we have to update the
eventidx. Otherwise, we risk that the driver will skip an mmio doorbell
write. This happens on riscv64, as reported by Guenter.
Adding the missing update to the cq eventidx fixes the issue.
Fixes: 3f7fe8de3d4
From: Klaus Jensen
Rename the trace events related to writing the event index and reading
the doorbell value to make it more clear that the event is associated
with an actual update (write or read respectively).
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Klaus Jensen
---
hw/nvme/ctrl.
From: Klaus Jensen
Guenter reports that hw/nvme is broken on riscv64[1] and big endian
platforms[2].
This is a regression since 7.1, so this does not warrent an rc5 for 7.2.
I'm sure Guenter can carry this patch in his tree, and maybe we can get
this out in a stable release.
On riscv, the issue
On 12/12/22 12:32, Klaus Jensen wrote:
From: Klaus Jensen
Prior to reading the shadow doorbell cq head, we have to update the
eventidx. Otherwise, we risk that the driver will skip an mmio doorbell
write. This happens on riscv64, as reported by Guenter.
Adding the missing update to the cq even
On 12/12/22 12:32, Klaus Jensen wrote:
From: Klaus Jensen
The eventidx and doorbell value are not handling endianness correctly.
Fix this.
Fixes: 3f7fe8de3d49 ("hw/nvme: Implement shadow doorbell buffer support")
Cc: qemu-sta...@nongnu.org
Reported-by: Guenter Roeck
Signed-off-by: Klaus Jense
From: Klaus Jensen
Replace various ->parent_obj use with the equivalent QOM accessors.
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Klaus Jensen
---
hw/nvme/ctrl.c | 89 +++---
1 file changed, 48 insertions(+), 41 deletions(-)
diff --git a/hw
From: Klaus Jensen
Rename the trace events related to writing the event index and reading
the doorbell value to make it more clear that the event is associated
with an actual update (write or read respectively).
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Klaus Jensen
---
hw/nvme/ctrl.
From: Klaus Jensen
Prior to reading the shadow doorbell cq head, we have to update the
eventidx. Otherwise, we risk that the driver will skip an mmio doorbell
write. This happens on riscv64, as reported by Guenter.
Adding the missing update to the cq eventidx fixes the issue.
Fixes: 3f7fe8de3d4
From: Klaus Jensen
The eventidx and doorbell value are not handling endianness correctly.
Fix this.
Fixes: 3f7fe8de3d49 ("hw/nvme: Implement shadow doorbell buffer support")
Cc: qemu-sta...@nongnu.org
Reported-by: Guenter Roeck
Signed-off-by: Klaus Jensen
---
hw/nvme/ctrl.c | 12
From: Klaus Jensen
Guenter reports that hw/nvme is broken on riscv64[1] and big endian
platforms[2].
This is a regression since 7.1, so this does not warrent an rc5 for 7.2.
I'm sure Guenter can carry this patch in his tree, and maybe we can get
this out in a stable release.
On riscv, the issue
On 28.11.22 15:15, Nir Soffer wrote:
Add coroutine based loop inspired by `qemu-img convert` design.
Changes compared to `qemu-img convert`:
- State for the entire image is kept in ImgChecksumState
- State for single worker coroutine is kept in ImgChecksumworker.
- "Writes" are always in-orde
On 28.11.22 15:15, Nir Soffer wrote:
The checksum command compute a checksum for disk image content using the
blkhash library[1]. The blkhash library is not packaged yet, but it is
available via copr[2].
Example run:
$ ./qemu-img checksum -p fedora-35.qcow2
6e5c00c995056319d52395f8d91
On 28.11.22 15:15, Nir Soffer wrote:
Add simple tests computing a checksum for image with all kinds of
extents in raw and qcow2 formats.
The test can be extended later for other formats, format options (e..g
compressed qcow2), protocols (e.g. nbd), and image with a backing chain,
but I'm not sur
On 28.11.22 15:15, Nir Soffer wrote:
Extend the test finder to find tests with format (*.out.qcow2) or cache
specific (*.out.nocache) out file. This worked before only for the
numbered tests.
---
tests/qemu-iotests/findtests.py | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
On 28.11.22 15:15, Nir Soffer wrote:
This macro is used by various commands (compare, convert, rebase) but it
is defined somewhere in the middle of the file. I'm going to use it in
the new checksum command so lets clean up a bit before that.
---
qemu-img.c | 3 +--
1 file changed, 1 insertion(
Am 07.12.22 um 14:14 schrieb Christian Borntraeger:
Without a kernel or boot disk a QEMU on s390 will exit (usually with a
disabled wait state). This breaks the stream-under-throttle test case.
Do not exit qemu if on s390.
Signed-off-by: Christian Borntraeger
---
tests/qemu-iotests/tests/s
On 12/9/22 17:53, Paolo Bonzini wrote:
On 11/18/22 18:41, Kevin Wolf wrote:
In order to make sure that bdrv_replace_child_noperm() doesn't have to
poll any more, get rid of the bdrv_parent_drained_begin_single() call.
This is possible now because we can require that the parent is already
draine
61 matches
Mail list logo