mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
QemuOpts: Convert qemu_opts_foreach() to Error
Retain the function value for now, to permit selective conversion of its callers. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
a4c7367f7d
commit
28d0de7a4f
12 changed files with 72 additions and 54 deletions
|
@ -1329,7 +1329,7 @@ void net_check_clients(void)
|
|||
}
|
||||
}
|
||||
|
||||
static int net_init_client(QemuOpts *opts, void *dummy)
|
||||
static int net_init_client(void *dummy, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
|
||||
|
@ -1342,7 +1342,7 @@ static int net_init_client(QemuOpts *opts, void *dummy)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int net_init_netdev(QemuOpts *opts, void *dummy)
|
||||
static int net_init_netdev(void *dummy, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
@ -1373,11 +1373,12 @@ int net_init_clients(void)
|
|||
|
||||
QTAILQ_INIT(&net_clients);
|
||||
|
||||
if (qemu_opts_foreach(qemu_find_opts("netdev"), net_init_netdev, NULL)) {
|
||||
if (qemu_opts_foreach(qemu_find_opts("netdev"),
|
||||
net_init_netdev, NULL, NULL)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (qemu_opts_foreach(net, net_init_client, NULL)) {
|
||||
if (qemu_opts_foreach(net, net_init_client, NULL, NULL)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ static CharDriverState *net_vhost_parse_chardev(const NetdevVhostUserOptions *op
|
|||
return chr;
|
||||
}
|
||||
|
||||
static int net_vhost_check_net(QemuOpts *opts, void *opaque)
|
||||
static int net_vhost_check_net(void *opaque, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
const char *name = opaque;
|
||||
const char *driver, *netdev;
|
||||
|
@ -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)) {
|
||||
(char *)name, NULL)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue