net: Fix '-net nic,model=' for non-help arguments
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 6 Aug 2024 17:21:37 +0000 (18:21 +0100)
committerJason Wang <jasowang@redhat.com>
Mon, 12 Aug 2024 05:36:42 +0000 (13:36 +0800)
Oops, don't *delete* the model option when checking for 'help'.

Fixes: 64f75f57f9d2 ("net: Reinstate '-net nic, model=help' output as documented in man page")
Reported-by: Hans <sungdgdhtryrt@gmail.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/net.c

index 2eb8bc9c0b9f38653fa91598c4eee7d8390c2246..fc1125111ca0597a5524433d08d7d14d7d965ebf 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1737,7 +1737,7 @@ void net_check_clients(void)
 
 static int net_init_client(void *dummy, QemuOpts *opts, Error **errp)
 {
-    const char *model = qemu_opt_get_del(opts, "model");
+    const char *model = qemu_opt_get(opts, "model");
 
     if (is_nic_model_help_option(model)) {
         return 0;