summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-03-13 11:07:24 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-06-08 19:33:20 +0200
commita4c7367f7dd9348f94dc4298571ed515b8160a27 (patch)
treec2b07e89034639213052178832ed3b1e24bb4ac7 /net
parent8122928a52248e28513c79d9b9929c6d20c866ea (diff)
downloadhqemu-a4c7367f7dd9348f94dc4298571ed515b8160a27.zip
hqemu-a4c7367f7dd9348f94dc4298571ed515b8160a27.tar.gz
QemuOpts: Drop qemu_opts_foreach() parameter abort_on_failure
When the argument is non-zero, qemu_opts_foreach() stops on callback returning non-zero, and returns that value. When the argument is zero, it doesn't stop, and returns the bit-wise inclusive or of all the return values. Funky :) The callers that pass zero could just as well pass one, because their callbacks can't return anything but zero: * qemu_add_globals()'s callback qdev_add_one_global() * qemu_config_write()'s callback config_write_opts() * main()'s callbacks default_driver_check(), drive_enable_snapshot(), vnc_init_func() Drop the parameter, and always stop. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/net.c5
-rw-r--r--net/vhost-user.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/net/net.c b/net/net.c
index db6be12..011de59 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1373,10 +1373,11 @@ int net_init_clients(void)
QTAILQ_INIT(&net_clients);
- if (qemu_opts_foreach(qemu_find_opts("netdev"), net_init_netdev, NULL, 1) == -1)
+ if (qemu_opts_foreach(qemu_find_opts("netdev"), net_init_netdev, NULL)) {
return -1;
+ }
- if (qemu_opts_foreach(net, net_init_client, NULL, 1) == -1) {
+ if (qemu_opts_foreach(net, net_init_client, NULL)) {
return -1;
}
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 8d26728..f1a15ce 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -245,7 +245,7 @@ int net_init_vhost_user(const NetClientOptions *opts, const char *name,
/* verify net frontend */
if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,
- (char *)name, true) == -1) {
+ (char *)name)) {
return -1;
}
OpenPOWER on IntegriCloud