[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 01/27] bootindex: add check bootindex function
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v6 01/27] bootindex: add check bootindex function |
Date: |
Sat, 30 Aug 2014 18:00:01 +0800 |
From: Gonglei <address@hidden>
Determine whether a given bootindex exists or not.
If exists, we report an error.
Signed-off-by: Gonglei <address@hidden>
---
include/sysemu/sysemu.h | 1 +
vl.c | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index d8539fd..b343df5 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -207,6 +207,7 @@ void do_usb_add(Monitor *mon, const QDict *qdict);
void do_usb_del(Monitor *mon, const QDict *qdict);
void usb_info(Monitor *mon, const QDict *qdict);
+void check_boot_index(int32_t bootindex, Error **errp);
void add_boot_device_path(int32_t bootindex, DeviceState *dev,
const char *suffix);
char *get_boot_devices_list(size_t *size, bool ignore_suffixes);
diff --git a/vl.c b/vl.c
index 95be92d..76fb008 100644
--- a/vl.c
+++ b/vl.c
@@ -1237,6 +1237,21 @@ static void restore_boot_order(void *opaque)
g_free(normal_boot_order);
}
+void check_boot_index(int32_t bootindex, Error **errp)
+{
+ FWBootEntry *i;
+
+ if (bootindex >= 0) {
+ QTAILQ_FOREACH(i, &fw_boot_order, link) {
+ if (i->bootindex == bootindex) {
+ error_setg(errp, "The bootindex %d has already been used",
+ bootindex);
+ return;
+ }
+ }
+ }
+}
+
void add_boot_device_path(int32_t bootindex, DeviceState *dev,
const char *suffix)
{
--
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 <=
- [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, 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