Re: [PATCH v3 11/11] qapi: Restrict code generated for user-mode

2020-09-30 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > A lot of QAPI generated code is never used by user-mode. > > Split out qapi_system_modules and qapi_system_or_tools_modules > from the qapi_all_modules array. We now have 3 groups: > - always used > - use by system-mode or tools (usually by the block layer) > -

Re: [PATCH v3 01/11] qapi: Restrict query-uuid command to block code

2020-09-30 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > In commit f68c01470b we restricted the query-uuid command to > machine code, but it is incorrect, as it is also used by the > tools. Therefore move this command again, but to block.json, > which is shared by machine code and tools. > > Fixes: f68c01470b ("qapi:

Re: [PATCH 4/9] hw/block/nvme: validate command set selected

2020-09-30 Thread Klaus Jensen
On Sep 30 15:04, Keith Busch wrote: > Fail to start the controller if the user requests a command set that the > controller does not support. > > Signed-off-by: Keith Busch Reviewed-by: Klaus Jensen > --- > hw/block/nvme.c | 6 +- > hw/block/trace-events | 1 + >

Re: [PATCH 5/9] hw/block/nvme: support for admin-only command set

2020-09-30 Thread Klaus Jensen
On Sep 30 15:04, Keith Busch wrote: > Signed-off-by: Keith Busch > --- Reviewed-by: Klaus Jensen > hw/block/nvme.c | 1 + > include/block/nvme.h | 3 ++- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/block/nvme.c b/hw/block/nvme.c > index 6c582e6874..ec7363ea40

Re: [PATCH 3/9] hw/block/nvme: support per-namespace smart log

2020-09-30 Thread Klaus Jensen
On Sep 30 15:04, Keith Busch wrote: > Let the user specify a specific namespace if they want to get access > stats for a specific namespace. > I don't think this makes sense for v1.3+. NVM Express v1.3d, Section 5.14.1.2: "There is no namespace specific information defined in the SMART / Health

Re: [PATCH 2/9] hw/block/nvme: fix log page offset check

2020-09-30 Thread Klaus Jensen
On Sep 30 15:04, Keith Busch wrote: > Return error if the requested offset starts after the size of the log > being returned. Also, move the check for earlier in the function so > we're not doing unnecessary calculations. > > Signed-off-by: Keith Busch Reviewed-by: Klaus Jensen > --- >

Re: [PATCH 1/9] hw/block/nvme: remove pointless rw indirection

2020-09-30 Thread Klaus Jensen
On Sep 30 15:04, Keith Busch wrote: > The code switches on the opcode to invoke a function specific to that > opcode. There's no point in consolidating back to a common function that > just switches on that same opcode without any actual common code. > Restore the opcode specific behavior without

RE: [PATCH 5/9] hw/block/nvme: support for admin-only command set

2020-09-30 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Wednesday, September 30, 2020 6:04 PM > To: qemu-block@nongnu.org; qemu-de...@nongnu.org; Klaus Jensen > > Cc: Niklas Cassel ; Dmitry Fomichev > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Keith Busch > Subject: [PATCH 5/9] hw/block/nvme:

RE: [PATCH 8/9] hw/block/nvme: add trace event for requests with non-zero status code

2020-09-30 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Wednesday, September 30, 2020 6:04 PM > To: qemu-block@nongnu.org; qemu-de...@nongnu.org; Klaus Jensen > > Cc: Niklas Cassel ; Dmitry Fomichev > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Keith Busch > Subject: [PATCH 8/9] hw/block/nvme:

RE: [PATCH 2/9] hw/block/nvme: fix log page offset check

2020-09-30 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Wednesday, September 30, 2020 6:04 PM > To: qemu-block@nongnu.org; qemu-de...@nongnu.org; Klaus Jensen > > Cc: Niklas Cassel ; Dmitry Fomichev > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Keith Busch > Subject: [PATCH 2/9] hw/block/nvme:

RE: [PATCH 6/9] hw/block/nvme: reject io commands if only admin command set selected

2020-09-30 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Wednesday, September 30, 2020 6:04 PM > To: qemu-block@nongnu.org; qemu-de...@nongnu.org; Klaus Jensen > > Cc: Niklas Cassel ; Dmitry Fomichev > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Keith Busch > Subject: [PATCH 6/9] hw/block/nvme:

[PATCH 9/9] hw/block/nvme: report actual LBA data shift in LBAF

2020-09-30 Thread Keith Busch
From: Dmitry Fomichev Calculate the data shift value to report based on the set value of logical_block_size device property. In the process, use a local variable to calculate the LBA format index instead of the hardcoded value 0. This makes the code more readable and it will make it easier to

[PATCH 6/9] hw/block/nvme: reject io commands if only admin command set selected

2020-09-30 Thread Keith Busch
From: Klaus Jensen If the host sets CC.CSS to 111b, all commands submitted to I/O queues should be completed with status Invalid Command Opcode. Note that this is technically a v1.4 feature, but it does not hurt to implement before we finally bump the reported version implemented.

[PATCH 7/9] hw/block/nvme: add nsid to get/setfeat trace events

2020-09-30 Thread Keith Busch
From: Klaus Jensen Include the namespace id in the pci_nvme_{get,set}feat trace events. Signed-off-by: Klaus Jensen Signed-off-by: Keith Busch --- hw/block/nvme.c | 4 ++-- hw/block/trace-events | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme.c

[PATCH 8/9] hw/block/nvme: add trace event for requests with non-zero status code

2020-09-30 Thread Keith Busch
From: Klaus Jensen If a command results in a non-zero status code, trace it. Signed-off-by: Klaus Jensen Signed-off-by: Keith Busch --- hw/block/nvme.c | 6 ++ hw/block/trace-events | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index

[PATCH 2/9] hw/block/nvme: fix log page offset check

2020-09-30 Thread Keith Busch
Return error if the requested offset starts after the size of the log being returned. Also, move the check for earlier in the function so we're not doing unnecessary calculations. Signed-off-by: Keith Busch --- hw/block/nvme.c | 22 ++ 1 file changed, 10 insertions(+), 12

[PATCH 3/9] hw/block/nvme: support per-namespace smart log

2020-09-30 Thread Keith Busch
Let the user specify a specific namespace if they want to get access stats for a specific namespace. Signed-off-by: Keith Busch --- hw/block/nvme.c | 66 +++- include/block/nvme.h | 1 + 2 files changed, 41 insertions(+), 26 deletions(-) diff --git

[PATCH 4/9] hw/block/nvme: validate command set selected

2020-09-30 Thread Keith Busch
Fail to start the controller if the user requests a command set that the controller does not support. Signed-off-by: Keith Busch --- hw/block/nvme.c | 6 +- hw/block/trace-events | 1 + include/block/nvme.h | 4 3 files changed, 10 insertions(+), 1 deletion(-) diff --git

[PATCH 0/9] nvme qemu cleanups and fixes

2020-09-30 Thread Keith Busch
After going through the zns enabling, I notice the controller enabling is not correct. Then I just continued maked more stuff. The series, I think, contains some of the less controversial patches from the two conflicting zns series, preceeded by some cleanups and fixes from me. If this is all

[PATCH 5/9] hw/block/nvme: support for admin-only command set

2020-09-30 Thread Keith Busch
Signed-off-by: Keith Busch --- hw/block/nvme.c | 1 + include/block/nvme.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 6c582e6874..ec7363ea40 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -2755,6 +2755,7 @@ static

[PATCH 1/9] hw/block/nvme: remove pointless rw indirection

2020-09-30 Thread Keith Busch
The code switches on the opcode to invoke a function specific to that opcode. There's no point in consolidating back to a common function that just switches on that same opcode without any actual common code. Restore the opcode specific behavior without going back through another level of

Re: [PATCH v3 00/11] user-mode: Prune build dependencies (part 3)

2020-09-30 Thread Paolo Bonzini
Il mer 30 set 2020, 20:57 Alex Bennée ha scritto: > > 1-8 is fine, but I think 9-11 is too much complication (especially not > > really future-proof) for the benefit. > > Isn't qdev considered an internal API for our object and device lifetime > handling (which should be shared) versus QAPI

Re: [PATCH v3 00/11] user-mode: Prune build dependencies (part 3)

2020-09-30 Thread Alex Bennée
Paolo Bonzini writes: > On 30/09/20 19:15, Eduardo Habkost wrote: >> On Wed, Sep 30, 2020 at 06:49:38PM +0200, Philippe Mathieu-Daudé wrote: >>> This is the third part of a series reducing user-mode >>> dependencies. By stripping out unused code, the build >>> and testing time is reduced (as

Re: [PATCH v5 09/14] hw/block/nvme: Support Zoned Namespace Command Set

2020-09-30 Thread Klaus Jensen
On Sep 30 14:50, Niklas Cassel wrote: > On Mon, Sep 28, 2020 at 11:35:23AM +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. > > > > Handlers for

Re: [PATCH 0/4] assorted gcc 10/fedora32 compile warning fixes

2020-09-30 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200930155859.303148-1-borntrae...@de.ibm.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20200930155859.303148-1-borntrae...@de.ibm.com Subject: [PATCH 0/4] assorted gcc

Re: [PATCH v3 00/11] user-mode: Prune build dependencies (part 3)

2020-09-30 Thread Eduardo Habkost
On Wed, Sep 30, 2020 at 07:24:24PM +0200, Paolo Bonzini wrote: > On 30/09/20 19:15, Eduardo Habkost wrote: > > On Wed, Sep 30, 2020 at 06:49:38PM +0200, Philippe Mathieu-Daudé wrote: > >> This is the third part of a series reducing user-mode > >> dependencies. By stripping out unused code, the

Re: [PATCH v3 00/11] user-mode: Prune build dependencies (part 3)

2020-09-30 Thread Paolo Bonzini
On 30/09/20 19:15, Eduardo Habkost wrote: > On Wed, Sep 30, 2020 at 06:49:38PM +0200, Philippe Mathieu-Daudé wrote: >> This is the third part of a series reducing user-mode >> dependencies. By stripping out unused code, the build >> and testing time is reduced (as is space used by objects). > I'm

Re: [PATCH 2/4] nbd: silence maybe-uninitialized warnings

2020-09-30 Thread Eric Blake
On 9/30/20 10:58 AM, Christian Borntraeger wrote: > gcc 10 from Fedora 32 gives me: > > Compiling C object libblock.fa.p/nbd_server.c.o > ../nbd/server.c: In function ‘nbd_co_client_start’: > ../nbd/server.c:625:14: error: ‘namelen’ may be used uninitialized in this > function

Re: [PATCH v7 06/13] qmp: Call monitor_set_cur() only in qmp_dispatch()

2020-09-30 Thread Dr. David Alan Gilbert
* Kevin Wolf (kw...@redhat.com) wrote: > Am 30.09.2020 um 15:14 hat Markus Armbruster geschrieben: > > Kevin Wolf writes: > > > > > Am 30.09.2020 um 11:26 hat Markus Armbruster geschrieben: > > >> Kevin Wolf writes: > > >> > > >> > Am 28.09.2020 um 13:42 hat Markus Armbruster geschrieben: > >

Re: [PATCH v3 10/11] target/i386: Restrict X86CPUFeatureWord to X86 targets

2020-09-30 Thread Eduardo Habkost
On Wed, Sep 30, 2020 at 06:49:48PM +0200, Philippe Mathieu-Daudé wrote: > Only qemu-system-FOO and qemu-storage-daemon provide QMP > monitors, therefore such declarations and definitions are > irrelevant for user-mode emulation. > > Restricting the x86-specific commands to machine-target.json >

Re: [PATCH v3 00/11] user-mode: Prune build dependencies (part 3)

2020-09-30 Thread Eduardo Habkost
On Wed, Sep 30, 2020 at 06:49:38PM +0200, Philippe Mathieu-Daudé wrote: > This is the third part of a series reducing user-mode > dependencies. By stripping out unused code, the build > and testing time is reduced (as is space used by objects). I'm queueing patches 2-9 on machine-next. Thanks!

[PATCH v3 07/11] hw/core/qdev-properties: Export some integer-related functions

2020-09-30 Thread Philippe Mathieu-Daudé
We are going to split this file and reuse these static functions. Declare them in the local "qdev-prop-internal.h" header. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v3: Also export qdev_propinfo_get_size32 introduced in commits 914e74cda9 ("qdev-properties: add

[PATCH v3 11/11] qapi: Restrict code generated for user-mode

2020-09-30 Thread Philippe Mathieu-Daudé
A lot of QAPI generated code is never used by user-mode. Split out qapi_system_modules and qapi_system_or_tools_modules from the qapi_all_modules array. We now have 3 groups: - always used - use by system-mode or tools (usually by the block layer) - only used by system-mode Signed-off-by:

[PATCH v3 05/11] hw/core/qdev-properties: Export enum-related functions

2020-09-30 Thread Philippe Mathieu-Daudé
We are going to split this file and reuse these static functions. Add the local "qdev-prop-internal.h" header declaring them. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-prop-internal.h | 19 hw/core/qdev-properties.c| 58

[PATCH v3 09/11] hw/core: Add qdev stub for user-mode

2020-09-30 Thread Philippe Mathieu-Daudé
While user-mode does not use peripherals (devices), it uses a CPU which is a device. In the next commit we will reduce the QAPI generated code for user-mode. Since qdev.c calls qapi_event_send_device_deleted() in device_finalize, let's add a stub for it. Suggested-by: Paolo Bonzini Reviewed-by:

[PATCH v3 10/11] target/i386: Restrict X86CPUFeatureWord to X86 targets

2020-09-30 Thread Philippe Mathieu-Daudé
Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Restricting the x86-specific commands to machine-target.json pulls less QAPI-generated code into user-mode. Add a stub to satisfy linking in

[PATCH v3 08/11] hw/core/qdev-properties: Extract system-mode specific properties

2020-09-30 Thread Philippe Mathieu-Daudé
Move properties specific to machines into a separate file. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v3: Also move Reserved Region introduced in commit f78069253c ("qdev: Introduce DEFINE_PROP_RESERVED_REGION"). --- hw/core/qdev-properties-system.c | 687

[PATCH v3 01/11] qapi: Restrict query-uuid command to block code

2020-09-30 Thread Philippe Mathieu-Daudé
In commit f68c01470b we restricted the query-uuid command to machine code, but it is incorrect, as it is also used by the tools. Therefore move this command again, but to block.json, which is shared by machine code and tools. Fixes: f68c01470b ("qapi: Restrict query-uuid command to machine

[PATCH v3 06/11] hw/core/qdev-properties: Export qdev_prop_enum

2020-09-30 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c| 7 +++ 2 files changed, 8 insertions(+) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 528310bb22..4437450065 100644

[PATCH v3 02/11] hw/core/qdev-properties: Use qemu_strtol() in set_mac() handler

2020-09-30 Thread Philippe Mathieu-Daudé
The MACAddr structure contains an array of uint8_t. Previously if a value was out of the [0..255] range, it was silently casted and no input validation was done. Replace strtol() by qemu_strtol() -- so checkpatch.pl won't complain if we move this code later -- and return EINVAL if the input is

[PATCH v3 04/11] hw/core/qdev-properties: Fix code style

2020-09-30 Thread Philippe Mathieu-Daudé
We will soon move this code, fix its style to avoid checkpatch.pl to complain. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/core/qdev-properties.c

[PATCH v3 00/11] user-mode: Prune build dependencies (part 3)

2020-09-30 Thread Philippe Mathieu-Daudé
This is the third part of a series reducing user-mode dependencies. By stripping out unused code, the build and testing time is reduced (as is space used by objects). Part 3: - Extract code not related to user-mode from hw/core/qdev-properties.c - Reduce user-mode QAPI generated files Since v2:

[PATCH v3 03/11] hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr()

2020-09-30 Thread Philippe Mathieu-Daudé
Replace strtoul() by qemu_strtoul() so checkpatch.pl won't complain if we move this code later. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git

Re: [PATCH 1/4] vmdk: fix maybe uninitialized warnings

2020-09-30 Thread Fam Zheng
On Wed, 2020-09-30 at 17:58 +0200, Christian Borntraeger wrote: > Fedora 32 gcc 10 seems to give false positives: > > Compiling C object libblock.fa.p/block_vmdk.c.o > ../block/vmdk.c: In function ‘vmdk_parse_extents’: > ../block/vmdk.c:587:5: error: ‘extent’ may be used uninitialized in > this

Re: [PATCH 4/4] virtiofsd: avoid false positive compiler warning

2020-09-30 Thread Dr. David Alan Gilbert
* Christian Borntraeger (borntrae...@de.ibm.com) wrote: > make: *** [Makefile:121: config-host.mak] Error 1 > [cborntra@m83lp52 qemu]$ make -C build/ > make: Entering directory '/home/cborntra/REPOS/qemu/build' > Generating qemu-version.h with a meson_exe.py custom command > Compiling C object

Re: [PATCH 3/4] qemu-io-cmds: avoid gcc 10 warning

2020-09-30 Thread Dr. David Alan Gilbert
* Christian Borntraeger (borntrae...@de.ibm.com) wrote: > With gcc 10 on Fedora32 I do get: > > Compiling C object libblock.fa.p/qemu-io-cmds.c.o > In file included from /usr/include/stdio.h:867, > from /home/cborntra/REPOS/qemu/include/qemu/osdep.h:85, > from

Re: [PATCH 3/4] qemu-io-cmds: avoid gcc 10 warning

2020-09-30 Thread Philippe Mathieu-Daudé
On 9/30/20 5:58 PM, Christian Borntraeger wrote: > With gcc 10 on Fedora32 I do get: > > Compiling C object libblock.fa.p/qemu-io-cmds.c.o > In file included from /usr/include/stdio.h:867, > from /home/cborntra/REPOS/qemu/include/qemu/osdep.h:85, > from

[PATCH 2/4] nbd: silence maybe-uninitialized warnings

2020-09-30 Thread Christian Borntraeger
gcc 10 from Fedora 32 gives me: Compiling C object libblock.fa.p/nbd_server.c.o ../nbd/server.c: In function ‘nbd_co_client_start’: ../nbd/server.c:625:14: error: ‘namelen’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 625 | rc =

[PATCH 4/4] virtiofsd: avoid false positive compiler warning

2020-09-30 Thread Christian Borntraeger
make: *** [Makefile:121: config-host.mak] Error 1 [cborntra@m83lp52 qemu]$ make -C build/ make: Entering directory '/home/cborntra/REPOS/qemu/build' Generating qemu-version.h with a meson_exe.py custom command Compiling C object tools/virtiofsd/virtiofsd.p/passthrough_ll.c.o

[PATCH 3/4] qemu-io-cmds: avoid gcc 10 warning

2020-09-30 Thread Christian Borntraeger
With gcc 10 on Fedora32 I do get: Compiling C object libblock.fa.p/qemu-io-cmds.c.o In file included from /usr/include/stdio.h:867, from /home/cborntra/REPOS/qemu/include/qemu/osdep.h:85, from ../qemu-io-cmds.c:11: In function ‘printf’, inlined from

[PATCH 1/4] vmdk: fix maybe uninitialized warnings

2020-09-30 Thread Christian Borntraeger
Fedora 32 gcc 10 seems to give false positives: Compiling C object libblock.fa.p/block_vmdk.c.o ../block/vmdk.c: In function ‘vmdk_parse_extents’: ../block/vmdk.c:587:5: error: ‘extent’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 587 | g_free(extent->l1_table);

[PATCH 0/4] assorted gcc 10/fedora32 compile warning fixes

2020-09-30 Thread Christian Borntraeger
I might be wrong and some of these warnings could be correct, so some review from the subject matter experts would be good. Christian Borntraeger (4): vmdk: fix maybe uninitialized warnings nbd: silence maybe-uninitialized warnings qemu-io-cmds: avoid gcc 10 warning virtiofsd: avoid false

Re: [PULL 13/13] qemu/atomic.h: rename atomic_ to qatomic_

2020-09-30 Thread Paolo Bonzini
On 30/09/20 17:28, Andrew Jones wrote: > pvrdma_ring.h is an update-linux-headers.sh file. When running the > script again we lose the atomic_ to qatomic_ renaming. I've hacked > the script by adding > > -e 's/\batomic_read/qatomic_read/g;s/\batomic_set/qatomic_set/g' > > to the cp_portable()

Re: [PATCH v5 09/14] hw/block/nvme: Support Zoned Namespace Command Set

2020-09-30 Thread Niklas Cassel
On Mon, Sep 28, 2020 at 11:35:23AM +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. > > Handlers for three new NVMe commands introduced in Zoned

Re: [PULL 13/13] qemu/atomic.h: rename atomic_ to qatomic_

2020-09-30 Thread Andrew Jones
On Wed, Sep 23, 2020 at 05:10:31PM +0100, Stefan Hajnoczi wrote: > clang's C11 atomic_fetch_*() functions only take a C11 atomic type > pointer argument. QEMU uses direct types (int, etc) and this causes a > compiler error when a QEMU code calls these functions in a source file > that also

Re: [PATCH v2 1/4] keyval: Parse help options

2020-09-30 Thread Kevin Wolf
Am 30.09.2020 um 15:35 hat Eric Blake geschrieben: > On 9/30/20 7:45 AM, Kevin Wolf wrote: > > This adds a new parameter 'help' to keyval_parse() that enables parsing > > of help options. If NULL is passed, the function behaves the same as > > before. But if a bool pointer is given, it contains

Re: [PATCH v5 03/14] hw/block/nvme: Introduce the Namespace Types definitions

2020-09-30 Thread Keith Busch
On Mon, Sep 28, 2020 at 11:35:17AM +0900, Dmitry Fomichev wrote: > From: Niklas Cassel > > Define the structures and constants required to implement > Namespace Types support. > > Signed-off-by: Niklas Cassel > Signed-off-by: Dmitry Fomichev > --- > hw/block/nvme-ns.h | 2 ++ >

Re: [PATCH 1/4] keyval: Parse help options

2020-09-30 Thread Kevin Wolf
Am 30.09.2020 um 15:42 hat Eric Blake geschrieben: > On 9/30/20 8:04 AM, Kevin Wolf wrote: > > Am 29.09.2020 um 19:46 hat Eric Blake geschrieben: > >> On 9/29/20 12:26 PM, Kevin Wolf wrote: > >>> This adds a new parameter 'help' to keyval_parse() that enables parsing > >>> of help options. If NULL

Re: [PATCH] qemu-storage-daemon: Fix help line for --export

2020-09-30 Thread Kevin Wolf
Am 30.09.2020 um 15:48 hat Eric Blake geschrieben: > On 9/30/20 8:39 AM, Kevin Wolf wrote: > > Commit 5f479a8d renamed the 'device' option of --export into > > 'node-name', but forgot to update the help in qemu-storage-daemon. > > > > Fixes: 5f479a8dc086bfa42c9f94e9ab69962f256e207f > >

Re: [PATCH v5 09/14] hw/block/nvme: Support Zoned Namespace Command Set

2020-09-30 Thread Niklas Cassel
On Mon, Sep 28, 2020 at 11:35:23AM +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. > > Handlers for three new NVMe commands introduced in Zoned

Re: [PATCH 0/2] hw/block/m25p80: Fix Numonyx flash dummy cycle register behavior

2020-09-30 Thread no-reply
Patchew URL: https://patchew.org/QEMU/1601425716-204629-1-git-send-email-koml...@xilinx.com/ Hi, This series seems to have some coding style problems. See output below for more information: N/A. Internal error while reading log file The full log is available at

Re: [PATCH v2 11/13] block/export: convert vhost-user-blk server to block export API

2020-09-30 Thread Markus Armbruster
Stefan Hajnoczi writes: > On Wed, Sep 30, 2020 at 07:28:58AM +0200, Markus Armbruster wrote: >> Stefan Hajnoczi writes: >> >> > Use the new QAPI block exports API instead of defining our own QOM >> > objects. >> > >> > This is a large change because the lifecycle of VuBlockDev needs to >> >

Re: [PATCH v5 06/14] hw/block/nvme: Add support for active/inactive namespaces

2020-09-30 Thread Niklas Cassel
On Mon, Sep 28, 2020 at 11:35:20AM +0900, Dmitry Fomichev wrote: > From: Niklas Cassel > > In NVMe, a namespace is active if it exists and is attached to the > controller. > > CAP.CSS (together with the I/O Command Set data structure) defines what > command sets are supported by the controller.

Re: [PATCH v7 06/13] qmp: Call monitor_set_cur() only in qmp_dispatch()

2020-09-30 Thread Kevin Wolf
Am 30.09.2020 um 15:14 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 30.09.2020 um 11:26 hat Markus Armbruster geschrieben: > >> Kevin Wolf writes: > >> > >> > Am 28.09.2020 um 13:42 hat Markus Armbruster geschrieben: > >> >> Kevin Wolf writes: > >> >> > >> >> > Am

Re: [PATCH v2 4/4] qemu-storage-daemon: Remove QemuOpts from --object parser

2020-09-30 Thread Eric Blake
On 9/30/20 7:45 AM, Kevin Wolf wrote: > The command line parser for --object parses the input twice: Once into > QemuOpts just for detecting help options, and then again into a QDict > using the keyval parser for actually creating the object. > > Now that the keyval parser can also detect help

Re: [PATCH] qemu-storage-daemon: Fix help line for --export

2020-09-30 Thread Eric Blake
On 9/30/20 8:39 AM, Kevin Wolf wrote: > Commit 5f479a8d renamed the 'device' option of --export into > 'node-name', but forgot to update the help in qemu-storage-daemon. > > Fixes: 5f479a8dc086bfa42c9f94e9ab69962f256e207f > Signed-off-by: Kevin Wolf > --- > storage-daemon/qemu-storage-daemon.c

Re: [PATCH v2 3/4] qom: Add user_creatable_print_help_from_qdict()

2020-09-30 Thread Eric Blake
On 9/30/20 7:45 AM, Kevin Wolf wrote: > This adds a function that, given a QDict of non-help options, prints > help for user creatable objects. > > Signed-off-by: Kevin Wolf > --- > include/qom/object_interfaces.h | 9 + > qom/object_interfaces.c | 9 + > 2 files

Re: [PATCH v2 2/4] qom: Factor out helpers from user_creatable_print_help()

2020-09-30 Thread Eric Blake
On 9/30/20 7:45 AM, Kevin Wolf wrote: > This creates separate helper functions for printing a list of user > creatable object types and for printing a list of properties of a given > type. This allows using these parts without having a QemuOpts. > > Signed-off-by: Kevin Wolf > --- >

Re: [PATCH 1/4] keyval: Parse help options

2020-09-30 Thread Eric Blake
On 9/30/20 8:04 AM, Kevin Wolf wrote: > Am 29.09.2020 um 19:46 hat Eric Blake geschrieben: >> On 9/29/20 12:26 PM, Kevin Wolf wrote: >>> This adds a new parameter 'help' to keyval_parse() that enables parsing >>> of help options. If NULL is passed, the function behaves the same as >>> before. But

[PATCH] qemu-storage-daemon: Fix help line for --export

2020-09-30 Thread Kevin Wolf
Commit 5f479a8d renamed the 'device' option of --export into 'node-name', but forgot to update the help in qemu-storage-daemon. Fixes: 5f479a8dc086bfa42c9f94e9ab69962f256e207f Signed-off-by: Kevin Wolf --- storage-daemon/qemu-storage-daemon.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] block/nvme: Add driver statistics for access alignment and hw errors

2020-09-30 Thread Philippe Mathieu-Daudé
Keep statistics of some hardware errors, and number of aligned/unaligned I/O accesses. QMP example booting a full RHEL 8.3 aarch64 guest: { "execute": "query-blockstats" } { "return": [ { "device": "", "node-name": "drive0", "stats": {

Re: [PATCH v2 1/4] keyval: Parse help options

2020-09-30 Thread Eric Blake
On 9/30/20 7:45 AM, Kevin Wolf wrote: > This adds a new parameter 'help' to keyval_parse() that enables parsing > of help options. If NULL is passed, the function behaves the same as > before. But if a bool pointer is given, it contains the information > whether an option "help" without value was

Re: [PATCH] job: delete job_{lock, unlock} functions and replace them with lock guard

2020-09-30 Thread Paolo Bonzini
On 30/09/20 14:15, Elena Afanasova wrote: >>> +WITH_QEMU_LOCK_GUARD(_mutex) { >>> +if (ns != -1) { >>> +timer_mod(>sleep_timer, ns); >>> +} >>> +job->busy = false; >>> +job_event_idle(job); >> Is this new macro safe to use in a coroutine context? >

Re: [PATCH v7 06/13] qmp: Call monitor_set_cur() only in qmp_dispatch()

2020-09-30 Thread Markus Armbruster
Kevin Wolf writes: > Am 30.09.2020 um 11:26 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Am 28.09.2020 um 13:42 hat Markus Armbruster geschrieben: >> >> Kevin Wolf writes: >> >> >> >> > Am 14.09.2020 um 17:10 hat Markus Armbruster geschrieben: >> >> >> Kevin Wolf writes:

Re: [PATCH 1/4] keyval: Parse help options

2020-09-30 Thread Kevin Wolf
Am 29.09.2020 um 19:46 hat Eric Blake geschrieben: > On 9/29/20 12:26 PM, Kevin Wolf wrote: > > This adds a new parameter 'help' to keyval_parse() that enables parsing > > of help options. If NULL is passed, the function behaves the same as > > before. But if a bool pointer is given, it contains

[PATCH v2 1/4] keyval: Parse help options

2020-09-30 Thread Kevin Wolf
This adds a new parameter 'help' to keyval_parse() that enables parsing of help options. If NULL is passed, the function behaves the same as before. But if a bool pointer is given, it contains the information whether an option "help" without value was given (which would otherwise either result in

[PATCH v2 4/4] qemu-storage-daemon: Remove QemuOpts from --object parser

2020-09-30 Thread Kevin Wolf
The command line parser for --object parses the input twice: Once into QemuOpts just for detecting help options, and then again into a QDict using the keyval parser for actually creating the object. Now that the keyval parser can also detect help options, we can simplify this and remove the

Re: [PATCH v5 05/14] hw/block/nvme: Add support for Namespace Types

2020-09-30 Thread Niklas Cassel
On Mon, Sep 28, 2020 at 11:35:19AM +0900, Dmitry Fomichev wrote: > From: Niklas Cassel > > Namespace Types introduce a new command set, "I/O Command Sets", > that allows the host to retrieve the command sets associated with > a namespace. Introduce support for the command set and enable >

[PATCH v2 3/4] qom: Add user_creatable_print_help_from_qdict()

2020-09-30 Thread Kevin Wolf
This adds a function that, given a QDict of non-help options, prints help for user creatable objects. Signed-off-by: Kevin Wolf --- include/qom/object_interfaces.h | 9 + qom/object_interfaces.c | 9 + 2 files changed, 18 insertions(+) diff --git

[PATCH v2 2/4] qom: Factor out helpers from user_creatable_print_help()

2020-09-30 Thread Kevin Wolf
This creates separate helper functions for printing a list of user creatable object types and for printing a list of properties of a given type. This allows using these parts without having a QemuOpts. Signed-off-by: Kevin Wolf --- qom/object_interfaces.c | 90

[PATCH v2 0/4] qemu-storage-daemon: Remove QemuOpts from --object parser

2020-09-30 Thread Kevin Wolf
This replaces the QemuOpts-based help code for --object in the storage daemon with code based on the keyval parser. v2: - Fixed double comma by reusing the existing key and value parsers [Eric] - More tests to cover the additional cases Kevin Wolf (4): keyval: Parse help options qom: Factor

Re: [PATCH] job: delete job_{lock,unlock} functions and replace them with lock guard

2020-09-30 Thread Elena Afanasova
On Tue, 2020-09-29 at 14:04 -0400, John Snow wrote: > On 9/29/20 9:42 AM, Elena Afanasova wrote: > > Signed-off-by: Elena Afanasova > > Hi, can I have a commit message here, please? > > > --- > > job.c | 46 +- > > 1 file changed, 17 insertions(+),

[PATCH v2 4/5] nbd: Add new qemu:allocation-depth metacontext

2020-09-30 Thread Eric Blake
'qemu-img map' provides a way to determine which extents of an image come from the top layer vs. inherited from a backing chain. This is useful information worth exposing over NBD. There is a proposal to add a QMP command block-dirty-bitmap-populate which can create a dirty bitmap that reflects

[PATCH v2 5/5] nbd: Add 'qemu-nbd -A' to expose allocation depth

2020-09-30 Thread Eric Blake
Allow the server to expose an additional metacontext to be requested by savvy clients. qemu-nbd adds a new option -A to expose the qemu:allocation-depth metacontext through NBD_CMD_BLOCK_STATUS; this can also be set via QMP when using block-export-add. qemu as client can be hacked into viewing

[PATCH v2 3/5] nbd: Simplify meta-context parsing

2020-09-30 Thread Eric Blake
We had a premature optimization of trying to read as little from the wire as possible while handling NBD_OPT_SET_META_CONTEXT in phases. But in reality, we HAVE to read the entire string from the client before we can get to the next command, and it is easier to just read it all at once than it is

[PATCH v2 1/5] qemu-nbd: Honor SIGINT and SIGHUP

2020-09-30 Thread Eric Blake
Honoring just SIGTERM on Linux is too weak; we also want to handle other common signals, and do so even on BSD. Why? Because at least 'qemu-nbd -B bitmap' needs a chance to clean up the in-use bit on bitmaps when the server is shut down via a signal. See also: http://bugzilla.redhat.com/1883608

[PATCH v2 2/5] nbd/server: Reject embedded NUL in NBD strings

2020-09-30 Thread Eric Blake
The NBD spec is clear that any string sent from the client must not contain embedded NUL characters. If the client passes "a\0", we should reject that option request rather than act on "a". Testing this is not possible with a compliant client, but I was able to use gdb to coerce libnbd into

[PATCH v2 0/5] Exposing backing-chain allocation over NBD

2020-09-30 Thread Eric Blake
v1 was here: https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg09623.htm l Based-on: <20200924152717.287415-1-kw...@redhat.com> (block/export: Add infrastructure and QAPI for block exports) Also available at: https://repo.or.cz/qemu/ericb.git/shortlog/refs/tags/nbd-alloc-depth-v2 Since

Re: [PATCH v7 06/13] qmp: Call monitor_set_cur() only in qmp_dispatch()

2020-09-30 Thread Kevin Wolf
Am 30.09.2020 um 11:26 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 28.09.2020 um 13:42 hat Markus Armbruster geschrieben: > >> Kevin Wolf writes: > >> > >> > Am 14.09.2020 um 17:10 hat Markus Armbruster geschrieben: > >> >> Kevin Wolf writes: > >> >> > >> >> > The

[PULL 07/17] block: return error-code from bdrv_invalidate_cache

2020-09-30 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy This is the only coroutine wrapper from block.c and block/io.c which doesn't return a value, so let's convert it to the common behavior, to simplify moving to generated coroutine wrappers in a further commit. Also, bdrv_invalidate_cache is a void function,

[PULL 14/17] include/block/block.h: drop non-ascii quotation mark

2020-09-30 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy This is the only non-ascii character in the file and it doesn't really needed here. Let's use normal "'" symbol for consistency with the rest 11 occurrences of "'" in the file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake

[PULL 10/17] scripts: add block-coroutine-wrapper.py

2020-09-30 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy We have a very frequent pattern of creating a coroutine from a function with several arguments: - create a structure to pack parameters - create _entry function to call original function taking parameters from struct - do different magic to handle

[PULL 09/17] block: declare some coroutine functions in block/coroutines.h

2020-09-30 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy We are going to keep coroutine-wrappers code (structure-packing parameters, BDRV_POLL wrapper functions) in separate auto-generated files. So, we'll need a header with declaration of original _co_ functions, for those which are static now. As well, we'll need

[PULL 17/17] util/vfio-helpers: Rework the IOVA allocator to avoid IOVA reserved regions

2020-09-30 Thread Stefan Hajnoczi
From: Eric Auger Introduce the qemu_vfio_find_fixed/temp_iova helpers which respectively allocate IOVAs from the bottom/top parts of the usable IOVA range, without picking within host IOVA reserved windows. The allocation remains basic: if the size is too big for the remaining of the current

[PULL 11/17] block: generate coroutine-wrapper code

2020-09-30 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Use code generation implemented in previous commit to generated coroutine wrappers in block.c and block/io.c Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-Id:

[PULL 13/17] block/io: refactor save/load vmstate

2020-09-30 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Like for read/write in a previous commit, drop extra indirection layer, generate directly bdrv_readv_vmstate() and bdrv_writev_vmstate(). Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Stefan

[PULL 05/17] block/nvme: Use register definitions from 'block/nvme.h'

2020-09-30 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Use the NVMe register definitions from "block/nvme.h" which ease a bit reviewing the code while matching the datasheet. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Hajnoczi Message-Id: <20200922083821.578519-6-phi...@redhat.com> --- block/nvme.c |

[PULL 16/17] util/vfio-helpers: Collect IOVA reserved regions

2020-09-30 Thread Stefan Hajnoczi
From: Eric Auger The IOVA allocator currently ignores host reserved regions. As a result some chosen IOVAs may collide with some of them, resulting in VFIO MAP_DMA errors later on. This happens on ARM where the MSI reserved window quickly is encountered: [0x800, 0x810]. since 5.4 kernel,

[PULL 08/17] block/io: refactor coroutine wrappers

2020-09-30 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Most of our coroutine wrappers already follow this convention: We have 'coroutine_fn bdrv_co_()' as the core function, and a wrapper 'bdrv_()' which does parameter packing and calls bdrv_run_co(). The only outsiders are the bdrv_prwv_co and

[PULL 15/17] docs: add 'io_uring' option to 'aio' param in qemu-options.hx

2020-09-30 Thread Stefan Hajnoczi
From: Stefano Garzarella When we added io_uring AIO engine, we forgot to update qemu-options.hx, so qemu(1) man page and qemu help were outdated. Signed-off-by: Stefano Garzarella Signed-off-by: Stefan Hajnoczi Reviewed-by: Julia Suvorova Reviewed-by: Pankaj Gupta Message-Id:

  1   2   >