mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
vl: New qemu_get_machine_opts()
To be used in the next few commits to fix or clean up queries of "machine" options (-machine and its sugared forms). Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
6d4cd40868
commit
7f9d6e540e
2 changed files with 21 additions and 0 deletions
|
@ -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;
|
||||
|
|
19
vl.c
19
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;
|
||||
|
|
Loading…
Reference in a new issue