mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
QemuOpts: make most qemu_*_opts static
Switch tree to lookup-by-name using qemu_find_opts(). Also hook up virtfs options so qemu_find_opts works for them too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
dfe795e71f
commit
3329f07b7a
13 changed files with 59 additions and 66 deletions
|
@ -51,7 +51,7 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", 0);
|
||||
opts = qemu_opts_parse(qemu_find_opts("net"), opts_str ? opts_str : "", 0);
|
||||
if (!opts) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -772,5 +772,5 @@ static int qdev_add_one_global(QemuOpts *opts, void *opaque)
|
|||
|
||||
void qemu_add_globals(void)
|
||||
{
|
||||
qemu_opts_foreach(&qemu_global_opts, qdev_add_one_global, NULL, 0);
|
||||
qemu_opts_foreach(qemu_find_opts("global"), qdev_add_one_global, NULL, 0);
|
||||
}
|
||||
|
|
|
@ -792,7 +792,7 @@ int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
|||
{
|
||||
QemuOpts *opts;
|
||||
|
||||
opts = qemu_opts_from_qdict(&qemu_device_opts, qdict);
|
||||
opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict);
|
||||
if (!opts) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -575,7 +575,7 @@ static USBDevice *usb_msd_init(const char *filename)
|
|||
|
||||
/* parse -usbdevice disk: syntax into drive opts */
|
||||
snprintf(id, sizeof(id), "usb%d", nr++);
|
||||
opts = qemu_opts_create(&qemu_drive_opts, id, 0);
|
||||
opts = qemu_opts_create(qemu_find_opts("drive"), id, 0);
|
||||
|
||||
p1 = strchr(filename, ':');
|
||||
if (p1++) {
|
||||
|
|
|
@ -1472,7 +1472,7 @@ static USBDevice *usb_net_init(const char *cmdline)
|
|||
QemuOpts *opts;
|
||||
int idx;
|
||||
|
||||
opts = qemu_opts_parse(&qemu_net_opts, cmdline, 0);
|
||||
opts = qemu_opts_parse(qemu_find_opts("net"), cmdline, 0);
|
||||
if (!opts) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ int select_watchdog(const char *p)
|
|||
QLIST_FOREACH(model, &watchdog_list, entry) {
|
||||
if (strcasecmp(model->wdt_name, p) == 0) {
|
||||
/* add the device */
|
||||
opts = qemu_opts_create(&qemu_device_opts, NULL, 0);
|
||||
opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0);
|
||||
qemu_opt_set(opts, "driver", p);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue