mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
qemu-option: Remove qemu_opts_create_nofail
This is a boiler-plate _nofail variant of qemu_opts_create. Remove and use error_abort in call sites. null/0 arguments needs to be added for the id and fail_if_exists fields in affected callsites due to argument inconsistency between the normal and no_fail variants. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
00b8105324
commit
87ea75d5e1
21 changed files with 42 additions and 44 deletions
15
vl.c
15
vl.c
|
@ -545,7 +545,7 @@ QemuOpts *qemu_get_machine_opts(void)
|
|||
assert(list);
|
||||
opts = qemu_opts_find(list, NULL);
|
||||
if (!opts) {
|
||||
opts = qemu_opts_create_nofail(list);
|
||||
opts = qemu_opts_create(list, NULL, 0, &error_abort);
|
||||
}
|
||||
return opts;
|
||||
}
|
||||
|
@ -2255,7 +2255,8 @@ static int balloon_parse(const char *arg)
|
|||
return -1;
|
||||
} else {
|
||||
/* create empty opts */
|
||||
opts = qemu_opts_create_nofail(qemu_find_opts("device"));
|
||||
opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
||||
&error_abort);
|
||||
}
|
||||
qemu_opt_set(opts, "driver", "virtio-balloon");
|
||||
return 0;
|
||||
|
@ -2515,14 +2516,14 @@ static int virtcon_parse(const char *devname)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
bus_opts = qemu_opts_create_nofail(device);
|
||||
bus_opts = qemu_opts_create(device, NULL, 0, &error_abort);
|
||||
if (arch_type == QEMU_ARCH_S390X) {
|
||||
qemu_opt_set(bus_opts, "driver", "virtio-serial-s390");
|
||||
} else {
|
||||
qemu_opt_set(bus_opts, "driver", "virtio-serial-pci");
|
||||
}
|
||||
|
||||
dev_opts = qemu_opts_create_nofail(device);
|
||||
dev_opts = qemu_opts_create(device, NULL, 0, &error_abort);
|
||||
qemu_opt_set(dev_opts, "driver", "virtconsole");
|
||||
|
||||
snprintf(label, sizeof(label), "virtcon%d", index);
|
||||
|
@ -3382,7 +3383,8 @@ int main(int argc, char **argv, char **envp)
|
|||
|
||||
qemu_opt_set_bool(fsdev, "readonly",
|
||||
qemu_opt_get_bool(opts, "readonly", 0));
|
||||
device = qemu_opts_create_nofail(qemu_find_opts("device"));
|
||||
device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
||||
&error_abort);
|
||||
qemu_opt_set(device, "driver", "virtio-9p-pci");
|
||||
qemu_opt_set(device, "fsdev",
|
||||
qemu_opt_get(opts, "mount_tag"));
|
||||
|
@ -3402,7 +3404,8 @@ int main(int argc, char **argv, char **envp)
|
|||
}
|
||||
qemu_opt_set(fsdev, "fsdriver", "synth");
|
||||
|
||||
device = qemu_opts_create_nofail(qemu_find_opts("device"));
|
||||
device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
||||
&error_abort);
|
||||
qemu_opt_set(device, "driver", "virtio-9p-pci");
|
||||
qemu_opt_set(device, "fsdev", "v_synth");
|
||||
qemu_opt_set(device, "mount_tag", "v_synth");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue