net/net: Clean up variable shadowing in net_client_init()
Variable int err in inner scope shadows Error *err in outer scope. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191205174635.18758-3-vsementsov@virtuozzo.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
0cf9e2b4f8
commit
33c9642f65
17
net/net.c
17
net/net.c
@ -1126,16 +1126,13 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
|
|||||||
|
|
||||||
prefix_addr = substrings[0];
|
prefix_addr = substrings[0];
|
||||||
|
|
||||||
if (substrings[1]) {
|
/* Handle user-specified prefix length. */
|
||||||
/* User-specified prefix length. */
|
if (substrings[1] &&
|
||||||
int err;
|
qemu_strtoul(substrings[1], NULL, 10, &prefix_len))
|
||||||
|
{
|
||||||
err = qemu_strtoul(substrings[1], NULL, 10, &prefix_len);
|
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
|
||||||
if (err) {
|
"ipv6-prefixlen", "a number");
|
||||||
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
|
goto out;
|
||||||
"ipv6-prefixlen", "a number");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_opt_set(opts, "ipv6-prefix", prefix_addr, &error_abort);
|
qemu_opt_set(opts, "ipv6-prefix", prefix_addr, &error_abort);
|
||||||
|
Loading…
Reference in New Issue
Block a user