Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms

2022-03-04 Thread Sergio Lopez
On Fri, Mar 04, 2022 at 05:35:01AM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote: > > Add a section explaining how vhost-user is supported on platforms > > other than Linux. > > > > Signed-off-by: Sergio Lopez >

[PATCH v4 4/4] docs: vhost-user: add subsection for non-Linux platforms

2022-03-04 Thread Sergio Lopez
Add a section explaining how vhost-user is supported on platforms other than Linux. Signed-off-by: Sergio Lopez Reviewed-by: Stefan Hajnoczi --- docs/interop/vhost-user.rst | 20 1 file changed, 20 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop

[PATCH v4 2/4] vhost: use wfd on functions setting vring call fd

2022-03-04 Thread Sergio Lopez
When ioeventfd is emulated using qemu_pipe(), only EventNotifier's wfd can be used for writing. Use the recently introduced event_notifier_get_wfd() function to obtain the fd that our peer must use to signal the vring. Signed-off-by: Sergio Lopez Reviewed-by: Stefan Hajnoczi --- hw/virtio

[PATCH v4 3/4] configure, meson: allow enabling vhost-user on all POSIX systems

2022-03-04 Thread Sergio Lopez
) a linux-only feature. Signed-off-by: Sergio Lopez Reviewed-by: Stefan Hajnoczi --- configure | 4 ++-- meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c56ed53ee3..daccf4be7c 100755 --- a/configure +++ b/configure @@ -1659,8

[PATCH v4 1/4] event_notifier: add event_notifier_get_wfd()

2022-03-04 Thread Sergio Lopez
SET_VRING_CALL. Add a new event_notifier_get_wfd(const EventNotifier *e) that can be used to obtain wfd where needed. Signed-off-by: Sergio Lopez Reviewed-by: Stefan Hajnoczi --- include/qemu/event_notifier.h | 1 + util/event_notifier-posix.c | 5 + 2 files changed, 6 insertions(+) diff

[PATCH v4 0/4] Enable vhost-user to be used on BSD systems

2022-03-04 Thread Sergio Lopez
ini) v2->v3: - Add a section to docs/interop/vhost-user.rst explaining how vhost-user is supported on non-Linux platforms. (Stefan Hajnoczi) v3->v4: - Some documentation fixes. (Stefan Hajnoczi) - Pick up Reviewed-by tags. Sergio Lopez (4): event_notifier: add event_notifier_ge

[PATCH v3 3/4] configure, meson: allow enabling vhost-user on all POSIX systems

2022-03-03 Thread Sergio Lopez
) a linux-only feature. Signed-off-by: Sergio Lopez --- configure | 4 ++-- meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c56ed53ee3..daccf4be7c 100755 --- a/configure +++ b/configure @@ -1659,8 +1659,8 @@ fi # vhost

[PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms

2022-03-03 Thread Sergio Lopez
Add a section explaining how vhost-user is supported on platforms other than Linux. Signed-off-by: Sergio Lopez --- docs/interop/vhost-user.rst | 18 ++ 1 file changed, 18 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index edc3ad84a3

[PATCH v3 2/4] vhost: use wfd on functions setting vring call fd

2022-03-03 Thread Sergio Lopez
When ioeventfd is emulated using qemu_pipe(), only EventNotifier's wfd can be used for writing. Use the recently introduced event_notifier_get_wfd() function to obtain the fd that our peer must use to signal the vring. Signed-off-by: Sergio Lopez --- hw/virtio/vhost.c | 6 +++--- 1 file

[PATCH v3 1/4] event_notifier: add event_notifier_get_wfd()

2022-03-03 Thread Sergio Lopez
SET_VRING_CALL. Add a new event_notifier_get_wfd(const EventNotifier *e) that can be used to obtain wfd where needed. Signed-off-by: Sergio Lopez --- include/qemu/event_notifier.h | 1 + util/event_notifier-posix.c | 5 + 2 files changed, 6 insertions(+) diff --git a/include/qemu

[PATCH v3 0/4] Enable vhost-user to be used on BSD systems

2022-03-03 Thread Sergio Lopez
ini) v2->v3: - Add a section to docs/interop/vhost-user.rst explaining how vhost-user is supported on non-Linux platforms. (Stefan Hajnoczi) Sergio Lopez (4): event_notifier: add event_notifier_get_wfd() vhost: use wfd on functions setting vring call fd configure, meson: allow enabling

[PATCH v2 2/3] vhost: use wfd on functions setting vring call fd

2022-03-02 Thread Sergio Lopez
When ioeventfd is emulated using qemu_pipe(), only EventNotifier's wfd can be used for writing. Use the recently introduced event_notifier_get_wfd() function to obtain the fd that our peer must use to signal the vring. Signed-off-by: Sergio Lopez --- hw/virtio/vhost.c | 6 +++--- 1 file

[PATCH v2 0/3] Enable vhost-user to be used on BSD systems

2022-03-02 Thread Sergio Lopez
ng vring call fd" - Rename: "Allow building vhost-user in BSD" to "configure, meson: allow enabling vhost-user on all POSIX systems" - Instead of making possible enabling vhost-user on Linux and BSD systems, allow enabling it on all non-Windows platfo

[PATCH v2 1/3] event_notifier: add event_notifier_get_wfd()

2022-03-02 Thread Sergio Lopez
SET_VRING_CALL. Add a new event_notifier_get_wfd(const EventNotifier *e) that can be used to obtain wfd where needed. Signed-off-by: Sergio Lopez --- include/qemu/event_notifier.h | 1 + util/event_notifier-posix.c | 5 + 2 files changed, 6 insertions(+) diff --git a/include/qemu

[PATCH v2 3/3] configure, meson: allow enabling vhost-user on all POSIX systems

2022-03-02 Thread Sergio Lopez
) a linux-only feature. Signed-off-by: Sergio Lopez --- configure | 4 ++-- meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c56ed53ee3..daccf4be7c 100755 --- a/configure +++ b/configure @@ -1659,8 +1659,8 @@ fi # vhost

Re: [PATCH 2/2] Allow building vhost-user in BSD

2022-03-02 Thread Sergio Lopez
On Wed, Mar 02, 2022 at 06:38:07PM +0100, Philippe Mathieu-Daudé wrote: > On 2/3/22 18:31, Sergio Lopez wrote: > > On Wed, Mar 02, 2022 at 06:18:59PM +0100, Philippe Mathieu-Daudé wrote: > > > On 2/3/22 18:10, Paolo Bonzini wrote: > > > > On 3/

Re: [PATCH 2/2] Allow building vhost-user in BSD

2022-03-02 Thread Sergio Lopez
On Wed, Mar 02, 2022 at 06:18:59PM +0100, Philippe Mathieu-Daudé wrote: > On 2/3/22 18:10, Paolo Bonzini wrote: > > On 3/2/22 12:36, Sergio Lopez wrote: > > > With the possibility of using pipefd as a replacement on operating > > > systems that doesn't support eventf

Re: [PATCH 1/2] Allow returning EventNotifier's wfd

2022-03-02 Thread Sergio Lopez
On Wed, Mar 02, 2022 at 08:12:34AM -0700, Alex Williamson wrote: > On Wed, 2 Mar 2022 12:36:43 +0100 > Sergio Lopez wrote: > > > event_notifier_get_fd(const EventNotifier *e) always returns > > EventNotifier's read file descriptor (rfd). This is not a problem when

[PATCH 1/2] Allow returning EventNotifier's wfd

2022-03-02 Thread Sergio Lopez
SET_VRING_CALL. Extend event_notifier_get_fd() to receive an argument which indicates whether the caller wants to obtain rfd (false) or wfd (true). Signed-off-by: Sergio Lopez --- accel/kvm/kvm-all.c | 12 +++ block/linux-aio.c | 2 +- block/nvme.c

[PATCH 0/2] Enable vhost-user to be used on BSD systems

2022-03-02 Thread Sergio Lopez
enabling vhost-user on BSD. Sergio Lopez (2): Allow returning EventNotifier's wfd Allow building vhost-user in BSD accel/kvm/kvm-all.c | 12 +++ block/linux-aio.c | 2 +- block/nvme.c| 2 +- configure

[PATCH 2/2] Allow building vhost-user in BSD

2022-03-02 Thread Sergio Lopez
-by: Sergio Lopez --- configure | 5 +++-- meson.build | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c56ed53ee3..93aa22e345 100755 --- a/configure +++ b/configure @@ -1659,8 +1659,9 @@ fi # vhost interdependencies and host support # vhost

Re: [PATCH v2 2/2] nbd/server: Use drained block ops to quiesce the server

2021-06-02 Thread Sergio Lopez
On Wed, Jun 02, 2021 at 03:06:02PM +0300, Vladimir Sementsov-Ogievskiy wrote: > 02.06.2021 09:05, Sergio Lopez wrote: > > Before switching between AioContexts we need to make sure that we're > > fully quiesced ("nb_requests == 0" for every client) when enterin

[PATCH v2 2/2] nbd/server: Use drained block ops to quiesce the server

2021-06-02 Thread Sergio Lopez
. With these changes, "blk_aio_attach()" and "blk_aio_detach()" can be reverted to be as simple as they were before f148ae7d36. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1960137 Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez --- nbd/server.c | 82 +

[PATCH v2 1/2] block-backend: add drained_poll

2021-06-02 Thread Sergio Lopez
-by: Sergio Lopez --- block/block-backend.c | 7 ++- include/sysemu/block-backend.h | 4 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c index de5496af66..8fcc2b4b3d 100644 --- a/block/block-backend.c +++ b/block/block

