51 lines
1.8 KiB
Diff
51 lines
1.8 KiB
Diff
|
|
From 1cc7783df04674ff375905cc9a8ec23f71617408 Mon Sep 17 00:00:00 2001
|
||
|
|
From: qihao <qihao_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Tue, 21 Nov 2023 20:40:24 +0800
|
||
|
|
Subject: [PATCH] net: Fix a misleading error message
|
||
|
|
|
||
|
|
cheery-pick from 0a4a1512e01228fc59b00d68e86f7099b6439773
|
||
|
|
|
||
|
|
The error message
|
||
|
|
|
||
|
|
$ qemu-system-x86_64 -netdev user,id=net0,ipv6-net=fec0::0/
|
||
|
|
qemu-system-x86_64: -netdev user,id=net0,ipv6-net=fec0::0/: Parameter 'ipv6-prefixlen' expects a number
|
||
|
|
|
||
|
|
points to ipv6-prefixlen instead of ipv6-net. Fix:
|
||
|
|
|
||
|
|
qemu-system-x86_64: -netdev user,id=net0,ipv6-net=fec0::0/: parameter 'ipv6-net' expects a number after '/'
|
||
|
|
|
||
|
|
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
||
|
|
Message-ID: <20231031111059.3407803-6-armbru@redhat.com>
|
||
|
|
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
net/net.c | 6 +++---
|
||
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/net/net.c b/net/net.c
|
||
|
|
index ed4b1c1740..daad8784ec 100644
|
||
|
|
--- a/net/net.c
|
||
|
|
+++ b/net/net.c
|
||
|
|
@@ -1122,7 +1122,7 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
|
||
|
|
int ret = -1;
|
||
|
|
Visitor *v = opts_visitor_new(opts);
|
||
|
|
|
||
|
|
- /* Parse convenience option format ip6-net=fec0::0[/64] */
|
||
|
|
+ /* Parse convenience option format ipv6-net=fec0::0[/64] */
|
||
|
|
const char *ip6_net = qemu_opt_get(opts, "ipv6-net");
|
||
|
|
|
||
|
|
if (ip6_net) {
|
||
|
|
@@ -1142,8 +1142,8 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
|
||
|
|
if (substrings[1] &&
|
||
|
|
qemu_strtoul(substrings[1], NULL, 10, &prefix_len))
|
||
|
|
{
|
||
|
|
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
|
||
|
|
- "ipv6-prefixlen", "a number");
|
||
|
|
+ error_setg(errp,
|
||
|
|
+ "parameter 'ipv6-net' expects a number after '/'");
|
||
|
|
goto out;
|
||
|
|
}
|
||
|
|
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|