Patchwork also match bus name for global properties

login
register
mail settings
Submitter Gerd Hoffmann
Date Dec. 7, 2009, 2:52 p.m.
Message ID <1260197548-27600-1-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/40509/
State New
Headers show

Comments

Gerd Hoffmann - Dec. 7, 2009, 2:52 p.m.
i.e. -global PCI.<property>=<value> will set a default property for all
PCi devices.  Also works for the compat properties used by machine
types.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qdev-properties.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index fe106bd..fb07279 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -614,7 +614,8 @@  void qdev_prop_set_globals(DeviceState *dev)
     GlobalProperty *prop;
 
     QTAILQ_FOREACH(prop, &global_props, next) {
-        if (strcmp(dev->info->name, prop->driver) != 0) {
+        if (strcmp(dev->info->name, prop->driver) != 0 &&
+            strcmp(dev->info->bus_info->name, prop->driver) != 0) {
             continue;
         }
         if (qdev_prop_parse(dev, prop->property, prop->value) != 0) {