Message ID | 20250227085601.4140852-7-armbru@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Property type reporting improvements | expand |
On Thu, Feb 27, 2025 at 09:56:01AM +0100, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster <armbru@redhat.com> > --- > hw/block/xen-block.c | 2 +- > hw/core/qdev-properties-system.c | 2 +- > hw/core/qdev-properties.c | 1 + > hw/s390x/ccw-device.c | 4 ++-- > target/sparc/cpu.c | 1 + > 5 files changed, 6 insertions(+), 4 deletions(-) Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> > diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c > index 5a801057db..c04df3b337 100644 > --- a/hw/core/qdev-properties.c > +++ b/hw/core/qdev-properties.c > @@ -247,6 +247,7 @@ static void set_bool(Object *obj, Visitor *v, const char *name, void *opaque, > > const PropertyInfo qdev_prop_bool = { > .type = "bool", > + .description = "on/off", Awkward as on/off for QemuOpts, but JSON true/false for QMP, but I guess clarifying this is beyond the scope of the .description field. > .get = get_bool, > .set = set_bool, > .set_default_value = set_default_value_bool, With regards, Daniel
Daniel P. Berrangé <berrange@redhat.com> writes: > On Thu, Feb 27, 2025 at 09:56:01AM +0100, Markus Armbruster wrote: >> Signed-off-by: Markus Armbruster <armbru@redhat.com> >> --- >> hw/block/xen-block.c | 2 +- >> hw/core/qdev-properties-system.c | 2 +- >> hw/core/qdev-properties.c | 1 + >> hw/s390x/ccw-device.c | 4 ++-- >> target/sparc/cpu.c | 1 + >> 5 files changed, 6 insertions(+), 4 deletions(-) > > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> > > >> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c >> index 5a801057db..c04df3b337 100644 >> --- a/hw/core/qdev-properties.c >> +++ b/hw/core/qdev-properties.c >> @@ -247,6 +247,7 @@ static void set_bool(Object *obj, Visitor *v, const char *name, void *opaque, >> >> const PropertyInfo qdev_prop_bool = { >> .type = "bool", >> + .description = "on/off", > > Awkward as on/off for QemuOpts, but JSON true/false for QMP, but I > guess clarifying this is beyond the scope of the .description field. In my view, description applies to human-friendly dotted-keys syntax, not to JSON. Trying to make it work for both would result in verbose and confusing descriptions. Thanks!
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 7c9d1b658c..2098286b5f 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -662,7 +662,7 @@ invalid: */ static const PropertyInfo xen_block_prop_vdev = { .type = "str", - .description = "Virtual Disk specifier: d*p*/xvd*/hd*/sd*", + .description = "Virtual Disk specifier (d*p*/xvd*/hd*/sd*)", .get = xen_block_get_vdev, .set = xen_block_set_vdev, }; diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index aa7600bce6..1f01eb3e59 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -985,7 +985,7 @@ inval: const PropertyInfo qdev_prop_pci_host_devaddr = { .type = "str", - .description = "Address (bus/device/function) of " + .description = "Address (bus:device.function) of " "the host device, example: 04:10.0", .get = get_pci_host_devaddr, .set = set_pci_host_devaddr, diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 5a801057db..c04df3b337 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -247,6 +247,7 @@ static void set_bool(Object *obj, Visitor *v, const char *name, void *opaque, const PropertyInfo qdev_prop_bool = { .type = "bool", + .description = "on/off", .get = get_bool, .set = set_bool, .set_default_value = set_default_value_bool, diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 1d4b8ea35c..1ea9934f6c 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -75,8 +75,8 @@ static void ccw_device_set_loadparm(Object *obj, Visitor *v, const PropertyInfo ccw_loadparm = { .type = "str", - .description = "Up to 8 chars in set of [A-Za-z0-9. ] to pass" - " to the guest loader/kernel", + .description = "Up to 8 chars in set of [A-Za-z0-9. ] to select" + " a guest kernel", .get = ccw_device_get_loadparm, .set = ccw_device_set_loadparm, }; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index c8ea35be76..f0613f8a8e 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -939,6 +939,7 @@ static void sparc_set_nwindows(Object *obj, Visitor *v, const char *name, static const PropertyInfo qdev_prop_nwindows = { .type = "int", + .description = "Number of register windows", .get = sparc_get_nwindows, .set = sparc_set_nwindows, };
Signed-off-by: Markus Armbruster <armbru@redhat.com> --- hw/block/xen-block.c | 2 +- hw/core/qdev-properties-system.c | 2 +- hw/core/qdev-properties.c | 1 + hw/s390x/ccw-device.c | 4 ++-- target/sparc/cpu.c | 1 + 5 files changed, 6 insertions(+), 4 deletions(-)