@@ -48,6 +48,7 @@ struct FWBootEntry {
};
static FWBootList fw_boot_order = QTAILQ_HEAD_INITIALIZER(fw_boot_order);
+static FWBootList fw_boot_once = QTAILQ_HEAD_INITIALIZER(fw_boot_once);
static QEMUBootSetHandler *boot_set_handler;
static void *boot_set_opaque;
@@ -240,7 +241,7 @@ char *get_boot_devices_list(size_t *size, bool ignore_suffixes)
size_t total = 0;
char *list = NULL;
- bootlist = &fw_boot_order;
+ bootlist = QTAILQ_EMPTY(&fw_boot_once) ? &fw_boot_order : &fw_boot_once;
QTAILQ_FOREACH(i, bootlist, link) {
char *devpath = NULL, *suffix = NULL;
@@ -373,3 +374,11 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
do_add_bootindex_prop(&fw_boot_order, obj, bootindex,
name, suffix, dev, errp);
}
+
+void device_add_bootonceindex_property(Object *obj, int32_t *bootindex,
+ const char *name, const char *suffix,
+ DeviceState *dev, Error **errp)
+{
+ do_add_bootindex_prop(&fw_boot_once, obj, bootindex,
+ name, suffix, dev, errp);
+}
@@ -214,6 +214,9 @@ void del_boot_device_path(DeviceState *dev, const char *suffix);
void device_add_bootindex_property(Object *obj, int32_t *bootindex,
const char *name, const char *suffix,
DeviceState *dev, Error **errp);
+void device_add_bootonceindex_property(Object *obj, int32_t *bootindex,
+ const char *name, const char *suffix,
+ DeviceState *dev, Error **errp);
void restore_boot_order(void *opaque);
void validate_bootdevices(const char *devices, Error **errp);
The property works just like the "bootindex" property does, but uses a separate list. When the list of boot devices is queried, the boot once list is consulted first. The normal list is returned only if the boot once list is empty. Signed-off-by: Janne Huttunen <janne.huttunen@nokia.com> --- bootdevice.c | 11 ++++++++++- include/sysemu/sysemu.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-)