[PATCH v2 0/2] nbd/server: Quiesce server on drained section

2021-06-02 Thread Sergio Lopez
Change .drained_poll comment to reflect that the returned boolean value will be true if the device is still busy, or false otherwise - Drop yield_co_list and use recv_coroutine and read_yielding [Kevin] - Return "true" or "false" in nbd_drained_poll [Kevin] - Fix grammar in the

Re: [PATCH 2/2] nbd/server: Use drained block ops to quiesce the server

2021-06-01 Thread Sergio Lopez
On Tue, Jun 01, 2021 at 04:29:07PM -0500, Eric Blake wrote: > On Tue, Jun 01, 2021 at 07:57:28AM +0200, Sergio Lopez wrote: > > Before switching between AioContexts we need to make sure that we're > > fully quiesced ("nb_requests == 0" for every client) when enterin

Re: [PATCH 1/2] block-backend: add drained_poll

2021-06-01 Thread Sergio Lopez
On Tue, Jun 01, 2021 at 05:59:10PM +0200, Kevin Wolf wrote: > Am 01.06.2021 um 07:57 hat Sergio Lopez geschrieben: > > Allow block backends to poll their devices/users to check if they have > > been quiesced when entering a drained section. > > > > This will be use

Re: [PATCH 2/2] nbd/server: Use drained block ops to quiesce the server

2021-06-01 Thread Sergio Lopez
On Tue, Jun 01, 2021 at 06:08:41PM +0200, Kevin Wolf wrote: > Am 01.06.2021 um 07:57 hat Sergio Lopez geschrieben: > > Before switching between AioContexts we need to make sure that we're > > fully quiesced ("nb_requests == 0" for every client) when entering the > >

[PATCH 1/2] block-backend: add drained_poll

2021-05-31 Thread Sergio Lopez
Allow block backends to poll their devices/users to check if they have been quiesced when entering a drained section. This will be used in the next patch to wait for the NBD server to be completely quiesced. Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez --- block/block-backend.c

[PATCH 0/2] nbd/server: Quiesce server on drained section

2021-05-31 Thread Sergio Lopez
is, we add ".drained_poll" to BlockDevOps and use it in the NBD server, along with ".drained_being" and "drained_end", to coordinate the quiescing of the server while entering a drained section. Sergio Lopez (2): block-backend: add drained_poll nbd/server: Use

[PATCH 2/2] nbd/server: Use drained block ops to quiesce the server

2021-05-31 Thread Sergio Lopez
. With these changes, "blk_aio_attach()" and "blk_aio_detach()" can be reverted to be as simple as they were before f148ae7d36. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1960137 Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez --- nbd/server.c | 99 +

[PATCH v4 2/2] block: move blk_exp_close_all() to qemu_cleanup()

2021-02-01 Thread Sergio Lopez
: https://bugzilla.redhat.com/show_bug.cgi?id=1900505 Signed-off-by: Sergio Lopez --- block.c | 1 - qemu-nbd.c | 1 + softmmu/runstate.c | 9 + storage-daemon/qemu-storage-daemon.c | 1 + 4 files changed, 11

[PATCH v4 1/2] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2021-02-01 Thread Sergio Lopez
xts. To avoid this problem, add every child and parent to the ignore list before actually processing them. Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez --- block.c | 34 +++--- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/block.c b/block.c in

[PATCH v4 0/2] nbd/server: Quiesce coroutines on context switch

2021-02-01 Thread Sergio Lopez
id processing BDS twice in bdrv_set_aio_context_ignore()" - Add "block: Close block exports in two steps" - Rename nbd_read_eof() to nbd_server_read_eof() (Eric Blake) - Fix double space and typo in comment. (Eric Blake) Sergio Lopez (2): block: Avoid processing BDS twice in

Re: [PATCH v3 2/2] block: move blk_exp_close_all() to qemu_cleanup()

2021-02-01 Thread Sergio Lopez
On Mon, Feb 01, 2021 at 01:20:30PM +0100, Kevin Wolf wrote: > Am 21.01.2021 um 18:07 hat Sergio Lopez geschrieben: > > Move blk_exp_close_all() from bdrv_close() to qemu_cleanup(), before > > bdrv_drain_all_begin(). > > > > Export drivers may have coroutines yielding

Re: [PATCH v3 1/2] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2021-02-01 Thread Sergio Lopez
On Mon, Feb 01, 2021 at 01:06:31PM +0100, Kevin Wolf wrote: > Am 21.01.2021 um 18:06 hat Sergio Lopez geschrieben: > > Some graphs may contain an indirect reference to the first BDS in the > > chain that can be reached while walking it bottom->up from one its > > chi

[PATCH v3 2/2] block: move blk_exp_close_all() to qemu_cleanup()

