qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before regist


From: Crístian Viana
Subject: [Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering
Date: Wed, 18 Jul 2012 15:02:35 -0300

If a GlobalProperty has already been registered, it won't have its value
overwritten. This is done to enforce that the properties specified in the 
command
line will "win" over the ones specified by the machine properties, if set with
the parameter "-M".

Signed-off-by: Crístian Viana <address@hidden>
---
Changes since v5:
- Updated commit message of PATCH 1/3
- Rebased on master

 hw/qdev-properties.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 3571cf3..8356879 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -1212,6 +1212,14 @@ static QTAILQ_HEAD(, GlobalProperty) global_props = 
QTAILQ_HEAD_INITIALIZER(glob
 
 static void qdev_prop_register_global(GlobalProperty *prop)
 {
+    GlobalProperty *p;
+
+    QTAILQ_FOREACH(p, &global_props, next) {
+        if (strcmp(prop->driver, p->driver) == 0) {
+            return;
+        }
+    }
+
     QTAILQ_INSERT_TAIL(&global_props, prop, next);
 }
 
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]