diff options
author | Laurent Vivier <lvivier@redhat.com> | 2022-10-21 11:09:08 +0200 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2022-10-28 13:28:52 +0800 |
commit | 21fccb2cbbacdc045f19605915e847de31ca9862 (patch) | |
tree | e8c5b73130b820a6713e0c21ed57cea2b72caf92 /softmmu | |
parent | d63ef17bfcba1126df6bfcb7bca64c96ac4a8d99 (diff) |
net: simplify net_client_parse() error management
All net_client_parse() callers exit in case of error.
Move exit(1) to net_client_parse() and remove error checking from
the callers.
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/vl.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c index a4ae131e4d..e69aa43de4 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2801,21 +2801,15 @@ void qemu_init(int argc, char **argv) break; case QEMU_OPTION_netdev: default_net = 0; - if (net_client_parse(qemu_find_opts("netdev"), optarg) == -1) { - exit(1); - } + net_client_parse(qemu_find_opts("netdev"), optarg); break; case QEMU_OPTION_nic: default_net = 0; - if (net_client_parse(qemu_find_opts("nic"), optarg) == -1) { - exit(1); - } + net_client_parse(qemu_find_opts("nic"), optarg); break; case QEMU_OPTION_net: default_net = 0; - if (net_client_parse(qemu_find_opts("net"), optarg) == -1) { - exit(1); - } + net_client_parse(qemu_find_opts("net"), optarg); break; #ifdef CONFIG_LIBISCSI case QEMU_OPTION_iscsi: |