summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-07-02 00:19:02 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-16 08:28:12 -0500
commit76e30d0f13a8eb1f4dee86273b50b17b81dad9f4 (patch)
tree283ca815fad48064469d10374648d0696cef1ea7 /monitor.c
parentef3adf68f802da54b2096da8aa3ce97bde54be2e (diff)
Move boot_set callback backend
Move registration function for the boot_set callback handler and provide qemu_boot_set so that it can also be used outside the monitor code. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/monitor.c b/monitor.c
index 342af32326..c3ef099bda 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1185,28 +1185,15 @@ static void do_ioport_read(Monitor *mon, int count, int format, int size,
suffix, addr, size * 2, val);
}
-/* boot_set handler */
-static QEMUBootSetHandler *qemu_boot_set_handler = NULL;
-static void *boot_opaque;
-
-void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque)
-{
- qemu_boot_set_handler = func;
- boot_opaque = opaque;
-}
-
static void do_boot_set(Monitor *mon, const char *bootdevice)
{
int res;
- if (qemu_boot_set_handler) {
- res = qemu_boot_set_handler(boot_opaque, bootdevice);
- if (res == 0)
- monitor_printf(mon, "boot device list now set to %s\n",
- bootdevice);
- else
- monitor_printf(mon, "setting boot device list failed with "
- "error %i\n", res);
+ res = qemu_boot_set(bootdevice);
+ if (res == 0) {
+ monitor_printf(mon, "boot device list now set to %s\n", bootdevice);
+ } else if (res > 0) {
+ monitor_printf(mon, "setting boot device list failed\n");
} else {
monitor_printf(mon, "no function defined to set boot device list for "
"this architecture\n");