2021-01-21 Thread Sergio Lopez
: https://bugzilla.redhat.com/show_bug.cgi?id=1900505 Signed-off-by: Sergio Lopez --- block.c| 1 - softmmu/runstate.c | 9 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 3da99312db..9682c82fa8 100644 --- a/block.c +++ b/block.c

[PATCH v3 0/2] nbd/server: Quiesce coroutines on context switch

2021-01-21 Thread Sergio Lopez
block exports in two steps" - Rename nbd_read_eof() to nbd_server_read_eof() (Eric Blake) - Fix double space and typo in comment. (Eric Blake) Sergio Lopez (2): block: Avoid processing BDS twice in bdrv_set_aio_context_ignore() block: move blk_exp_close_all() to qemu_cleanup() bloc

[PATCH v3 1/2] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2021-01-21 Thread Sergio Lopez
xts. To avoid this problem, add every child and parent to the ignore list before actually processing them. Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez --- block.c | 34 +++--- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/block.c b/block.c in

Re: [PATCH v2 0/4] nbd/server: Quiesce coroutines on context switch

2021-01-20 Thread Sergio Lopez
On Wed, Jan 20, 2021 at 02:49:14PM -0600, Eric Blake wrote: > On 12/14/20 11:05 AM, Sergio Lopez wrote: > > This series allows the NBD server to properly switch between AIO contexts, > > having quiesced recv_coroutine and send_coroutine before doing the > > transit

Re: [PATCH v2 4/4] block: Close block exports in two steps

2020-12-21 Thread Sergio Lopez
On Tue, Dec 15, 2020 at 04:34:05PM +0100, Kevin Wolf wrote: > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > There's a cross-dependency between closing the block exports and > > draining the block layer. The latter needs that we close all export's > > client

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-17 Thread Sergio Lopez
On Thu, Dec 17, 2020 at 02:06:02PM +0100, Kevin Wolf wrote: > Am 17.12.2020 um 13:50 hat Vladimir Sementsov-Ogievskiy geschrieben: > > 17.12.2020 13:58, Kevin Wolf wrote: > > > Am 17.12.2020 um 10:37 hat Sergio Lopez geschrieben: > > > > On Wed, Dec 16, 2020 at 07:3

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-17 Thread Sergio Lopez
On Thu, Dec 17, 2020 at 11:58:30AM +0100, Kevin Wolf wrote: > Am 17.12.2020 um 10:37 hat Sergio Lopez geschrieben: > > Do you think it's safe to re-enter backup-top, or should we look for a > > way to avoid this? > > I think it should be avoided, but I don't understand why p

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-17 Thread Sergio Lopez
On Wed, Dec 16, 2020 at 07:31:02PM +0100, Kevin Wolf wrote: > Am 16.12.2020 um 15:55 hat Sergio Lopez geschrieben: > > On Wed, Dec 16, 2020 at 01:35:14PM +0100, Kevin Wolf wrote: > > > Am 15.12.2020 um 18:23 hat Sergio Lopez geschrieben: > > > > On Tue, Dec 15, 2020 a

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-16 Thread Sergio Lopez
On Wed, Dec 16, 2020 at 01:35:14PM +0100, Kevin Wolf wrote: > Am 15.12.2020 um 18:23 hat Sergio Lopez geschrieben: > > On Tue, Dec 15, 2020 at 04:01:19PM +0100, Kevin Wolf wrote: > > > Am 15.12.2020 um 14:15 hat Sergio Lopez geschrieben: > > > > On Tue, Dec 15, 2020 a

Re: [PATCH v2 4/4] block: Close block exports in two steps

2020-12-15 Thread Sergio Lopez
On Tue, Dec 15, 2020 at 04:34:05PM +0100, Kevin Wolf wrote: > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > There's a cross-dependency between closing the block exports and > > draining the block layer. The latter needs that we close all export's > > client

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-15 Thread Sergio Lopez
On Tue, Dec 15, 2020 at 04:01:19PM +0100, Kevin Wolf wrote: > Am 15.12.2020 um 14:15 hat Sergio Lopez geschrieben: > > On Tue, Dec 15, 2020 at 01:12:33PM +0100, Kevin Wolf wrote: > > > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > > > While proces

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-15 Thread Sergio Lopez
On Tue, Dec 15, 2020 at 01:12:33PM +0100, Kevin Wolf wrote: > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > While processing the parents of a BDS, one of the parents may process > > the child that's doing the tail recursion, which leads to a BDS being >

[PATCH v2 4/4] block: Close block exports in two steps

2020-12-14 Thread Sergio Lopez
shut down. Then, in bdrv_close_all we make two calls, one without waiting to close all client connections, and another after draining the block layer, this time waiting for the exports to be fully quiesced. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1900505 Signed-off-by: Sergio Lopez --

