mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
6c5194046a
commit
299528668c
3 changed files with 11 additions and 10 deletions
6
net.c
6
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue