[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v11 03/34] bootindex: add del_boot_device_path funct
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v11 03/34] bootindex: add del_boot_device_path function |
Date: |
Tue, 7 Oct 2014 16:00:07 +0800 |
From: Gonglei <address@hidden>
Introduce del_boot_device_path() to clean up fw_cfg content when
hot-unplugging a device that refers to a bootindex or update a
existent devcie's bootindex.
Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Chenliang <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>
---
bootdevice.c | 20 ++++++++++++++++++++
include/sysemu/sysemu.h | 1 +
2 files changed, 21 insertions(+)
diff --git a/bootdevice.c b/bootdevice.c
index f5399df..7167fbc 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -51,6 +51,26 @@ void check_boot_index(int32_t bootindex, Error **errp)
}
}
+void del_boot_device_path(DeviceState *dev, const char *suffix)
+{
+ FWBootEntry *i;
+
+ if (dev == NULL) {
+ return;
+ }
+
+ QTAILQ_FOREACH(i, &fw_boot_order, link) {
+ if ((!suffix || !g_strcmp0(i->suffix, suffix)) &&
+ i->dev == dev) {
+ QTAILQ_REMOVE(&fw_boot_order, i, link);
+ g_free(i->suffix);
+ g_free(i);
+
+ break;
+ }
+ }
+}
+
void add_boot_device_path(int32_t bootindex, DeviceState *dev,
const char *suffix)
{
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 72463de..b3489be 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -214,6 +214,7 @@ char *get_boot_devices_list(size_t *size, bool
ignore_suffixes);
DeviceState *get_boot_device(uint32_t position);
void check_boot_index(int32_t bootindex, Error **errp);
+void del_boot_device_path(DeviceState *dev, const char *suffix);
QemuOpts *qemu_get_machine_opts(void);
--
1.7.12.4
- [Qemu-devel] [PATCH v11 00/34] modify boot order of guest, and take effect after rebooting, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 02/34] bootindex: add check bootindex function, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 07/34] bootindex: add a setter/getter functions wrapper for bootindex property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 03/34] bootindex: add del_boot_device_path function,
arei.gonglei <=
- [Qemu-devel] [PATCH v11 10/34] eepro100: add bootindex to qom property, arei.gonglei, 2014/10/07
- [Qemu-devel] [PATCH v11 08/34] virtio-net: add bootindex to qom property, arei.gonglei, 2014/10/07
- [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