[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v11 31/34] ide: add calling add_boot_device_patch in
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v11 31/34] ide: add calling add_boot_device_patch in bootindex setter function |
Date: |
Tue, 7 Oct 2014 16:00:35 +0800 |
From: Gonglei <address@hidden>
On this way, we can assure the new bootindex take effect
during vm rebooting. Meanwhile set the initial value of
bootindex to -1.
Because ide devcies's unit property maybe
do not initialize when set_bootindex function is called,
so that we don't know its suffix. So we have to save the
call add_boot_device_path() on ide realize/init function.
When we want to change bootindex during vm rebooting, we
can call it in setter function.
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>
---
hw/ide/qdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 7e69020..6258b98 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -219,6 +219,10 @@ static void ide_dev_set_bootindex(Object *obj, Visitor *v,
void *opaque,
/* change bootindex to a new one */
d->conf.bootindex = boot_index;
+ if (d->unit != -1) {
+ add_boot_device_path(d->conf.bootindex, &d->qdev,
+ d->unit ? "/address@hidden" : "/address@hidden");
+ }
out:
if (local_err) {
error_propagate(errp, local_err);
@@ -230,6 +234,7 @@ static void ide_dev_instance_init(Object *obj)
object_property_add(obj, "bootindex", "int32",
ide_dev_get_bootindex,
ide_dev_set_bootindex, NULL, NULL, NULL);
+ object_property_set_int(obj, -1, "bootindex", NULL);
}
static int ide_hd_initfn(IDEDevice *dev)
--
1.7.12.4
- [Qemu-devel] [PATCH v11 11/34] ne2000: add bootindex to qom property, (continued)
- [Qemu-devel] [PATCH v11 11/34] ne2000: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 14/34] spapr_lian: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 20/34] pci-assign: remove bootindex property from qdev to qom, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 13/34] rtl8139: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 18/34] virtio-net: alias bootindex property explicitly for virt-net-pci/ccw/s390, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 12/34] pcnet: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 19/34] host-libusb: remove bootindex property from qdev to qom, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 15/34] vmxnet3: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 01/34] bootdevice: move bootdevice related code to new file bootdevice.c, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 16/34] usb-net: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 31/34] ide: add calling add_boot_device_patch in bootindex setter function,
arei.gonglei <=
- [Qemu-devel] [PATCH v11 09/34] e1000: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 06/34] bootindex: support to set a existent device's bootindex to -1, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 24/34] scsi: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 30/34] nvma: ide: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 22/34] redirect: remove bootindex property from qdev to qom, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 21/34] vfio: remove bootindex property from qdev to qom, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 26/34] virtio-blk: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 33/34] bootindex: delete bootindex when device is removed, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 05/34] bootindex: rework add_boot_device_path function, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 04/34] fw_cfg: add fw_cfg_machine_reset function, arei.gonglei, 2014/10/07