[PATCH v2 1/4] block: Honor blk_set_aio_context() context requirements

2020-12-14 Thread Sergio Lopez
use of this function, this rule also applies to it. Fix all occurrences where this rule wasn't honored. Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez --- hw/block/dataplane/virtio-blk.c | 4 hw/block/dataplane/xen-block.c | 7 ++- hw/scsi/virtio-scsi.c | 6 -- 3

[PATCH v2 0/4] nbd/server: Quiesce coroutines on context switch

2020-12-14 Thread Sergio Lopez
ts" (Kevin Wolf) - Add "block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()" - Add "block: Close block exports in two steps" - Rename nbd_read_eof() to nbd_server_read_eof() (Eric Blake) - Fix double space and typo in comment. (Eric Blake) Sergio Lopez

[PATCH v2 3/4] nbd/server: Quiesce coroutines on context switch

2020-12-14 Thread Sergio Lopez
ine to interrupt it. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1900326 Signed-off-by: Sergio Lopez Reviewed-by: Eric Blake --- nbd/server.c | 120 +-- 1 file changed, 106 insertions(+), 14 deletions(-) diff --git a/nbd/server.c b/nbd/serve

[PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-14 Thread Sergio Lopez
this, add the BDS pointer to the ignore list, and check the child BDS pointer while iterating over the children. Signed-off-by: Sergio Lopez --- block.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index f1cedac362..bc8a66ab6e 100644 --- a/block.c +++ b

Re: [PATCH 2/2] nbd/server: Quiesce coroutines on context switch

2020-12-09 Thread Sergio Lopez
On Fri, Dec 04, 2020 at 12:39:07PM -0600, Eric Blake wrote: > On 12/4/20 10:53 AM, Sergio Lopez wrote: > > When switching between AIO contexts we need to me make sure that both > > recv_coroutine and send_coroutine are not scheduled to run. Otherwise, > > QEMU may crash wh

Re: [PATCH 1/2] virtio-blk: Acquire context while switching them on dataplane start

2020-12-09 Thread Sergio Lopez
On Mon, Dec 07, 2020 at 04:37:53PM +0100, Kevin Wolf wrote: > Am 04.12.2020 um 17:53 hat Sergio Lopez geschrieben: > > On dataplane start, acquire the new AIO context before calling > > 'blk_set_aio_context', releasing it immediately afterwards. This > > prevents reaching t

[PATCH 1/2] virtio-blk: Acquire context while switching them on dataplane start

2020-12-04 Thread Sergio Lopez
with an unprotected AIO context. Signed-off-by: Sergio Lopez --- hw/block/dataplane/virtio-blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 37499c5564..034e43cb1f 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw

[PATCH 2/2] nbd/server: Quiesce coroutines on context switch

2020-12-04 Thread Sergio Lopez
ine to interrupt it. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1900326 Signed-off-by: Sergio Lopez --- nbd/server.c | 120 +-- 1 file changed, 106 insertions(+), 14 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 613ed26

[PATCH 0/2] nbd/server: Quiesce coroutines on context switch

2020-12-04 Thread Sergio Lopez
that can happen multiple times during the lifetime of a VM (usually during the boot sequence or on a reboot), and we drag the NBD server of the correspoing export with it. Sergio Lopez (2): virtio-blk: Acquire context while switching them on dataplane start nbd/server: Quiesce coroutines on context

Re: Libvirt driver iothread property for virtio-scsi disks

2020-11-04 Thread Sergio Lopez
On Wed, Nov 04, 2020 at 05:48:40PM +0200, Nir Soffer wrote: > The docs[1] say: > > - The optional iothread attribute assigns the disk to an IOThread as defined > by > the range for the domain iothreads value. Multiple disks may be assigned to > the same IOThread and are numbered from 1 to

Re: virtio-scsi and another complex AioContext issue

2020-06-24 Thread Sergio Lopez
On Tue, Jun 23, 2020 at 03:24:54PM +0100, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2020 at 04:16:04PM +0200, Sergio Lopez wrote: > > On Fri, Jun 19, 2020 at 02:04:06PM +0100, Stefan Hajnoczi wrote: > > > On Thu, Jun 11, 2020 at 10:36:22AM +0200, Sergio Lopez

Re: virtio-scsi and another complex AioContext issue

2020-06-22 Thread Sergio Lopez
On Fri, Jun 19, 2020 at 02:04:06PM +0100, Stefan Hajnoczi wrote: > On Thu, Jun 11, 2020 at 10:36:22AM +0200, Sergio Lopez wrote: > > Hi, > > > > While debugging BZ#1844343, I managed to reproduce the issue which > > leads to crash with a backtrace like this one: > >

Re: [PATCH v2 1/7] block/nvme: poll queues without q->lock

2020-06-22 Thread Sergio Lopez
continue; > +} > + > qemu_mutex_lock(>lock); > while (nvme_process_completion(s, q)) { > /* Keep polling */ > -- > 2.26.2 > Thanks for extending the comment. Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

[PATCH 0/2] virtio-blk: Avoid processing requests on the main context on restart

2020-06-03 Thread Sergio Lopez
el/2020-06/msg00304.html Sergio Lopez (2): virtio-blk: Refactor the code that processes queued requests virtio-blk: On restart, process queued requests in the proper context include/hw/virtio/virtio-blk.h | 1 + hw/block/dataplane/virtio-blk.c | 8 hw/block/virtio-blk.c

[PATCH 1/2] virtio-blk: Refactor the code that processes queued requests

2020-06-03 Thread Sergio Lopez
Move the code that processes queued requests from virtio_blk_dma_restart_bh() to its own, non-static, function. This will allow us to call it from the virtio_blk_data_plane_start() in a future patch. Signed-off-by: Sergio Lopez --- include/hw/virtio/virtio-blk.h | 1 + hw/block/virtio-blk.c

[PATCH 2/2] virtio-blk: On restart, process queued requests in the proper context

2020-06-03 Thread Sergio Lopez
dy scheduled in 'aio_co_schedule' RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1812765 Signed-off-by: Sergio Lopez --- include/hw/virtio/virtio-blk.h | 2 +- hw/block/dataplane/virtio-blk.c | 8 hw/block/virtio-blk.c | 18 -- 3 files changed, 21 insertions(+),

Re: [PATCH] virtio-blk: Disable request queuing while switching contexts

2020-06-02 Thread Sergio Lopez
On Tue, Jun 02, 2020 at 03:04:33PM +0200, Kevin Wolf wrote: > Am 02.06.2020 um 14:18 hat Sergio Lopez geschrieben: > > On Tue, Jun 02, 2020 at 01:23:14PM +0200, Kevin Wolf wrote: > > > Am 02.06.2020 um 10:11 hat Sergio Lopez geschrieben: > > > > Disable request qu

Re: [PATCH] virtio-blk: Disable request queuing while switching contexts

2020-06-02 Thread Sergio Lopez
On Tue, Jun 02, 2020 at 01:23:14PM +0200, Kevin Wolf wrote: > Am 02.06.2020 um 10:11 hat Sergio Lopez geschrieben: > > Disable request queuing while switching contexts on > > virtio_blk_data_plane_[start|stop](), preventing requests from getting > > queued on the wrong con

[PATCH] virtio-blk: Disable request queuing while switching contexts

2020-06-02 Thread Sergio Lopez
5 Signed-off-by: Sergio Lopez --- hw/block/dataplane/virtio-blk.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 1b52e8159c..f1c7ba69c0 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/

Re: [PATCH 1/7] block/nvme: poll queues without q->lock

2020-05-29 Thread Sergio Lopez
On Thu, May 28, 2020 at 04:23:50PM +0100, Stefan Hajnoczi wrote: > On Mon, May 25, 2020 at 10:07:13AM +0200, Sergio Lopez wrote: > > On Tue, May 19, 2020 at 06:11:32PM +0100, Stefan Hajnoczi wrote: > > > A lot of CPU time is spent simply locking/unlocking q->lock during

Re: [PATCH 7/7] block/nvme: support nested aio_poll()

2020-05-25 Thread Sergio Lopez
Previously the nvme block driver would hang > because it didn't process completions from nested aio_poll(). > > Signed-off-by: Stefan Hajnoczi > --- > block/nvme.c | 67 -- > block/trace-events | 2 +- > 2 files changed, 60 in

Re: [PATCH 6/7] block/nvme: keep BDRVNVMeState pointer in NVMeQueuePair

2020-05-25 Thread Sergio Lopez
later patch and only one argument can be passed to it. > > Signed-off-by: Stefan Hajnoczi > --- > block/nvme.c | 70 > 1 file changed, 38 insertions(+), 32 deletions(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 5/7] block/nvme: clarify that free_req_queue is protected by q->lock

2020-05-25 Thread Sergio Lopez
On Tue, May 19, 2020 at 06:11:36PM +0100, Stefan Hajnoczi wrote: > Existing users access free_req_queue under q->lock. Document this. > > Signed-off-by: Stefan Hajnoczi > --- > block/nvme.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Sergio L

Re: [PATCH 3/7] block/nvme: don't access CQE after moving cq.head

2020-05-25 Thread Sergio Lopez
oczi > --- > block/nvme.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 4/7] block/nvme: switch to a NVMeRequest freelist

