[PULL v2 10/12] block: Return depth level during bdrv_is_allocated_above

2020-10-30 Thread Eric Blake
When checking for allocation across a chain, it's already easy to count the depth within the chain at which the allocation is found. Instead of throwing that information away, return it to the caller. Existing callers only cared about allocated/non-allocated, but having a depth available will be

Re: [PATCH v8 07/11] hw/block/nvme: Support Zoned Namespace Command Set

2020-10-30 Thread Niklas Cassel
On Fri, Oct 30, 2020 at 11:32:38AM +0900, Dmitry Fomichev wrote: > The emulation code has been changed to advertise NVM Command Set when > "zoned" device property is not set (default) and Zoned Namespace > Command Set otherwise. > > Define values and structures that are needed to support Zoned >

Re: --enable-xen on gitlab CI? (was Re: [PATCH 09/36] qdev: Make qdev_get_prop_ptr() get Object* arg)

2020-10-30 Thread Paolo Bonzini
On 30/10/20 12:35, Eduardo Habkost wrote: > > What is necessary to make sure we have a CONFIG_XEN=y job in > gitlab CI? Maybe just including xen-devel in some of the > container images is enough? Fedora already has it, but build-system-fedora does not include x86_64-softmmu. Paolo

[PATCH v10 5/8] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

2020-10-30 Thread Lukas Straub
Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- io/channel-tls.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/channel-tls.c

[PATCH v10 8/8] tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test

2020-10-30 Thread Lukas Straub
A connecting chardev object has an additional reference by the connecting thread, so if the chardev is still connecting by the end of the test, then the chardev object won't be freed. This in turn means that the yank instance won't be unregistered and when running the next test-case

[PATCH v10 4/8] migration: Add yank feature

2020-10-30 Thread Lukas Straub
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Acked-by: Dr. David Alan Gilbert --- migration/channel.c | 13 + migration/migration.c | 25 + migration/multifd.c | 10

[PATCH v10 6/8] io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown

2020-10-30 Thread Lukas Straub
Migration and yank code assume that qio_channel_shutdown is thread -safe and can be called from qmp oob handler. Document this after checking the code. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- include/io/channel.h | 5 - 1 file changed, 4

[PATCH v10 2/8] block/nbd.c: Add yank feature

2020-10-30 Thread Lukas Straub
Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- block/nbd.c | 154 +++- 1 file changed, 93

[PATCH v10 7/8] MAINTAINERS: Add myself as maintainer for yank feature

2020-10-30 Thread Lukas Straub
I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8c744a9bdf..81288fd219 100644 ---

[PATCH v10 3/8] chardev/char-socket.c: Add yank feature

2020-10-30 Thread Lukas Straub
Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi --- chardev/char-socket.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index

[PATCH v10 1/8] Introduce yank feature

2020-10-30 Thread Lukas Straub
The yank feature allows to recover from hanging qemu by "yanking" at various parts. Other qemu systems can register themselves and multiple yank functions. Then all yank functions for selected instances can be called by the 'yank' out-of-band qmp command. Available instances can be queried by a

[PATCH v10 0/8] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-10-30 Thread Lukas Straub
Hello Everyone, So here is v10. We still need ACKs from NBD and chardev maintainers. Changes: v10: -moved from qapi/misc.json to qapi/yank.json -rename 'blockdev' -> 'block-node' -document difference betwen migration yank instance and migrate_cancel -better document return values of yank

Re: [PULL 0/5] Block layer patches

2020-10-30 Thread Peter Maydell
On Tue, 27 Oct 2020 at 15:15, Kevin Wolf wrote: > > The following changes since commit d55450df995d6223486db11c66491cbf6c131523: > > Merge remote-tracking branch > 'remotes/dgilbert/tags/pull-migration-20201026a' into staging (2020-10-27 > 10:25:42 +) > > are available in the Git

Re: [PATCH v9 1/8] Introduce yank feature

2020-10-30 Thread Lukas Straub
On Fri, 30 Oct 2020 15:02:09 +0100 Markus Armbruster wrote: > Lukas Straub writes: > > > On Thu, 29 Oct 2020 17:36:14 +0100 > > Markus Armbruster wrote: > > > >> Nothing major, looks almost ready to me. > >> > >> Lukas Straub writes: > >> > >> > The yank feature allows to recover from

Re: [PATCH 13/25] block/nvme: Introduce Completion Queue definitions

2020-10-30 Thread Philippe Mathieu-Daudé
On 10/30/20 12:46 PM, Stefan Hajnoczi wrote: > On Thu, Oct 29, 2020 at 10:02:37AM +0100, Philippe Mathieu-Daudé wrote: >> On 10/28/20 7:24 PM, Philippe Mathieu-Daudé wrote: >>> On 10/28/20 4:16 PM, Stefan Hajnoczi wrote: On Tue, Oct 27, 2020 at 02:55:35PM +0100, Philippe Mathieu-Daudé

Re: [PATCH-for-6.0 v2 25/25] block/nvme: Simplify Completion Queue Command Identifier field use

2020-10-30 Thread Philippe Mathieu-Daudé
On 10/30/20 3:00 PM, Stefan Hajnoczi wrote: > On Thu, Oct 29, 2020 at 10:33:06AM +0100, Philippe Mathieu-Daudé wrote: >> The "Completion Queue Entry: DW 2" describes it as: >> >> This identifier is assigned by host software when >> the command is submitted to the Submission >> >> As the is

Re: [PATCH-for-5.2 v2 12/25] block/nvme: Introduce Completion Queue definitions

2020-10-30 Thread Philippe Mathieu-Daudé
On 10/30/20 3:03 PM, Stefan Hajnoczi wrote: > On Thu, Oct 29, 2020 at 10:32:53AM +0100, Philippe Mathieu-Daudé wrote: >> Rename Submission Queue flags with 'Sq' to differentiate >> submission queue flags from command queue flags, and introduce >> Completion Queue flag definitions. >> >>

Re: [PULL 0/3] Ide patches

2020-10-30 Thread Peter Maydell
On Tue, 27 Oct 2020 at 14:43, John Snow wrote: > > The following changes since commit a95e0396c805735c491a049b01de6f5a713fb91b: > > Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' > into staging (2020-10-26 15:49:11 +) > > are available in the Git repository at: > >

Re: [PATCH-for-5.2 v2 16/25] block/nvme: Simplify nvme_cmd_sync()

2020-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2020 at 10:32:57AM +0100, Philippe Mathieu-Daudé wrote: > As all commands use the ADMIN queue, it is pointless to pass > it as argument each time. Remove the argument, and rename the > function as nvme_admin_cmd_sync() to make this new behavior > clearer. > > Reviewed-by: Eric

[PULL 13/15] vhost-blk: set features before setting inflight feature

2020-10-30 Thread Michael S. Tsirkin
From: Jin Yu Virtqueue has split and packed, so before setting inflight, you need to inform the back-end virtqueue format. Signed-off-by: Jin Yu Message-Id: <20200910134851.7817-1-jin...@intel.com> Acked-by: Raphael Norwitz Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin

Re: [PATCH-for-5.2 v2 12/25] block/nvme: Introduce Completion Queue definitions

2020-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2020 at 10:32:53AM +0100, Philippe Mathieu-Daudé wrote: > Rename Submission Queue flags with 'Sq' to differentiate > submission queue flags from command queue flags, and introduce > Completion Queue flag definitions. > > Reviewed-by: Eric Auger > Tested-by: Eric Auger >

Re: [PATCH-for-5.2 v2 10/25] block/nvme: Make nvme_identify() return boolean indicating error

2020-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2020 at 10:32:51AM +0100, Philippe Mathieu-Daudé wrote: > Just for consistency, following the example documented since > commit e3fe3988d7 ("error: Document Error API usage rules"), > return a boolean value indicating an error is set or not. > Directly pass errp as the local_err is

Re: [PATCH v9 1/8] Introduce yank feature

2020-10-30 Thread Markus Armbruster
Lukas Straub writes: > On Thu, 29 Oct 2020 17:36:14 +0100 > Markus Armbruster wrote: > >> Nothing major, looks almost ready to me. >> >> Lukas Straub writes: >> >> > The yank feature allows to recover from hanging qemu by "yanking" >> > at various parts. Other qemu systems can register

Re: [PATCH-for-6.0 v2 25/25] block/nvme: Simplify Completion Queue Command Identifier field use

2020-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2020 at 10:33:06AM +0100, Philippe Mathieu-Daudé wrote: > The "Completion Queue Entry: DW 2" describes it as: > > This identifier is assigned by host software when > the command is submitted to the Submission > > As the is just an opaque cookie, it is pointless to byte-swap

Re: [PATCH-for-5.2 v2 24/25] block/nvme: Fix nvme_submit_command() on big-endian host

2020-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2020 at 10:33:05AM +0100, Philippe Mathieu-Daudé wrote: > The Completion Queue Command Identifier is a 16-bit value, > so nvme_submit_command() is unlikely to work on big-endian > hosts, as the relevant bits are truncated. > Fix by using the correct byte-swap function. > > Fixes:

Re: [PATCH v3 0/9] block-backend: Introduce I/O hang

2020-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2020 at 05:42:42PM +0800, cenjiahui wrote: > > On 2020/10/27 0:53, Stefan Hajnoczi wrote: > > On Thu, Oct 22, 2020 at 09:02:54PM +0800, Jiahui Cen wrote: > >> A VM in the cloud environment may use a virutal disk as the backend > >> storage, > >> and there are usually filesystems

