qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v9 16/30] usb-net: add bootindex to qom property


From: arei.gonglei
Subject: [Qemu-devel] [PATCH v9 16/30] usb-net: add bootindex to qom property
Date: Wed, 10 Sep 2014 20:31:12 +0800

From: Gonglei <address@hidden>

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <address@hidden>
---
 hw/usb/dev-network.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 518d536..0dd4df7 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1376,6 +1376,16 @@ static int usb_net_initfn(USBDevice *dev)
     return 0;
 }
 
+static void usb_net_instance_init(Object *obj)
+{
+    USBDevice *dev = USB_DEVICE(obj);
+    USBNetState *s = DO_UPCAST(USBNetState, dev, dev);
+
+    device_add_bootindex_property(obj, &s->conf.bootindex,
+                                  "bootindex", "/address@hidden",
+                                  &dev->qdev, NULL);
+}
+
 static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
 {
     Error *local_err = NULL;
@@ -1439,6 +1449,7 @@ static const TypeInfo net_info = {
     .parent        = TYPE_USB_DEVICE,
     .instance_size = sizeof(USBNetState),
     .class_init    = usb_net_class_initfn,
+    .instance_init = usb_net_instance_init,
 };
 
 static void usb_net_register_types(void)
-- 
1.7.12.4





reply via email to

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