Re: [PATCH v2 18/18] [fixup] module_load_modinfo

2021-06-09 Thread Gerd Hoffmann
On Thu, Jun 10, 2021 at 07:57:55AM +0200, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann Oops. That should have been squashed into patch #13. take care, Gerd

[PATCH v2 15/18] modules: use modinfo for qom load

2021-06-09 Thread Gerd Hoffmann
Use module database to figure which module implements a given QOM type. Drop hard-coded object list. Signed-off-by: Gerd Hoffmann --- util/module.c | 83 +++ 1 file changed, 30 insertions(+), 53 deletions(-) diff --git a/util/module.c b/util/modul

[PATCH v2 12/18] modules: add module_load_path_init helper

2021-06-09 Thread Gerd Hoffmann
Factor out module search path initialization to the new module_load_path_init() helper. Also store the search path in global variables and keep it so we have to do it only once. Signed-off-by: Gerd Hoffmann --- util/module.c | 58 ++- 1 file chang

[PATCH v2 18/18] [fixup] module_load_modinfo

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- util/module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/module.c b/util/module.c index 564b8e3da760..4f98cc74ae37 100644 --- a/util/module.c +++ b/util/module.c @@ -158,7 +158,7 @@ static void module_load_modinfo(void) {

[PATCH v2 10/18] modules: add s390x module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/s390x/virtio-ccw-gpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c index 75a9e4bb3908..5868a2a07093 100644 --- a/hw/s390x/virtio-ccw-gpu.c +++ b/hw/s390x/virtio-ccw-gpu.c @@ -59,6 +59,7 @@ static

[PATCH v2 13/18] modules: load modinfo.json

2021-06-09 Thread Gerd Hoffmann
Load and parse the module info database. Signed-off-by: Gerd Hoffmann --- util/module.c | 54 +++ util/trace-events | 3 +++ 2 files changed, 57 insertions(+) diff --git a/util/module.c b/util/module.c index 3a2d6dde9734..b0ea8c57d438 100644 ---

[PATCH v2 11/18] modules: add block module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- block/iscsi-opts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/iscsi-opts.c b/block/iscsi-opts.c index afaf8837d6c1..4f2da405e645 100644 --- a/block/iscsi-opts.c +++ b/block/iscsi-opts.c @@ -68,3 +68,4 @@ static void iscsi_block_opts_init(void) }

[PATCH v2 08/18] modules: add ccid module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/ccid-card-emulated.c | 1 + hw/usb/ccid-card-passthru.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 5c76bed77aa0..6c8c0355e099 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/cc

[PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-09 Thread Gerd Hoffmann
Add module_allow_arch() to set the target architecture. In case a module is limited to some arch verify arches match and ignore the module if not. Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 1 + softmmu/vl.c | 3 +++ util/module.c | 15 +++ 3 files ch

[PATCH v2 03/18] modules: add qemu-modinfo utility

2021-06-09 Thread Gerd Hoffmann
Scan .modinfo sections of qemu modules, write module metadata to modinfo.json. Signed-off-by: Gerd Hoffmann --- qemu-modinfo.c | 270 + meson.build| 11 ++ 2 files changed, 281 insertions(+) create mode 100644 qemu-modinfo.c diff --git a/qem

[PATCH v2 00/18] modules: add metadata database

2021-06-09 Thread Gerd Hoffmann
This patch series adds support for module metadata. Here are the pieces of the puzzle: (1) Macros are added to store metadata in a .modinfo elf section (idea stolen from the linux kernel). (2) A utility to scan modules, collect metadata from the .modinfo sections, store it in a fi

[PATCH v2 06/18] modules: add audio module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- audio/spiceaudio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 999bfbde47c5..a8d370fe6f31 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -317,3 +317,5 @@ static void register_audio_spice(void)

[PATCH v2 04/18] modules: add virtio-gpu module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/display/vhost-user-gpu-pci.c | 1 + hw/display/vhost-user-gpu.c | 1 + hw/display/vhost-user-vga.c | 1 + hw/display/virtio-gpu-base.c| 1 + hw/display/virtio-gpu-gl.c | 3 +++ hw/display/virtio-gpu-pci-gl.c | 3 +++ hw/display/virtio-gpu-pci.

[PATCH v2 05/18] modules: add chardev module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- chardev/baum.c | 1 + chardev/spice.c | 4 2 files changed, 5 insertions(+) diff --git a/chardev/baum.c b/chardev/baum.c index 5deca778bc44..79d618e35045 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -680,6 +680,7 @@ static const TypeInfo char_braille

[PATCH v2 16/18] modules: use modinfo for qemu opts load

2021-06-09 Thread Gerd Hoffmann
Use module database to figure which module adds given QemuOpts group. Signed-off-by: Gerd Hoffmann --- softmmu/vl.c| 17 - stubs/module-opts.c | 4 util/module.c | 19 +++ 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/softmmu

[PATCH v2 14/18] modules: use modinfo for dependencies

2021-06-09 Thread Gerd Hoffmann
Use module database for module dependencies. Drop hard-coded dependency list. Signed-off-by: Gerd Hoffmann --- util/module.c | 55 --- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/util/module.c b/util/module.c index b0ea8c57d438.

[PATCH v2 09/18] modules: add ui module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- ui/egl-headless.c | 4 ui/gtk.c | 4 ui/sdl2.c | 4 ui/spice-app.c| 3 +++ ui/spice-core.c | 5 + 5 files changed, 20 insertions(+) diff --git a/ui/egl-headless.c b/ui/egl-headless.c index da377a74af69..75404e0e8700 10064

[PATCH v2 07/18] modules: add usb-redir module annotations

2021-06-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/redirect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 6a75b0dc4ab2..4ec9326e0582 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -2608,6 +2608,7 @@ static const TypeInfo usbredir_dev_info = {

[PATCH v2 02/18] qapi: add ModuleInfo schema

2021-06-09 Thread Gerd Hoffmann
Add QAPI schema for the module info database. Signed-off-by: Gerd Hoffmann --- qapi/meson.build | 1 + qapi/modules.json | 36 qapi/qapi-schema.json | 1 + 3 files changed, 38 insertions(+) create mode 100644 qapi/modules.json diff --git a/qapi/m

[PATCH v2 01/18] modules: add metadata macros, add qxl module annotations

2021-06-09 Thread Gerd Hoffmann
Stealing an idea from the linux kernel: Place module metadata in an .modinfo elf section. This patch adds macros and qxl module annotations as example. Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 22 ++ hw/display/qxl.c | 4 2 files changed, 26 inser

Re: [PATCH 2/2] nbd: Add new qemu:joint-allocation metadata context

2021-06-09 Thread Nir Soffer
On Wed, Jun 9, 2021 at 9:01 PM Eric Blake wrote: > > When trying to reconstruct a qcow2 chain using information provided > over NBD, ovirt had been relying on an unsafe assumption that any > portion of the qcow2 file advertised as sparse would defer to the > backing image; this worked with what qe

Re: [RFC libnbd PATCH] info: Add support for new qemu:joint-allocation

2021-06-09 Thread Nir Soffer
On Thu, Jun 10, 2021 at 12:32 AM Eric Blake wrote: > > Qemu is adding qemu:joint-allocation as a single context combining the > two bits of base:allocation and a compression of qemu:allocation-depth > into two bits [1]. Decoding the bits makes it easier for humans to > see the result of that cont

[RFC libnbd PATCH] info: Add support for new qemu:joint-allocation

2021-06-09 Thread Eric Blake
Qemu is adding qemu:joint-allocation as a single context combining the two bits of base:allocation and a compression of qemu:allocation-depth into two bits [1]. Decoding the bits makes it easier for humans to see the result of that context. [1] https://lists.gnu.org/archive/html/qemu-devel/2021-0

Re: [PATCH 4/4] Jobs based on custom runners: add CentOS Stream 8

2021-06-09 Thread Cleber Rosa Junior
On Tue, Jun 8, 2021 at 10:10 AM Cleber Rosa wrote: > > This introduces three different parts of a job designed to run > on a custom runner managed by Red Hat. The goals include: > > a) serve as a model for other organizations that want to onboard > their own runners, with their specific plat

Re: [PATCH v2 2/2] hw/nvme: documentation fix

2021-06-09 Thread Klaus Jensen
On Jun 1 20:32, Gollu Appalanaidu wrote: In the documentation of the '-detached' param "be" and "not" has been used side by side, fix that. Signed-off-by: Gollu Appalanaidu --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c ind

Re: [PATCH v2 1/2] hw/nvme: fix endianess conversion and add controller list

2021-06-09 Thread Klaus Jensen
On Jun 1 20:32, Gollu Appalanaidu wrote: Add the controller identifiers list CNS 0x13, available list of ctrls in NVM Subsystem that may or may not be attached to namespaces. In Identify Ctrl List of the CNS 0x12 and 0x13 no endian conversion for the nsid field. Signed-off-by: Gollu Appalanaid

Re: [PATCH v2] hw/nvme/ctrl: fix csi field for cns 0x00 and 0x11

2021-06-09 Thread Klaus Jensen
On Apr 27 12:00, Gollu Appalanaidu wrote: As per the TP 4056d Namespace types CNS 0x00 and CNS 0x11 CSI field shouldn't use but it is being used for these two Identify command CNS values, fix that. Remove 'nvme_csi_has_nvm_support()' helper as suggested by Klaus we can safely assume NVM command

Re: [PATCH v3 19/33] block/nbd: split nbd_handle_updated_info out of nbd_client_handshake()

2021-06-09 Thread Eric Blake
On Wed, Jun 09, 2021 at 08:23:06PM +0300, Vladimir Sementsov-Ogievskiy wrote: > > > +if (s->x_dirty_bitmap) { > > > +if (!s->info.base_allocation) { > > > +error_setg(errp, "requested x-dirty-bitmap %s not found", > > > + s->x_dirty_bitmap); > > > +

[PATCH 2/2] nbd: Add new qemu:joint-allocation metadata context

2021-06-09 Thread Eric Blake
When trying to reconstruct a qcow2 chain using information provided over NBD, ovirt had been relying on an unsafe assumption that any portion of the qcow2 file advertised as sparse would defer to the backing image; this worked with what qemu 5.2 reports for a qcow2 BSD loaded with "backing":null.

[RFC PATCH 0/2] New NBD metacontext

2021-06-09 Thread Eric Blake
This is my counter-proposal to Nir's request [1] to revert a 6.0 behavior change. It does not expose any new information over NBD, but does make it easier to collect necessary information from a single context rather than requiring the client to have to request two contexts in parallel, then cross

[PATCH 1/2] iotests: Improve and rename test 309 to nbd-qemu-allocation

2021-06-09 Thread Eric Blake
Enhance the test to inspect what qemu-nbd is advertising during handshake, and rename it now that we support useful iotest names. Signed-off-by: Eric Blake --- .../qemu-iotests/{309 => tests/nbd-qemu-allocation} | 5 - .../{309.out => tests/nbd-qemu-allocation.out} | 12 +++-

Re: [PATCH] block: Move read-only check during truncation earlier

2021-06-09 Thread Kevin Wolf
Am 09.06.2021 um 18:30 hat Eric Blake geschrieben: > No need to start a tracked request that will always fail. The choice > to check read-only after bdrv_inc_in_flight() predates 1bc5f09f2e > (block: Use tracked request for truncate), but waiting for serializing > requests can make the effect more

Re: [PATCH v3 19/33] block/nbd: split nbd_handle_updated_info out of nbd_client_handshake()

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
03.06.2021 19:29, Eric Blake wrote: On Fri, Apr 16, 2021 at 11:08:57AM +0300, Vladimir Sementsov-Ogievskiy wrote: To be reused in the following patch. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd.c | 99 ++--- 1 file changed, 57 i

Re: [PATCH] block: Move read-only check during truncation earlier

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 19:30, Eric Blake wrote: No need to start a tracked request that will always fail. The choice to check read-only after bdrv_inc_in_flight() predates 1bc5f09f2e (block: Use tracked request for truncate), but waiting for serializing requests can make the effect more noticeable. Signed-

Re: [PATCH v4 0/6] Allow changing bs->file on reopen

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 18:53, Kevin Wolf wrote: Am 14.05.2021 um 17:53 hat Vladimir Sementsov-Ogievskiy geschrieben: Hi Alberto! What are your plans for v5? I'm now finishing a new series which makes backup-top filter public, and I want to base it on your series (otherwise I can't add a test). Berto, whe

[PATCH] block: Move read-only check during truncation earlier

2021-06-09 Thread Eric Blake
No need to start a tracked request that will always fail. The choice to check read-only after bdrv_inc_in_flight() predates 1bc5f09f2e (block: Use tracked request for truncate), but waiting for serializing requests can make the effect more noticeable. Signed-off-by: Eric Blake --- block/io.c |

Re: [PATCH v4 2/7] scsi-generic: pass max_segments via max_iov field in BlockLimits

2021-06-09 Thread Maxim Levitsky
On Tue, 2021-06-08 at 15:16 +0200, Paolo Bonzini wrote: > I/O to a disk via read/write is not limited by the number of segments allowed > by the host adapter; the kernel can split requests if needed, and the limit > imposed by the host adapter can be very low (256k or so) to avoid that SG_IO > retu

Re: [PATCH v4 4/7] file-posix: try BLKSECTGET on block devices too, do not round to power of 2

2021-06-09 Thread Maxim Levitsky
On Tue, 2021-06-08 at 15:16 +0200, Paolo Bonzini wrote: > bs->sg is only true for character devices, but block devices can also > be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET > returns bytes in an int for /dev/sgN devices, and sectors in a short > for block devices, so accoun

Re: [PATCH v4 3/7] block: add max_hw_transfer to BlockLimits

2021-06-09 Thread Maxim Levitsky
On Tue, 2021-06-08 at 15:16 +0200, Paolo Bonzini wrote: > For block host devices, I/O can happen through either the kernel file > descriptor I/O system calls (preadv/pwritev, io_submit, io_uring) > or the SCSI passthrough ioctl SG_IO. > > In the latter case, the size of each transfer can be limite

Re: [PATCH v4 1/7] file-posix: fix max_iov for /dev/sg devices

2021-06-09 Thread Maxim Levitsky
On Tue, 2021-06-08 at 22:14 +0300, Vladimir Sementsov-Ogievskiy wrote: > 08.06.2021 16:16, Paolo Bonzini wrote: > > Even though it was only called for devices that have bs->sg set (which > > must be character devices), sg_get_max_segments looked at /sys/dev/block > > which only works for block devi

Re: [PATCH v3 14/33] nbd: move connection code from block/nbd to nbd/client-connection

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
28.04.2021 11:14, Vladimir Sementsov-Ogievskiy wrote: +struct NBDClientConnection { +    /* Initialization constants */ +    SocketAddress *saddr; /* address to connect to */ + +    /* + * Result of last attempt. Valid in FAIL and SUCCESS states. + * If you want to steal error, don't forg

Re: [PATCH v4 0/6] Allow changing bs->file on reopen

2021-06-09 Thread Kevin Wolf
Am 14.05.2021 um 17:53 hat Vladimir Sementsov-Ogievskiy geschrieben: > Hi Alberto! > > What are your plans for v5? I'm now finishing a new series which makes > backup-top filter public, and I want to base it on your series > (otherwise I can't add a test). Berto, where are we with this? I see tha

[PATCH 7/7] vhost-user-blk: Implement reconnection during realize

2021-06-09 Thread Kevin Wolf
Commit dabefdd6 removed code that was supposed to try reconnecting during .realize(), but actually just crashed and had several design problems. This adds the feature back without the crash in simple cases while also fixing some design problems: Reconnection is now only tried if there was a proble

[PATCH 6/7] vhost-user-blk: Factor out vhost_user_blk_realize_connect()

2021-06-09 Thread Kevin Wolf
This function is the part that we will want to retry if the connection is lost during initialisation, so factor it out to keep the following patch simpler. The error path for vhost_dev_get_config() forgot disconnecting the chardev, add this while touching the code. Signed-off-by: Kevin Wolf ---

[PATCH 4/7] vhost-user-blk: Add Error parameter to vhost_user_blk_start()

2021-06-09 Thread Kevin Wolf
Instead of letting the caller make up a meaningless error message, add an Error parameter to allow reporting the real error. Signed-off-by: Kevin Wolf --- hw/block/vhost-user-blk.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/hw/block/vhos

[PATCH 2/7] vhost: Distinguish errors in vhost_backend_init()

2021-06-09 Thread Kevin Wolf
Instead of just returning 0/-1 and letting the caller make up a meaningless error message, add an Error parameter to allow reporting the real error and switch to 0/-errno so that different kind of errors can be distinguished in the caller. Specifically, in vhost-user, EPROTO is used for all errors

[PATCH 5/7] vhost: Distinguish errors in vhost_dev_get_config()

2021-06-09 Thread Kevin Wolf
Instead of just returning 0/-1 and letting the caller make up a meaningless error message, add an Error parameter to allow reporting the real error and switch to 0/-errno so that different kind of errors can be distinguished in the caller. Signed-off-by: Kevin Wolf --- include/hw/virtio/vhost-ba

[PATCH 1/7] vhost: Add Error parameter to vhost_dev_init()

2021-06-09 Thread Kevin Wolf
This allows callers to return better error messages instead of making one up while the real error ends up on stderr. Most callers can immediately make use of this because they already have an Error parameter themselves. The others just keep printing the error with error_report_err(). Signed-off-by

[PATCH 3/7] vhost: Return 0/-errno in vhost_dev_init()

2021-06-09 Thread Kevin Wolf
Instead of just returning 0/-1 and letting the caller make up a meaningless error message, switch to 0/-errno so that different kinds of errors can be distinguished in the caller. This involves changing a few more callbacks in VhostOps to return 0/-errno: .vhost_set_owner(), .vhost_get_features()

[PATCH 0/7] vhost-user-blk: Implement reconnection during realize

2021-06-09 Thread Kevin Wolf
My previous series removed the broken implementation of automatic reconnection during .realize(). This series adds some error reporting improvements that allow distinguishing cases where reconnecting could help from permanent errors, and then uses it to re-implement the automatic reconnection durin

Re: [PATCH v2] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 16:02, Kevin Wolf wrote: Am 09.06.2021 um 14:22 hat Paolo Bonzini geschrieben: If we want to wake up a coroutine from a worker thread, aio_co_wake() currently does not work. In that scenario, aio_co_wake() calls aio_co_enter(), but there is no current AioContext and therefore qemu_ge

Re: [PATCH v2] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 15:22, Paolo Bonzini wrote: If we want to wake up a coroutine from a worker thread, aio_co_wake() currently does not work. In that scenario, aio_co_wake() calls aio_co_enter(), but there is no current AioContext and therefore qemu_get_current_aio_context() returns the main thread. ai

Re: [PATCH v2] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Kevin Wolf
Am 09.06.2021 um 14:22 hat Paolo Bonzini geschrieben: > If we want to wake up a coroutine from a worker thread, aio_co_wake() > currently does not work. In that scenario, aio_co_wake() calls > aio_co_enter(), but there is no current AioContext and therefore > qemu_get_current_aio_context() returns

Re: [PATCH 1/1] hw/nvme: namespace parameter for EUI64

2021-06-09 Thread Heinrich Schuchardt
+cc qemu-block@nongnu.org On 6/9/21 1:46 PM, Heinrich Schuchardt wrote: The EUI64 field is the only identifier for NVMe namespaces in UEFI device paths. Add a new namespace property "eui64", that provides the user the option to specify the EUI64. Signed-off-by: Heinrich Schuchardt --- docs/s

Re: [PATCH v3 4/5] block-copy: add a CoMutex

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
08.06.2021 10:33, Emanuele Giuseppe Esposito wrote: Add a CoMutex to protect concurrent access of block-copy data structures. This mutex also protects .copy_bitmap, because its thread-safe API does not prevent it from assigning two tasks to the same bitmap region. .finished, .cancelled and read

[PATCH v2] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Paolo Bonzini
If we want to wake up a coroutine from a worker thread, aio_co_wake() currently does not work. In that scenario, aio_co_wake() calls aio_co_enter(), but there is no current AioContext and therefore qemu_get_current_aio_context() returns the main thread. aio_co_wake() then attempts to call aio_con

Re: [PATCH] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Paolo Bonzini
On 09/06/21 13:40, Vladimir Sementsov-Ogievskiy wrote: And in gdb all looks like aio_co_wake() in my own separate thread leads to coroutine execution exactly in my own thread.. So, it don't dead-lock on trying to acquire the context, instead it somehow enter to a coroutine.  And then deadloc

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-06-09 Thread Paolo Bonzini
On 09/06/21 12:24, Vladimir Sementsov-Ogievskiy wrote: Thanks, I'll base v4 of nbd patches on it. I now run make check. test-aio-multithread crashes on assertion: With the patch I've sent it doesn't, so hopefully you can go ahead. Paolo (gdb) bt #0  0x7f4af8d839d5 in raise () from /lib6

Re: [PATCH] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 14:32, Vladimir Sementsov-Ogievskiy wrote: 09.06.2021 13:53, Paolo Bonzini wrote: If we want to wake up a coroutine from a worker thread, aio_co_wake() currently does not work.  In that scenario, aio_co_wake() calls aio_co_enter(), but there is no current AioContext and therefore qemu

Re: [PATCH] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 13:53, Paolo Bonzini wrote: If we want to wake up a coroutine from a worker thread, aio_co_wake() currently does not work. In that scenario, aio_co_wake() calls aio_co_enter(), but there is no current AioContext and therefore qemu_get_current_aio_context() returns the main thread. ai

Re: [PATCH v3 1/5] block-copy: streamline choice of copy_range vs. read/write

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 12:33, Paolo Bonzini wrote: On 09/06/21 10:51, Vladimir Sementsov-Ogievskiy wrote: +    default: [...] +    bounce_buffer = qemu_blockalign(s->source->bs, nbytes); +    ret = bdrv_co_pread(s->source, offset, nbytes, bounce_buffer, 0); +    if (ret < 0) { +    trac

[PATCH] async: the main AioContext is only "current" if under the BQL

2021-06-09 Thread Paolo Bonzini
If we want to wake up a coroutine from a worker thread, aio_co_wake() currently does not work. In that scenario, aio_co_wake() calls aio_co_enter(), but there is no current AioContext and therefore qemu_get_current_aio_context() returns the main thread. aio_co_wake() then attempts to call aio_con

Re: [PATCH v2 3/3] qapi: deprecate drive-backup

2021-06-09 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > 08.06.2021 14:12, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >> [...] >> >>> TODO: We also need to deprecate drive-backup transaction action.. >>> But union members in QAPI doesn't support 'deprecated' feature. I tried >>> to dig

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 12:35, Paolo Bonzini wrote: On 08/06/21 20:45, Vladimir Sementsov-Ogievskiy wrote: 14.05.2021 00:04, Paolo Bonzini wrote: On 12/05/21 09:15, Vladimir Sementsov-Ogievskiy wrote: I don't understand.  Why doesn't aio_co_enter go through the ctx != qemu_get_current_aio_context() bra

Re: [PATCH v3 1/5] block-copy: streamline choice of copy_range vs. read/write

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 12:33, Paolo Bonzini wrote: On 09/06/21 10:51, Vladimir Sementsov-Ogievskiy wrote: +    default: [...] +    bounce_buffer = qemu_blockalign(s->source->bs, nbytes); +    ret = bdrv_co_pread(s->source, offset, nbytes, bounce_buffer, 0); +    if (ret < 0) { +    trac

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-06-09 Thread Paolo Bonzini
On 08/06/21 20:45, Vladimir Sementsov-Ogievskiy wrote: 14.05.2021 00:04, Paolo Bonzini wrote: On 12/05/21 09:15, Vladimir Sementsov-Ogievskiy wrote: I don't understand.  Why doesn't aio_co_enter go through the ctx != qemu_get_current_aio_context() branch and just do aio_co_schedule? That w

Re: [PATCH v3 1/5] block-copy: streamline choice of copy_range vs. read/write

2021-06-09 Thread Paolo Bonzini
On 09/06/21 10:51, Vladimir Sementsov-Ogievskiy wrote: +    default: [...] +bounce_buffer = qemu_blockalign(s->source->bs, nbytes); +    ret = bdrv_co_pread(s->source, offset, nbytes, bounce_buffer, 0); +    if (ret < 0) { +    trace_block_copy_read_fail(s, offset, ret)

Re: [PATCH v3 2/5] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
08.06.2021 10:33, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask and BlockCopyState in IN, State and OUT fields. This is just to understand which field has to be protected with a lock. .sleep_state is handled in the series "coroutine: new sleep/wake API

Re: Prevent compiler warning on block.c

2021-06-09 Thread Kevin Wolf
Am 09.06.2021 um 09:12 hat Thomas Huth geschrieben: > On 05/05/2021 10.05, Vladimir Sementsov-Ogievskiy wrote: > > 05.05.2021 10:59, Miroslav Rezanina wrote: > > > Commit 3108a15cf (block: introduce bdrv_drop_filter()) introduced > > > uninitialized > > > variable to_cow_parent in bdrv_replace_node

Re: [PATCH v3 1/5] block-copy: streamline choice of copy_range vs. read/write

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
08.06.2021 10:33, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDriverState to the other. Use .method instead of .copy_range a

Re: Prevent compiler warning on block.c

2021-06-09 Thread Thomas Huth
On 05/05/2021 10.05, Vladimir Sementsov-Ogievskiy wrote: 05.05.2021 10:59, Miroslav Rezanina wrote: Commit 3108a15cf (block: introduce bdrv_drop_filter()) introduced uninitialized variable to_cow_parent in bdrv_replace_node_common function that is used only when detach_subchain is true. It is u

Re: [PATCH 1/4] block.c: fix compilation error on possible unitialized variable

2021-06-09 Thread Thomas Huth
On 08/06/2021 16.09, Cleber Rosa wrote: GCC from CentOS Stream 8 is erroring out on a possibily unitialized varible. Full version info for the compiler used: gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-1) Signed-off-by: Cleber Rosa --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deleti