[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC][PATCH 3/6] Add support for "bootonceindex" property.
From: |
Janne Huttunen |
Subject: |
[Qemu-devel] [RFC][PATCH 3/6] Add support for "bootonceindex" property. |
Date: |
Tue, 14 Mar 2017 14:50:10 +0200 |
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 <address@hidden>
---
bootdevice.c | 11 ++++++++++-
include/sysemu/sysemu.h | 3 +++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/bootdevice.c b/bootdevice.c
index 30e98ae..b5515f8 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -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);
+}
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 576c7ce..9acf2d9 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -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);
--
2.7.4
- [Qemu-devel] [RFC][PATCH 4/6] Clear the boot once list after it has been used., (continued)
- [Qemu-devel] [RFC][PATCH 4/6] Clear the boot once list after it has been used., Janne Huttunen, 2017/03/14
- [Qemu-devel] [RFC][PATCH 1/6] Re-factor bootdevice list handling, pt1., Janne Huttunen, 2017/03/14
- Re: [Qemu-devel] [RFC][PATCH 0/6] "bootonceindex" property, Gerd Hoffmann, 2017/03/14
- [Qemu-devel] [RFC][PATCH 2/6] Re-factor bootdevice list handling, pt2., Janne Huttunen, 2017/03/14
- [Qemu-devel] [RFC][PATCH 6/6] Support "bootonceindex" property for SCSI disks., Janne Huttunen, 2017/03/14
- [Qemu-devel] [RFC][PATCH 3/6] Add support for "bootonceindex" property.,
Janne Huttunen <=