[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 25/27] virtio-blk: add bootindex to qom property
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v6 25/27] virtio-blk: add bootindex to qom property |
Date: |
Sat, 30 Aug 2014 18:00:25 +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/block/virtio-blk.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index e74a4c5..ccc1e1f 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -797,6 +797,22 @@ static void virtio_blk_device_unrealize(DeviceState *dev,
Error **errp)
virtio_cleanup(vdev);
}
+static void virtio_blk_get_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ VirtIOBlock *s = VIRTIO_BLK(obj);
+
+ get_bootindex(&s->conf->bootindex, v, name, errp);
+}
+
+static void virtio_blk_set_bootindex(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ VirtIOBlock *s = VIRTIO_BLK(obj);
+
+ set_bootindex(&s->conf->bootindex, v, name, errp);
+}
+
static void virtio_blk_instance_init(Object *obj)
{
VirtIOBlock *s = VIRTIO_BLK(obj);
@@ -805,6 +821,9 @@ static void virtio_blk_instance_init(Object *obj)
(Object **)&s->blk.iothread,
qdev_prop_allow_set_link_before_realize,
OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
+ object_property_add(obj, "bootindex", "int",
+ virtio_blk_get_bootindex,
+ virtio_blk_set_bootindex, NULL, NULL, NULL);
}
static Property virtio_blk_properties[] = {
--
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 <=
- [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