[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 20/27] vfio: remove bootindex property from qdev
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v6 20/27] vfio: remove bootindex property from qdev to qom |
Date: |
Sat, 30 Aug 2014 18:00:20 +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/misc/vfio.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index 625598a..465d934 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -4366,13 +4366,36 @@ post_reset:
vfio_pci_post_reset(vdev);
}
+static void vfio_get_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ VFIODevice *vdev = DO_UPCAST(VFIODevice, pdev, PCI_DEVICE(obj));
+
+ get_bootindex(&vdev->bootindex, v, name, errp);
+}
+
+static void vfio_set_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ VFIODevice *vdev = DO_UPCAST(VFIODevice, pdev, PCI_DEVICE(obj));
+
+ get_bootindex(&vdev->bootindex, v, name, errp);
+}
+
+static void vfio_instance_init(Object *obj)
+{
+ object_property_add(obj, "bootindex", "int",
+ vfio_get_bootindex,
+ vfio_set_bootindex, NULL, NULL, NULL);
+ object_property_set_int(obj, -1, "bootindex", NULL);
+}
+
static Property vfio_pci_dev_properties[] = {
DEFINE_PROP_PCI_HOST_DEVADDR("host", VFIODevice, host),
DEFINE_PROP_UINT32("x-intx-mmap-timeout-ms", VFIODevice,
intx.mmap_timeout, 1100),
DEFINE_PROP_BIT("x-vga", VFIODevice, features,
VFIO_FEATURE_ENABLE_VGA_BIT, false),
- DEFINE_PROP_INT32("bootindex", VFIODevice, bootindex, -1),
/*
* TODO - support passed fds... is this necessary?
* DEFINE_PROP_STRING("vfiofd", VFIODevice, vfiofd_name),
@@ -4408,6 +4431,7 @@ static const TypeInfo vfio_pci_dev_info = {
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(VFIODevice),
.class_init = vfio_pci_dev_class_init,
+ .instance_init = vfio_instance_init,
};
static void register_vfio_pci_dev_type(void)
--
1.7.12.4
- [Qemu-devel] [PATCH v6 00/27] modify boot order of guest, and take effect after rebooting, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 10/27] eepro100: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 01/27] bootindex: add check bootindex function, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 04/27] bootindex: rework add_boot_device_path function, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 09/27] e1000: add bootindex to qom property, arei.gonglei, 2014/08/30
- [Qemu-devel] [PATCH v6 05/27] bootindex: support to set a existent device's bootindex to -1, arei.gonglei, 2014/08/30
- [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 <=
- [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, 2014/08/30
- [Qemu-devel] [PATCH v6 27/27] bootindex: delete bootindex when device is removed, arei.gonglei, 2014/08/30