[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 18/27] host-libusb: remove bootindex property fro
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v6 18/27] host-libusb: remove bootindex property from qdev to qom |
Date: |
Sat, 30 Aug 2014 18:00:18 +0800 |
From: Gonglei <address@hidden>
Remove bootindex form qdev property to qom, 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/host-libusb.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index f37708d..c3c91f3 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -979,6 +979,30 @@ static int usb_host_initfn(USBDevice *udev)
return 0;
}
+static void usb_host_get_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ USBHostDevice *s = USB_HOST_DEVICE(obj);
+
+ get_bootindex(&s->bootindex, v, name, errp);
+}
+
+static void usb_host_set_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ USBHostDevice *s = USB_HOST_DEVICE(obj);
+
+ set_bootindex(&s->bootindex, v, name, errp);
+}
+
+static void usb_host_instance_init(Object *obj)
+{
+ object_property_add(obj, "bootindex", "int",
+ usb_host_get_bootindex,
+ usb_host_set_bootindex, NULL, NULL, NULL);
+ object_property_set_int(obj, -1, "bootindex", NULL);
+}
+
static void usb_host_handle_destroy(USBDevice *udev)
{
USBHostDevice *s = USB_HOST_DEVICE(udev);
@@ -1465,7 +1489,6 @@ static Property usb_host_dev_properties[] = {
DEFINE_PROP_UINT32("productid", USBHostDevice, match.product_id, 0),
DEFINE_PROP_UINT32("isobufs", USBHostDevice, iso_urb_count, 4),
DEFINE_PROP_UINT32("isobsize", USBHostDevice, iso_urb_frames, 32),
- DEFINE_PROP_INT32("bootindex", USBHostDevice, bootindex, -1),
DEFINE_PROP_UINT32("loglevel", USBHostDevice, loglevel,
LIBUSB_LOG_LEVEL_WARNING),
DEFINE_PROP_BIT("pipeline", USBHostDevice, options,
@@ -1498,6 +1521,7 @@ static TypeInfo usb_host_dev_info = {
.parent = TYPE_USB_DEVICE,
.instance_size = sizeof(USBHostDevice),
.class_init = usb_host_class_initfn,
+ .instance_init = usb_host_instance_init,
};
static void usb_host_register_types(void)
--
1.7.12.4
- [Qemu-devel] [PATCH v6 17/27] net: remove bootindex property from qdev to qom, (continued)
- [Qemu-devel] [PATCH v6 17/27] net: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 25/27] virtio-blk: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 21/27] redirect: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 20/27] vfio: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 26/27] block: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 23/27] ide: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 08/27] virtio-net: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 24/27] scsi: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 07/27] vl.c: add setter/getter functions for bootindex property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 19/27] pci-assign: remove bootindex property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 18/27] host-libusb: remove bootindex property from qdev to qom,
arei.gonglei <=
- [Qemu-devel] [PATCH v6 27/27] bootindex: delete bootindex when device is removed, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 14/27] spapr_lian: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 03/27] fw_cfg: add fw_cfg_machine_reset function, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 12/27] pcnet: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 22/27] isa-fdc: remove bootindexA/B property from qdev to qom, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 16/27] usb-net: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 15/27] vmxnet3: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 11/27] ne2000: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 06/27] bootindex: move setting bootindex on reset() instead of realize/init(), arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 02/27] bootindex: add del_boot_device_path function, arei.gonglei, 2014/08/30