qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 16/34] usb-net: add bootindex to qom property


From: Gerd Hoffmann
Subject: [Qemu-devel] [PULL 16/34] usb-net: add bootindex to qom property
Date: Wed, 15 Oct 2014 11:05:49 +0200

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>
Reviewed-by: Gerd Hoffmann <address@hidden>
Signed-off-by: Gerd Hoffmann <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 23e3c45..f341b33 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1375,6 +1375,16 @@ static void usb_net_realize(USBDevice *dev, Error 
**errrp)
     add_boot_device_path(s->conf.bootindex, &dev->qdev, "/address@hidden");
 }
 
+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;
@@ -1438,6 +1448,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.8.3.1




reply via email to

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