2020-05-25 Thread Sergio Lopez
-- > 1 file changed, 54 insertions(+), 27 deletions(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 2/7] block/nvme: drop tautologous assertion

2020-05-25 Thread Sergio Lopez
E_QUEUE_SIZE); > > Signed-off-by: Stefan Hajnoczi > --- > block/nvme.c | 1 - > 1 file changed, 1 deletion(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 1/7] block/nvme: poll queues without q->lock

2020-05-25 Thread Sergio Lopez
On Tue, May 19, 2020 at 06:11:32PM +0100, Stefan Hajnoczi wrote: > A lot of CPU time is spent simply locking/unlocking q->lock during > polling. Check for completion outside the lock to make q->lock disappear > from the profile. > > Signed-off-by: Stefan Hajnoczi > --- > block/nvme.c | 12

Re: [PATCH] backup: don't acquire aio_context in backup_clean

2020-03-26 Thread Sergio Lopez
On Thu, Mar 26, 2020 at 08:54:53AM +0300, Vladimir Sementsov-Ogievskiy wrote: > 25.03.2020 18:50, Stefan Reiter wrote: > > backup_clean is only ever called as a handler via job_exit, which > > Hmm.. I'm afraid it's not quite correct. > > job_clean > > job_finalize_single > >

Re: [PATCH 5/5] aio-posix: make AioHandler dispatch O(1) with epoll

2020-02-19 Thread Sergio Lopez
++-- > 1 file changed, 76 insertions(+), 30 deletions(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 4/5] aio-posix: make AioHandler deletion O(1)

2020-02-19 Thread Sergio Lopez
+--- > 3 files changed, 43 insertions(+), 19 deletions(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 3/5] qemu/queue.h: add QLIST_SAFE_REMOVE()

2020-02-19 Thread Sergio Lopez
> > Signed-off-by: Stefan Hajnoczi > --- > block.c | 5 + > chardev/spice.c | 4 +--- > include/qemu/queue.h | 14 ++ > 3 files changed, 16 insertions(+), 7 deletions(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 2/5] aio-posix: don't pass ns timeout to epoll_wait()

2020-02-19 Thread Sergio Lopez
ue in the wrong > units is still ugly. Pass a 0 timeout to epoll_wait() instead. > > Signed-off-by: Stefan Hajnoczi > --- > util/aio-posix.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH 1/5] aio-posix: fix use after leaving scope in aio_poll()

2020-02-18 Thread Sergio Lopez
.c | 20 ++++---- > 1 file changed, 8 insertions(+), 12 deletions(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH v2 2/4] virtio-scsi: default num_queues to -smp N

2020-02-03 Thread Sergio Lopez
On Mon, Feb 03, 2020 at 10:57:44AM +, Daniel P. Berrangé wrote: > On Mon, Feb 03, 2020 at 11:25:29AM +0100, Sergio Lopez wrote: > > On Thu, Jan 30, 2020 at 10:52:35AM +, Stefan Hajnoczi wrote: > > > On Thu, Jan 30, 2020 at 01:29:16AM +0100, Paolo Bonzini wrote: > &g

Re: [PATCH v2 2/4] virtio-scsi: default num_queues to -smp N

2020-02-03 Thread Sergio Lopez
On Thu, Jan 30, 2020 at 10:52:35AM +, Stefan Hajnoczi wrote: > On Thu, Jan 30, 2020 at 01:29:16AM +0100, Paolo Bonzini wrote: > > On 29/01/20 16:44, Stefan Hajnoczi wrote: > > > On Mon, Jan 27, 2020 at 02:10:31PM +0100, Cornelia Huck wrote: > > >> On Fri, 24 Jan 2020 10:01:57 + > > >>

[PATCH v6 5/8] block/backup-top: Don't acquire context while dropping top

2020-01-08 Thread Sergio Lopez
to it have it already acquired (backup_clean()). RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1782111 Signed-off-by: Sergio Lopez --- block/backup-top.c | 5 - block/backup.c | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/block/backup-top.c b/block/backup-top.c

[PATCH v6 8/8] iotests: Test handling of AioContexts with some blockdev actions

2020-01-08 Thread Sergio Lopez
one of them, a VM with a number of disks running in an IOThread AioContext is used. Signed-off-by: Sergio Lopez --- tests/qemu-iotests/281 | 247 + tests/qemu-iotests/281.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 253 insertions

[PATCH v6 7/8] blockdev: Return bs to the proper context on snapshot abort

2020-01-08 Thread Sergio Lopez
23d13201 in main_loop () at vl.c:1828 #24 0x557223bbfb82 in main (argc=, argv=, envp=) at vl.c:4504 RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1779036 Signed-off-by: Sergio Lopez --- blockdev.c | 21 + 1 file changed, 21 insertions(+) diff --git a/blockdev.c b/

[PATCH v6 1/8] blockdev: fix coding style issues in drive_backup_prepare

2020-01-08 Thread Sergio Lopez
Fix a couple of minor coding style issues in drive_backup_prepare. Signed-off-by: Sergio Lopez Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf --- blockdev.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 8e029e9c01..553e315972 100644

[PATCH v6 0/8] blockdev: Fix AioContext handling for various blockdev actions

2020-01-08 Thread Sergio Lopez
. (thanks Max Reitz) - Convert a single patch into a two-patch series. --- Sergio Lopez (8): blockdev: fix coding style issues in drive_backup_prepare blockdev: unify qmp_drive_backup and drive-backup transaction paths blockdev: unify qmp_blockdev_backup and blockdev-backup

[PATCH v6 6/8] blockdev: Acquire AioContext on dirty bitmap functions

2020-01-08 Thread Sergio Lopez
#22 0x5650220743c1 in main_loop () at vl.c:1828 #23 0x565021f20a72 in main (argc=, argv=, envp=) at vl.c:4504 Fix this by acquiring the AioContext at qmp_block_dirty_bitmap_add() and qmp_block_dirty_bitmap_add(). RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1

[PATCH v6 4/8] blockdev: honor bdrv_try_set_aio_context() context requirements

2020-01-08 Thread Sergio Lopez
bdrv_try_set_aio_context() requires that the old context is held, and the new context is not held. Fix all the occurrences where it's not done this way. Suggested-by: Max Reitz Signed-off-by: Sergio Lopez --- blockdev.c | 68 +++--- 1 file

[PATCH v6 3/8] blockdev: unify qmp_blockdev_backup and blockdev-backup transaction paths

2020-01-08 Thread Sergio Lopez
is visible from the user's perspective, as the job gets paused and immediately resumed before starting the actual work. Signed-off-by: Sergio Lopez Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf --- blockdev.c | 60 -- 1 file changed, 13 insertions

[PATCH v6 2/8] blockdev: unify qmp_drive_backup and drive-backup transaction paths

2020-01-08 Thread Sergio Lopez
perspective, as the job gets paused and immediately resumed before starting the actual work. Also fix tests 141, 185 and 219 to cope with the extra JOB_STATUS_CHANGE lines. Signed-off-by: Sergio Lopez Reviewed-by: Kevin Wolf --- blockdev.c | 224

Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements

2019-12-20 Thread Sergio Lopez
Sergio Lopez writes: > Sergio Lopez writes: > >> Kevin Wolf writes: >> >>> Am 13.12.2019 um 21:59 hat Eric Blake geschrieben: >>>> On 12/9/19 10:06 AM, Kevin Wolf wrote: >>>> > Am 28.11.2019 um 11:41 hat Sergio Lopez geschrieben: >

Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements

2019-12-19 Thread Sergio Lopez
Sergio Lopez writes: > Kevin Wolf writes: > >> Am 13.12.2019 um 21:59 hat Eric Blake geschrieben: >>> On 12/9/19 10:06 AM, Kevin Wolf wrote: >>> > Am 28.11.2019 um 11:41 hat Sergio Lopez geschrieben: >>> > > bdrv_try_set_aio_context() requires t

Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements

2019-12-18 Thread Sergio Lopez
Kevin Wolf writes: > Am 13.12.2019 um 21:59 hat Eric Blake geschrieben: >> On 12/9/19 10:06 AM, Kevin Wolf wrote: >> > Am 28.11.2019 um 11:41 hat Sergio Lopez geschrieben: >> > > bdrv_try_set_aio_context() requires that the old context is held, and >> >

Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements

2019-12-18 Thread Sergio Lopez
Kevin Wolf writes: > Am 28.11.2019 um 11:41 hat Sergio Lopez geschrieben: >> bdrv_try_set_aio_context() requires that the old context is held, and >> the new context is not held. Fix all the occurrences where it's not >> done this way. >> >> Suggested-by: Ma

Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements

2019-12-18 Thread Sergio Lopez
Eric Blake writes: > On 12/9/19 10:06 AM, Kevin Wolf wrote: >> Am 28.11.2019 um 11:41 hat Sergio Lopez geschrieben: >>> bdrv_try_set_aio_context() requires that the old context is held, and >>> the new context is not held. Fix all the occurrences where

[PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements

2019-11-28 Thread Sergio Lopez
bdrv_try_set_aio_context() requires that the old context is held, and the new context is not held. Fix all the occurrences where it's not done this way. Suggested-by: Max Reitz Signed-off-by: Sergio Lopez --- blockdev.c | 72 ++ 1 file

[PATCH v5 2/4] blockdev: unify qmp_drive_backup and drive-backup transaction paths

2019-11-28 Thread Sergio Lopez
perspective, as the job gets paused and immediately resumed before starting the actual work. Also fix tests 141, 185 and 219 to cope with the extra JOB_STATUS_CHANGE lines. Signed-off-by: Sergio Lopez --- blockdev.c | 224 + tests/qemu-iotests/141.out

  1   2   >