mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -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
|
@ -578,7 +578,7 @@ int inet_listen(const char *str, char *ostr, int olen,
|
|||
|
||||
addr = inet_parse(str, errp);
|
||||
if (addr != NULL) {
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
inet_addr_to_opts(opts, addr);
|
||||
qapi_free_InetSocketAddress(addr);
|
||||
sock = inet_listen_opts(opts, port_offset, errp);
|
||||
|
@ -617,7 +617,7 @@ int inet_connect(const char *str, Error **errp)
|
|||
|
||||
addr = inet_parse(str, errp);
|
||||
if (addr != NULL) {
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
inet_addr_to_opts(opts, addr);
|
||||
qapi_free_InetSocketAddress(addr);
|
||||
sock = inet_connect_opts(opts, errp, NULL, NULL);
|
||||
|
@ -651,7 +651,7 @@ int inet_nonblocking_connect(const char *str,
|
|||
|
||||
addr = inet_parse(str, errp);
|
||||
if (addr != NULL) {
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
inet_addr_to_opts(opts, addr);
|
||||
qapi_free_InetSocketAddress(addr);
|
||||
sock = inet_connect_opts(opts, errp, callback, opaque);
|
||||
|
@ -794,7 +794,7 @@ int unix_listen(const char *str, char *ostr, int olen, Error **errp)
|
|||
char *path, *optstr;
|
||||
int sock, len;
|
||||
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
|
||||
optstr = strchr(str, ',');
|
||||
if (optstr) {
|
||||
|
@ -822,7 +822,7 @@ int unix_connect(const char *path, Error **errp)
|
|||
QemuOpts *opts;
|
||||
int sock;
|
||||
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
qemu_opt_set(opts, "path", path);
|
||||
sock = unix_connect_opts(opts, errp, NULL, NULL);
|
||||
qemu_opts_del(opts);
|
||||
|
@ -839,7 +839,7 @@ int unix_nonblocking_connect(const char *path,
|
|||
|
||||
g_assert(callback != NULL);
|
||||
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
qemu_opt_set(opts, "path", path);
|
||||
sock = unix_connect_opts(opts, errp, callback, opaque);
|
||||
qemu_opts_del(opts);
|
||||
|
@ -889,7 +889,7 @@ int socket_connect(SocketAddress *addr, Error **errp,
|
|||
QemuOpts *opts;
|
||||
int fd;
|
||||
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
switch (addr->kind) {
|
||||
case SOCKET_ADDRESS_KIND_INET:
|
||||
inet_addr_to_opts(opts, addr->inet);
|
||||
|
@ -921,7 +921,7 @@ int socket_listen(SocketAddress *addr, Error **errp)
|
|||
QemuOpts *opts;
|
||||
int fd;
|
||||
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
switch (addr->kind) {
|
||||
case SOCKET_ADDRESS_KIND_INET:
|
||||
inet_addr_to_opts(opts, addr->inet);
|
||||
|
@ -949,7 +949,7 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
|
|||
QemuOpts *opts;
|
||||
int fd;
|
||||
|
||||
opts = qemu_opts_create_nofail(&socket_optslist);
|
||||
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
|
||||
switch (remote->kind) {
|
||||
case SOCKET_ADDRESS_KIND_INET:
|
||||
qemu_opt_set(opts, "host", remote->inet->host);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue