aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-10-07 16:00:25 +0800
committerGerd Hoffmann <kraxel@redhat.com>2014-10-15 09:52:55 +0200
commitabc5b3bfe1c77ad622188341d1ee4d49de308ae3 (patch)
treefeb63601e4c1e13450e6f2c6eb711be7954093e0 /hw
parent7f6014af279b9a5a6580ac66d474a0d8d86ec665 (diff)
vfio: remove bootindex property from qdev to qom
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 <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/misc/vfio.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index d66f3d2425..b37f41cb2e 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -4365,13 +4365,22 @@ post_reset:
vfio_pci_post_reset(vdev);
}
+static void vfio_instance_init(Object *obj)
+{
+ PCIDevice *pci_dev = PCI_DEVICE(obj);
+ VFIODevice *vdev = DO_UPCAST(VFIODevice, pdev, PCI_DEVICE(obj));
+
+ device_add_bootindex_property(obj, &vdev->bootindex,
+ "bootindex", NULL,
+ &pci_dev->qdev, 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),
@@ -4407,6 +4416,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)