summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-02-12 17:52:20 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-02-26 14:49:31 +0100
commitf43e47dbf6de24db20ec9b588bb6cc762093dd69 (patch)
treee6236f3afaabde624458eab11e8daaa7e0dd4878 /hw
parent6be4194b9215ed29f258543ce34a1b4b2003864d (diff)
QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
qemu_opt_set() is a wrapper around qemu_opt_set() that reports the error with qerror_report_err(). Most of its users assume the function can't fail. Make them use qemu_opt_set_err() with &error_abort, so that should the assumption ever break, it'll break noisily. Just two users remain, in util/qemu-config.c. Switch them to qemu_opt_set_err() as well, then rename qemu_opt_set_err() to qemu_opt_set(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci/pci-hotplug-old.c2
-rw-r--r--hw/usb/dev-network.c4
-rw-r--r--hw/usb/dev-storage.c6
-rw-r--r--hw/watchdog/watchdog.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
index beea6d2b02..501a918b89 100644
--- a/hw/pci/pci-hotplug-old.c
+++ b/hw/pci/pci-hotplug-old.c
@@ -87,7 +87,7 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
return NULL;
}
- qemu_opt_set(opts, "type", "nic");
+ qemu_opt_set(opts, "type", "nic", &error_abort);
ret = net_client_init(opts, 0, &local_err);
if (local_err) {
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index b27b1f441e..18669917f5 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1394,8 +1394,8 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
if (!opts) {
return NULL;
}
- qemu_opt_set(opts, "type", "nic");
- qemu_opt_set(opts, "model", "usb");
+ qemu_opt_set(opts, "type", "nic", &error_abort);
+ qemu_opt_set(opts, "model", "usb", &error_abort);
idx = net_client_init(opts, 0, &local_err);
if (local_err) {
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index af2e1b915d..65d9aa6147 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -683,7 +683,7 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename)
if (strstart(filename, "format=", &p2)) {
int len = MIN(p1 - p2, sizeof(fmt));
pstrcpy(fmt, len, p2);
- qemu_opt_set(opts, "format", fmt);
+ qemu_opt_set(opts, "format", fmt, &error_abort);
} else if (*filename != ':') {
error_report("unrecognized USB mass-storage option %s", filename);
return NULL;
@@ -694,8 +694,8 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename)
error_report("block device specification needed");
return NULL;
}
- qemu_opt_set(opts, "file", filename);
- qemu_opt_set(opts, "if", "none");
+ qemu_opt_set(opts, "file", filename, &error_abort);
+ qemu_opt_set(opts, "if", "none", &error_abort);
/* create host drive */
dinfo = drive_new(opts, 0);
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index c307f9b57e..54440c91c5 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -68,7 +68,7 @@ int select_watchdog(const char *p)
/* add the device */
opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
&error_abort);
- qemu_opt_set(opts, "driver", p);
+ qemu_opt_set(opts, "driver", p, &error_abort);
return 0;
}
}