aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-04-12 11:58:57 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2012-06-04 13:49:34 -0300
commit299528668c759f40b2cc78914e2ca2c832f82834 (patch)
tree6c908f77a26f5315160ad391933eaf441eafdbf1 /net.c
parent6c5194046a34ff9f84e294d4ef926ec509741493 (diff)
qemu-option: qemu_opts_validate(): use error_set()
net_client_init() propagates the error up by calling qerror_report_err(), because its users expect QError semantics. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-By: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'net.c')
-rw-r--r--net.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net.c b/net.c
index 1922d8abd1..f5d9cc75b8 100644
--- a/net.c
+++ b/net.c
@@ -1136,10 +1136,14 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev)
for (i = 0; i < NET_CLIENT_TYPE_MAX; i++) {
if (net_client_types[i].type != NULL &&
!strcmp(net_client_types[i].type, type)) {
+ Error *local_err = NULL;
VLANState *vlan = NULL;
int ret;
- if (qemu_opts_validate(opts, &net_client_types[i].desc[0]) == -1) {
+ qemu_opts_validate(opts, &net_client_types[i].desc[0], &local_err);
+ if (error_is_set(&local_err)) {
+ qerror_report_err(local_err);
+ error_free(local_err);
return -1;
}