qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 02/14] qdev: enforce that no devices overload the id


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 02/14] qdev: enforce that no devices overload the id property
Date: Fri, 16 Sep 2011 11:00:22 -0500

Signed-off-by: Anthony Liguori <address@hidden>
---
 hw/qdev.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index a223d41..0e267a7 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -47,9 +47,17 @@ static BusState *qbus_find(const char *path);
 /* Register a new device type.  */
 void qdev_register(DeviceInfo *info)
 {
+    int i;
+
     assert(info->size >= sizeof(DeviceState));
     assert(!info->next);
 
+    if (info->props) {
+        for (i = 0; info->props[i].name; i++) {
+            g_assert_cmpstr(info->props[i].name, !=, "id");
+        }
+    }
+
     info->next = device_info_list;
     device_info_list = info;
 }
-- 
1.7.4.1




reply via email to

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