[PULL 13/15] vhost-blk: set features before setting inflight feature

2020-10-30 Thread Michael S. Tsirkin
From: Jin Yu Virtqueue has split and packed, so before setting inflight, you need to inform the back-end virtqueue format. Signed-off-by: Jin Yu Message-Id: <20200910134851.7817-1-jin...@intel.com> Acked-by: Raphael Norwitz Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin

Re: [PATCH 00/12] block/export: vhost-user-blk server cleanups and tests

2020-10-30 Thread Michael S. Tsirkin
On Tue, Oct 27, 2020 at 05:35:16PM +, Stefan Hajnoczi wrote: > This patch series solves some issues with the new vhost-user-blk-server and > adds the qtest test case. The test case was not included in the pull request > that introduced the vhost-user-blk server because of reliability issues

Re: [PATCH 13/25] block/nvme: Introduce Completion Queue definitions

2020-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2020 at 10:02:37AM +0100, Philippe Mathieu-Daudé wrote: > On 10/28/20 7:24 PM, Philippe Mathieu-Daudé wrote: > > On 10/28/20 4:16 PM, Stefan Hajnoczi wrote: > >> On Tue, Oct 27, 2020 at 02:55:35PM +0100, Philippe Mathieu-Daudé wrote: > >>> Rename Submission Queue flags with 'Sq'

--enable-xen on gitlab CI? (was Re: [PATCH 09/36] qdev: Make qdev_get_prop_ptr() get Object* arg)

2020-10-30 Thread Eduardo Habkost
On Fri, Oct 30, 2020 at 11:29:25AM +0400, Marc-André Lureau wrote: > On Fri, Oct 30, 2020 at 2:07 AM Eduardo Habkost wrote: > > > Make the code more generic and not specific to TYPE_DEVICE. > > > > Signed-off-by: Eduardo Habkost > > > > Nice cleanup!, but fails to build atm > >

Re: [PATCH v9 1/8] Introduce yank feature

2020-10-30 Thread Lukas Straub
On Thu, 29 Oct 2020 17:36:14 +0100 Markus Armbruster wrote: > Nothing major, looks almost ready to me. > > Lukas Straub writes: > > > The yank feature allows to recover from hanging qemu by "yanking" > > at various parts. Other qemu systems can register themselves and > > multiple yank

Re: [PATCH 14/36] qdev: Move dev->realized check to qdev_property_set()

2020-10-30 Thread Marc-André Lureau
On Fri, Oct 30, 2020 at 2:10 AM Eduardo Habkost wrote: > Every single qdev property setter function manually checks > dev->realized. We can just check dev->realized inside > qdev_property_set() instead. > > The check is being added as a separate function > (qdev_prop_allow_set()) because it

Re: [PATCH 09/36] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-10-30 Thread Marc-André Lureau
On Fri, Oct 30, 2020 at 11:29 AM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > > > On Fri, Oct 30, 2020 at 2:07 AM Eduardo Habkost > wrote: > >> Make the code more generic and not specific to TYPE_DEVICE. >> >> Signed-off-by: Eduardo Habkost >> > > Nice cleanup!, but fails to build

Re: [PATCH 09/36] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-10-30 Thread Marc-André Lureau
On Fri, Oct 30, 2020 at 2:07 AM Eduardo Habkost wrote: > Make the code more generic and not specific to TYPE_DEVICE. > > Signed-off-by: Eduardo Habkost > Nice cleanup!, but fails to build atm ../hw/block/xen-block.c:403:9: error: ‘dev’ undeclared (first use in this function); did you mean

Re: [PATCH v8 07/11] hw/block/nvme: Support Zoned Namespace Command Set

2020-10-30 Thread Philippe Mathieu-Daudé
Hi Dmitry, On 10/30/20 3:32 AM, Dmitry Fomichev wrote: > The emulation code has been changed to advertise NVM Command Set when > "zoned" device property is not set (default) and Zoned Namespace > Command Set otherwise. > > Define values and structures that are needed to support Zoned > Namespace

Re: [PATCH v7 0/3] hw/block/nvme: dulbe and dsm support

2020-10-30 Thread Klaus Jensen
On Oct 27 18:57, Klaus Jensen wrote: > From: Klaus Jensen > > This adds support for the Deallocated or Unwritten Logical Block error > recovery feature as well as the Dataset Management command. > > v7: > - Handle negative return value from bdrv_block_status. > - bdrv_get_info may not be

[PATCH v2] block: Remove unused BlockDeviceMapEntry

2020-10-30 Thread Markus Armbruster
BlockDeviceMapEntry has never been used. It was added in commit facd6e2 "so that it is published through the introspection mechanism." What exactly introspecting types that aren't used for anything could accomplish isn't clear. What "introspection mechanism" to use is also nebulous. To the best