From: Don Slutz <dslutz@verizon.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Don Slutz" <dslutz@verizon.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] qdev: Move global validation to a single function
Date: Mon, 09 Jun 2014 09:45:39 -0400 [thread overview]
Message-ID: <5395BA83.4080401@terremark.com> (raw)
In-Reply-To: <20140607022449.GM15000@otherpad.lan.raisama.net>
On 06/06/14 22:24, Eduardo Habkost wrote:
> This simplifies the global validation code so all its logic is contained
> in a single function, and fixes the following:
>
> $ qemu-system-x86_64 -global container.xxx=y
> hw/core/qdev-properties-system.c:450:qdev_add_one_global: Object 0x7f8d72a03d70 is not an instance of type device
> Aborted (core dumped)
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> hw/core/qdev-properties-system.c | 16 ----------------
> hw/core/qdev-properties.c | 25 +++++++++++++++++++------
> include/hw/qdev-core.h | 5 ++---
> tests/test-qdev-global-props.c | 15 ++++++++++++++-
> 4 files changed, 35 insertions(+), 26 deletions(-)
>
> diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
> index de433b2..404cf18 100644
> --- a/hw/core/qdev-properties-system.c
> +++ b/hw/core/qdev-properties-system.c
> @@ -439,27 +439,11 @@ PropertyInfo qdev_prop_iothread = {
> static int qdev_add_one_global(QemuOpts *opts, void *opaque)
> {
> GlobalProperty *g;
> - ObjectClass *oc;
>
> g = g_malloc0(sizeof(*g));
> g->driver = qemu_opt_get(opts, "driver");
> g->property = qemu_opt_get(opts, "property");
> g->value = qemu_opt_get(opts, "value");
> - oc = object_class_by_name(g->driver);
> - if (oc) {
> - DeviceClass *dc = DEVICE_CLASS(oc);
> -
> - if (dc->hotpluggable) {
> - /* If hotpluggable then skip not_used checking. */
> - g->not_used = false;
> - } else {
> - /* Maybe a typo. */
> - g->not_used = true;
> - }
> - } else {
> - /* Maybe a typo. */
> - g->not_used = true;
> - }
> qdev_prop_register_global(g);
> return 0;
> }
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index 3d12560..c5a8fa0 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -961,13 +961,26 @@ int qdev_prop_check_global(void)
> int ret = 0;
>
> QTAILQ_FOREACH(prop, &global_props, next) {
> - if (!prop->not_used) {
> + ObjectClass *oc;
> + DeviceClass *dc;
> + if (prop->used) {
> + continue;
> + }
> + oc = object_class_by_name(prop->driver);
> + oc = object_class_dynamic_cast(oc, TYPE_DEVICE);
> + if (!oc) {
> + error_report("Warning: global %s.%s has invalid class name",
> + prop->driver, prop->property);
> + ret = 1;
> + continue;
> + }
> + dc = DEVICE_CLASS(oc);
> + if (!dc->hotpluggable && !prop->used) {
> + error_report("Warning: global %s.%s=%s\" not used",
> + prop->driver, prop->property, prop->value);
> + ret = 1;
> continue;
> }
> - ret = 1;
> - error_report("Warning: \"-global %s.%s=%s\" not used",
> - prop->driver, prop->property, prop->value);
> -
> }
> return ret;
> }
> @@ -983,7 +996,7 @@ void qdev_prop_set_globals_for_type(DeviceState *dev, const char *typename,
> if (strcmp(typename, prop->driver) != 0) {
> continue;
> }
> - prop->not_used = false;
> + prop->used = true;
> object_property_parse(OBJECT(dev), prop->value, prop->property, &err);
> if (err != NULL) {
> error_propagate(errp, err);
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index 9221cfc..71ec282 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -241,8 +241,7 @@ struct PropertyInfo {
>
> /**
> * GlobalProperty:
> - * @not_used: Track use of a global property. Defaults to false in all C99
> - * struct initializations.
> + * @used: Set to true if global property was used.
> *
There is a big issue with switch from not_used to used:
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global VGA.rombar=0" not used
qemu-system-x86_64: Warning: global vmware-svga.rombar=0" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global virtio-9p-pci.vectors has invalid class name
qemu-system-x86_64: Warning: global VGA.rombar=0" not used
qemu-system-x86_64: Warning: global vmware-svga.rombar=0" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global VGA.rombar=0" not used
qemu-system-x86_64: Warning: global vmware-svga.rombar=0" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global PIIX4_PM.memory-hotplug-support=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.superspeed-ports-first=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msi=off" not used
qemu-system-x86_64: Warning: global nec-usb-xhci.msix=off" not used
qemu-system-x86_64: Warning: global qxl.revision has invalid class name
qemu-system-x86_64: Warning: global qxl-vga.revision has invalid class name
qemu-system-x86_64: Warning: global VGA.mmio=off" not used
qemu-system-x86_64: Warning: global VGA.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global vmware-svga.vgamem_mb=8" not used
qemu-system-x86_64: Warning: global qxl-vga.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global qxl.vgamem_mb has invalid class name
qemu-system-x86_64: Warning: global virtio-9p-pci.vectors has invalid class name
qemu-system-x86_64: Warning: global VGA.rombar=0" not used
qemu-system-x86_64: Warning: global vmware-svga.rombar=0" not used
See thread at:
http://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03513.html
-Don Slutz
> * This prevents reports of .compat_props when they are not used.
> */
> @@ -250,7 +249,7 @@ typedef struct GlobalProperty {
> const char *driver;
> const char *property;
> const char *value;
> - bool not_used;
> + bool used;
> QTAILQ_ENTRY(GlobalProperty) next;
> } GlobalProperty;
>
> diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
> index 2bef04c..2a23ff5 100644
> --- a/tests/test-qdev-global-props.c
> +++ b/tests/test-qdev-global-props.c
> @@ -143,6 +143,13 @@ static const TypeInfo dynamic_prop_type = {
> .class_init = dynamic_class_init,
> };
>
> +#define TYPE_NONDEVICE "nondevice-type"
> +
> +static const TypeInfo nondevice_type = {
> + .name = TYPE_NONDEVICE,
> + .parent = TYPE_OBJECT,
> +};
> +
> /* Test setting of static property using global properties */
> static void test_dynamic_globalprop(void)
> {
> @@ -150,7 +157,8 @@ static void test_dynamic_globalprop(void)
> static GlobalProperty props[] = {
> { TYPE_DYNAMIC_PROPS, "prop1", "101" },
> { TYPE_DYNAMIC_PROPS, "prop2", "102" },
> - { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true },
> + { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103" },
> + { TYPE_NONDEVICE, "prop4", "104" },
> {}
> };
> int all_used;
> @@ -164,6 +172,10 @@ static void test_dynamic_globalprop(void)
> g_assert_cmpuint(mt->prop2, ==, 102);
> all_used = qdev_prop_check_global();
> g_assert_cmpuint(all_used, ==, 1);
> + g_assert(props[0].used);
> + g_assert(props[1].used);
> + g_assert(!props[2].used);
> + g_assert(!props[3].used);
> }
>
> int main(int argc, char **argv)
> @@ -173,6 +185,7 @@ int main(int argc, char **argv)
> module_call_init(MODULE_INIT_QOM);
> type_register_static(&static_prop_type);
> type_register_static(&dynamic_prop_type);
> + type_register_static(&nondevice_type);
>
> g_test_add_func("/qdev/properties/static/default", test_static_prop);
> g_test_add_func("/qdev/properties/static/global", test_static_globalprop);
prev parent reply other threads:[~2014-06-09 13:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-07 2:24 [Qemu-devel] [PATCH] qdev: Move global validation to a single function Eduardo Habkost
2014-06-08 10:48 ` Michael S. Tsirkin
2014-06-09 13:45 ` Don Slutz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5395BA83.4080401@terremark.com \
--to=dslutz@verizon.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).