Patchwork [04/14] qdev: don't allow globals to be set by bus name

login
register
mail settings
Submitter Anthony Liguori
Date April 18, 2012, 8:56 p.m.
Message ID <1334782613-5421-5-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/153590/
State New
Headers show

Comments

Anthony Liguori - April 18, 2012, 8:56 p.m.
This is technically a compatibility breaker.  However:

1) libvirt does not rely on this (it always uses the driver name)

2) This behavior isn't actually documented anywhere (the docs just say driver).

3) I suspect there are less than three people on earth that even know this is
   possible (minus the people reading this message).

So I think we can safely break it :-)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/qdev-properties.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 98dd06a..894fa79 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -1172,8 +1172,7 @@  void qdev_prop_set_globals(DeviceState *dev)
     GlobalProperty *prop;
 
     QTAILQ_FOREACH(prop, &global_props, next) {
-        if (strcmp(object_get_typename(OBJECT(dev)), prop->driver) != 0 &&
-            strcmp(qdev_get_bus_info(dev)->name, prop->driver) != 0) {
+        if (strcmp(object_get_typename(OBJECT(dev)), prop->driver) != 0) {
             continue;
         }
         if (qdev_prop_parse(dev, prop->property, prop->value) != 0) {