Re: [PATCH V2 6/7] hw/block/nvme: support namespace attachment command

2021-02-26 Thread Minwoo Im
On 21-02-27 02:59:35, Keith Busch wrote: > On Thu, Feb 11, 2021 at 01:09:36AM +0900, Minwoo Im wrote: > > @@ -183,6 +183,7 @@ static const uint32_t nvme_cse_acs[256] = { > > [NVME_ADM_CMD_SET_FEATURES] = NVME_CMD_EFF_CSUPP, > > [NVME_ADM_CMD_GET_FEATURES] = NVME_CMD_EFF_CSUPP, > >

Re: [PATCH v2 31/31] qom: Drop QemuOpts based interfaces

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > user_creatable_add_opts() has only a single user left, which is a test > case. Rewrite the test to use user_creatable_add_type() instead (which > is the remaining function that doesn't require a QAPI schema) and drop > the QemuOpts related functions. > > Sig

Re: [PATCH v2 30/31] vl: QAPIfy -object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches the system emulator from a QemuOpts-based parser for > -object to user_creatable_parse_str() which uses a keyval parser and > enforces the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > This adopt

Re: [PATCH v2 29/31] qom: Add user_creatable_parse_str()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > The system emulator has a more complicated way of handling command line > options in that it reorders options before it processes them. This means > that parsing object options and creating the object happen at two > different points. Split the parsing part i

Re: [PATCH v2 28/31] hmp: QAPIfy object_add

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches the HMP command object_add from a QemuOpts-based parser to > user_creatable_add_from_str() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties and help > accessible. In ord

Re: [PATCH v2 27/31] qom: Add user_creatable_add_from_str()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This is a version of user_creatable_process_cmdline() with an Error > parameter that never calls exit() and is therefore usable in HMP. > > Signed-off-by: Kevin Wolf > --- > include/qom/object_interfaces.h | 16 > qom/object_interfaces.c

Re: [PATCH v2 26/31] qemu-nbd: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches qemu-nbd from a QemuOpts-based parser for --object to > user_creatable_process_cmdline() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > Signed-off-by:

Re: [PATCH v2 25/31] qemu-img: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/26/21 3:56 PM, Eric Blake wrote: > On 2/24/21 7:52 AM, Kevin Wolf wrote: >> This switches qemu-img from a QemuOpts-based parser for --object to >> user_creatable_process_cmdline() which uses a keyval parser and enforces >> the QAPI schema. >> >> Apart from being a cleanup, this makes non-scala

Re: [PATCH v2 25/31] qemu-img: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches qemu-img from a QemuOpts-based parser for --object to > user_creatable_process_cmdline() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > Signed-off-by:

Re: [PATCH v2 24/31] qemu-io: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches qemu-io from a QemuOpts-based parser for --object to > user_creatable_process_cmdline() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > Signed-off-by:

Re: [PATCH v2 23/31] qom: Factor out user_creatable_process_cmdline()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > The implementation for --object can be shared between > qemu-storage-daemon and other binaries, so move it into a function in > qom/object_interfaces.c that is accessible from everywhere. > > This also requires moving the implementation of qmp_object_add() i

Re: [PATCH v2 22/31] qom: Remove user_creatable_add_dict()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This function is now unused and can be removed. > > Signed-off-by: Kevin Wolf > --- > include/qom/object_interfaces.h | 18 -- > qom/object_interfaces.c | 32 > 2 files changed, 50 deletions(-) > R

Re: [PATCH v2 21/31] qemu-storage-daemon: Implement --object with qmp_object_add()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This QAPIfies --object and ensures that QMP and the command line option > behave the same. > > Signed-off-by: Kevin Wolf > --- > storage-daemon/qemu-storage-daemon.c | 21 ++--- > 1 file changed, 10 insertions(+), 11 deletions(-) > Review

Re: [PATCH v2 20/31] qom: Make "object" QemuOptsList optional

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This code is going away anyway, but for a few more commits, we'll be in > a state where some binaries still use QemuOpts and others don't. If the > "object" QemuOptsList doesn't even exist, we don't have to remove (or > fail to remove, and therefore abort) a

Re: [PATCH v2 19/31] qapi/qom: QAPIfy object-add

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This converts object-add from 'gen': false to the ObjectOptions QAPI > type. As an immediate benefit, clients can now use QAPI schema > introspection for user creatable QOM objects. > > It is also the first step towards making the QAPI schema the only > exte

Re: [PATCH v2 18/31] qapi/qom: Add ObjectOptions for x-remote-object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the x-remote-object > object. > > Signed-off-by: Kevin Wolf > --- > qapi/qom.json | 20 ++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > > diff --git a/qapi/qom.json b/qapi/qom.json >

Re: [PATCH v2 17/31] qapi/qom: Add ObjectOptions for input-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the input-* objects. > > ui.json cannot be included in qom.json because the storage daemon can't > use it, so move GrabToggleKeys to common.json. > > Signed-off-by: Kevin Wolf > --- > qapi/common.json | 12 +++

Re: [PATCH v2 16/31] qapi/qom: Add ObjectOptions for confidential-guest-support

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the objects implementing > the confidential-guest-support interface. > > pef-guest and s390x-pv-guest don't have any properties, so they only > need to be added to the ObjectType enum without adding a new branch

Re: [PATCH v2 15/31] qapi/qom: Add ObjectOptions for pr-manager-helper

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the pr-manager-helper > object. > > Signed-off-by: Kevin Wolf > --- > qapi/qom.json | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/qapi/qom.json b/qapi/qom.json > index e3357f5123..e7

Re: [PATCH v2 14/31] qapi/qom: Add ObjectOptions for filter-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the filter-* objects. > > Some parts of the interface (in particular NetfilterProperties.position) > are very unusual for QAPI, but for now just describe the existing > interface. > > net.json can't be included

Re: [PATCH v2 13/31] qapi/qom: Add ObjectOptions for colo-compare

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the colo-compare object. > > Signed-off-by: Kevin Wolf > --- > qapi/qom.json | 49 + > 1 file changed, 49 insertions(+) > > diff --git a/qapi/qom.json b/qapi/qom

Re: [PATCH v2 12/31] qapi/qom: Add ObjectOptions for can-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the can-* objects. > > can-bus doesn't have any properties, so it only needs to be added to the > ObjectType enum without adding a new branch to ObjectOptions. I somewhat prefer 'can-bus': {}, to make it expli

Re: [PATCH v2 11/31] qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded'

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the tls-* objects. > > The 'loaded' property doesn't seem to make sense as an external > interface: It is automatically set to true in ucc->complete, and > explicitly setting it to true earlier just means that ad

Re: [PATCH v2 10/31] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the secret* objects. > > The 'loaded' property doesn't seem to make sense as an external > interface: It is automatically set to true in ucc->complete, and > explicitly setting it to true earlier just means that

Re: [PATCH V2 6/7] hw/block/nvme: support namespace attachment command

2021-02-26 Thread Keith Busch
On Thu, Feb 11, 2021 at 01:09:36AM +0900, Minwoo Im wrote: > @@ -183,6 +183,7 @@ static const uint32_t nvme_cse_acs[256] = { > [NVME_ADM_CMD_SET_FEATURES] = NVME_CMD_EFF_CSUPP, > [NVME_ADM_CMD_GET_FEATURES] = NVME_CMD_EFF_CSUPP, > [NVME_ADM_CMD_ASYNC_EV_REQ] = NVME_CMD_EF

Re: [PATCH v4 0/8] hw/sh4: Kconfig cleanups

2021-02-26 Thread Philippe Mathieu-Daudé
On 2/22/21 3:15 PM, Philippe Mathieu-Daudé wrote: > Philippe Mathieu-Daudé (8): > hw/sh4: Add missing license > hw/sh4: Add missing Kconfig dependency on SH7750 for the R2D board > hw/intc: Introduce SH_INTC Kconfig entry > hw/char: Introduce SH_SCI Kconfig entry > hw/timer: Introduce SH

Re: [PATCH v2 09/31] qapi/qom: Add ObjectOptions for throttle-group

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the throttle-group object. > > The only purpose of the x-* properties is to make the nested options in > 'limits' available for a command line parser that doesn't support > structs. Any parser that will use the Q

Re: [PATCH v2 08/31] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened'

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the rng-* objects. > > The 'opened' property doesn't seem to make sense as an external > interface: It is automatically set to true in ucc->complete, and > explicitly setting it to true earlier just means that tr

Re: [PATCH v2 07/31] qapi/qom: Add ObjectOptions for memory-backend-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the memory-backend-* > objects. > > HostMemPolicy has to be moved to an include file that can be used by the > storage daemon, too, because ObjectOptions must be the same in all > binaries if we don't want to com

Re: [PATCH v2 06/31] qapi/qom: Add ObjectOptions for dbus-vmstate

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the dbus-vmstate object. > > A list represented as a comma separated string is clearly not very > QAPI-like, but for now just describe the existing interface. Does your alias proposal give us a path forward for

Re: [PATCH v2 05/31] qapi/qom: Add ObjectOptions for cryptodev-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the cryptodev-* objects. > > These interfaces have some questionable aspects (cryptodev-backend is > really an abstract base class without function, and the queues option > only makes sense for cryptodev-vhost-us

Re: [PATCH v2 04/31] qapi/qom: Add ObjectOptions for authz-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the authz-* objects. > > Signed-off-by: Kevin Wolf > --- > qapi/authz.json | 62 > qapi/qom.json| 10 + > storage-daemon/qapi/qapi-s

Re: [PATCH] storage-daemon: include current command line option in the errors

2021-02-26 Thread Eric Blake
On 2/26/21 5:03 AM, Paolo Bonzini wrote: > Use the location management facilities that the emulator uses, so that > the current command line option appears in the error message. > > Before: > > $ storage-daemon/qemu-storage-daemon --nbd key..= > qemu-storage-daemon: Invalid parameter 'key..'

Re: [PATCH 2/2] hw/block/nvme: add 'nvme_ana_inject_state' HMP command

2021-02-26 Thread Minwoo Im
On 21-02-14 20:24:00, Minwoo Im wrote: > Human Monitor Interface(HMP) is there for easy human debugging. This > patch added a HMP command 'nvme_ana_inject_state'. This can be executed > from the QEMU monitor. This command will have the following syntax: > > # nvme_ana_inject_state >

Re: [PATCH V2 0/6] hw/block/nvme: support namespace attachment

2021-02-26 Thread Minwoo Im
On 21-02-11 01:09:30, Minwoo Im wrote: > Hello, > > This series supports namespace attachment: attach and detach. This is > the second version series with a fix a bug on choosing a controller to > attach for a namespace in the attach command handler. Keith, Could you please have a look at this

Re: block/throttle and burst bucket

2021-02-26 Thread Peter Lieven
Am 26.02.21 um 10:27 schrieb Alberto Garcia: > On Thu 25 Feb 2021 06:34:48 PM CET, Peter Lieven wrote: >> I was wondering if there is a way to check from outside (qmp etc.) if >> a throttled block device has exceeded the iops_max_length seconds of >> time bursting up to iops_max and is now hard li

Re: [RFC PATCH v2 3/4] block: Support multiple reopening with x-blockdev-reopen

2021-02-26 Thread Alberto Garcia
On Wed 24 Feb 2021 01:33:05 PM CET, Kevin Wolf wrote: >> > { 'command': 'x-blockdev-reopen', >> > - 'data': 'BlockdevOptions', 'boxed': true } >> > + 'data': { 'options': ['BlockdevOptions'] } } >> >> Do we also want to drop x- prefix? > > libvirt really wants to have a stable blockdev-reopen

Re: [PATCH v2 19/31] qapi/qom: QAPIfy object-add

2021-02-26 Thread Paolo Bonzini
On 24/02/21 14:52, Kevin Wolf wrote: +v = qobject_output_visitor_new(&qobj); +visit_type_ObjectOptions(v, NULL, &options, &error_abort); +visit_complete(v, &qobj); +visit_free(v); + +props = qobject_to(QDict, qobj); +qdict_del(props, "qom-type"); +qdict_del(props, "id"

[PATCH] storage-daemon: include current command line option in the errors

2021-02-26 Thread Paolo Bonzini
Use the location management facilities that the emulator uses, so that the current command line option appears in the error message. Before: $ storage-daemon/qemu-storage-daemon --nbd key..= qemu-storage-daemon: Invalid parameter 'key..' After: $ storage-daemon/qemu-storage-daemon --nbd k

Re: block/throttle and burst bucket

2021-02-26 Thread Alberto Garcia
On Thu 25 Feb 2021 06:34:48 PM CET, Peter Lieven wrote: > I was wondering if there is a way to check from outside (qmp etc.) if > a throttled block device has exceeded the iops_max_length seconds of > time bursting up to iops_max and is now hard limited to the iops limit > that is supplied? > > Wo

Re: [PATCH v2 4/6] parallels: support bitmap extension for read-only mode

2021-02-26 Thread Denis V. Lunev
On 2/24/21 1:47 PM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/parallels.h | 6 +- > block/parallels-ext.c | 300 ++ > block/parallels.c | 18 +++ > block/meson.build | 3 +- > 4 files ch

Re: [PATCH v2 6/6] iotests: add parallels-read-bitmap test

2021-02-26 Thread Denis V. Lunev
On 2/24/21 1:47 PM, Vladimir Sementsov-Ogievskiy wrote: > Test support for reading bitmap from parallels image format. > parallels-with-bitmap.bz2 is generated on Virtuozzo by > parallels-with-bitmap.sh > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > .../sample_images/parallels-with-bitma

Re: [RFC PATCH 2/3] hw/block/pflash: Move code around

2021-02-26 Thread David Edmondson
On Friday, 2021-02-26 at 00:02:37 +01, Philippe Mathieu-Daudé wrote: > First do the block checks, so we know if it is read-only or not. > Then create the MemoryRegion. This will allow optimization in > the next commit. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Edmondson > --

Re: [RFC PATCH 3/3] hw/block/pflash: use memory_region_init_rom_device_from_file()

2021-02-26 Thread David Edmondson
On Friday, 2021-02-26 at 00:02:38 +01, Philippe Mathieu-Daudé wrote: > If the block drive is read-only we will model a "protected" flash > device. We can thus use memory_region_init_rom_device_from_file() > which mmap the backing file when creating the MemoryRegion. > If the same backing file is u