aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/net/virtio-net.c5
-rw-r--r--hw/smbios/smbios.c24
2 files changed, 10 insertions, 19 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 1596cb1..48b07eb 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3137,9 +3137,8 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp)
}
qdev_set_parent_bus(n->primary_dev, n->primary_bus);
n->primary_should_be_hidden = false;
- qemu_opt_set_bool(n->primary_device_opts,
- "partially_hotplugged", true, &err);
- if (err) {
+ if (!qemu_opt_set_bool(n->primary_device_opts,
+ "partially_hotplugged", true, &err)) {
goto out;
}
hotplug_ctrl = qdev_get_hotplug_handler(n->primary_dev);
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index ffd9872..87afcf9 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -964,8 +964,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
int size;
struct smbios_table *table; /* legacy mode only */
- qemu_opts_validate(opts, qemu_smbios_file_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_file_opts, &err)) {
error_propagate(errp, err);
return;
}
@@ -1051,8 +1050,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
switch (type) {
case 0:
- qemu_opts_validate(opts, qemu_smbios_type0_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_type0_opts, &err)) {
error_propagate(errp, err);
return;
}
@@ -1071,8 +1069,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
}
return;
case 1:
- qemu_opts_validate(opts, qemu_smbios_type1_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_type1_opts, &err)) {
error_propagate(errp, err);
return;
}
@@ -1093,8 +1090,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
}
return;
case 2:
- qemu_opts_validate(opts, qemu_smbios_type2_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_type2_opts, &err)) {
error_propagate(errp, err);
return;
}
@@ -1106,8 +1102,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
save_opt(&type2.location, opts, "location");
return;
case 3:
- qemu_opts_validate(opts, qemu_smbios_type3_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_type3_opts, &err)) {
error_propagate(errp, err);
return;
}
@@ -1118,8 +1113,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
save_opt(&type3.sku, opts, "sku");
return;
case 4:
- qemu_opts_validate(opts, qemu_smbios_type4_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_type4_opts, &err)) {
error_propagate(errp, err);
return;
}
@@ -1131,16 +1125,14 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
save_opt(&type4.part, opts, "part");
return;
case 11:
- qemu_opts_validate(opts, qemu_smbios_type11_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_type11_opts, &err)) {
error_propagate(errp, err);
return;
}
save_opt_list(&type11.nvalues, &type11.values, opts, "value");
return;
case 17:
- qemu_opts_validate(opts, qemu_smbios_type17_opts, &err);
- if (err) {
+ if (!qemu_opts_validate(opts, qemu_smbios_type17_opts, &err)) {
error_propagate(errp, err);
return;
}