summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sysemu/sysemu.h2
-rw-r--r--vl.c19
2 files changed, 21 insertions, 0 deletions
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 2fb71afa25..d85bdc0cac 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -185,6 +185,8 @@ char *get_boot_devices_list(size_t *size);
DeviceState *get_boot_device(uint32_t position);
+QemuOpts *qemu_get_machine_opts(void);
+
bool usb_enabled(bool default_usb);
extern QemuOptsList qemu_drive_opts;
diff --git a/vl.c b/vl.c
index 6d9fd7d807..e68d19c22e 100644
--- a/vl.c
+++ b/vl.c
@@ -516,6 +516,25 @@ static QemuOptsList qemu_realtime_opts = {
},
};
+/**
+ * Get machine options
+ *
+ * Returns: machine options (never null).
+ */
+QemuOpts *qemu_get_machine_opts(void)
+{
+ QemuOptsList *list;
+ QemuOpts *opts;
+
+ list = qemu_find_opts("machine");
+ assert(list);
+ opts = qemu_opts_find(list, NULL);
+ if (!opts) {
+ opts = qemu_opts_create_nofail(list);
+ }
+ return opts;
+}
+
const char *qemu_get_vm_name(void)
{
return qemu_name;