[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] qmp: Return 'user_creatable' & 'hotpluggable' fie
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [RFC] qmp: Return 'user_creatable' & 'hotpluggable' fields on qom-list-types |
Date: |
Wed, 17 May 2017 17:00:29 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 05/17/2017 04:25 PM, Eduardo Habkost wrote:
> Currently there's no way for QMP clients to get a list of device types
> that are really usable with -device. This information would be useful
> for management software and test scripts (like the device-crash-test
> script I have submitted recently). Interestingly, the "info qdm" HMP
> command provides this information, but no QMP command does.
>
> Add two new fields to the return value of qom-list-types:
> "user-creatable-device" and "hotpluggable-device". Also, add extra
> arguments for filtering the list of types based on the new fields.
>
> I'm not sure about the naming of the new command arguments. Maybe the
> names are too long, but I believe that "user-creatable-devices-only=false"
> would have more obvious semantics than "user-creatable-devices=false"
> (the latter looks ambiguous: it could mean "return only
> non-user-creatable devices" or "return all devices").
Since this is still RFC, here's a bikeshed idea:
"just-user-creatable":false
is shorter, and still conveys whether we care about just user_creatable
devices or all devices.
> +++ b/qapi-schema.json
> @@ -3034,12 +3034,24 @@
> #
> # @name: the type name found in the search
> #
> +# @user-creatable-device: If true, the type is a user-creatable device that
> +# can be used with the "-device" command-line option.
> +# Note that this does not guarantee that the device
> +# is going to be accepted by all machine-types.
> +# (since 2.10)
> +#
> +# @hotpluggable-device: If true, the type is a hotpluggable device that can
> +# be plugged using the "device_add" monitor command.
> +# Note that this does not guarantee that the device can
> +# be hotplugged on any machine-type. (since 2.10)
Do we need the '-device' suffix in both names? I'm not opposed to it,
but don't know if it is adding any useful information.
> ##
> { 'command': 'qom-list-types',
> - 'data': { '*implements': 'str', '*abstract': 'bool' },
> + 'data': { '*implements': 'str', '*abstract': 'bool',
> + '*user-creatable-devices-only': 'bool',
> '*hotpluggable-devices-only': 'bool' },
Long line, try to keep it under 80 columns.
The idea looks reasonable to me.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature