diff mbox series

net: Fix '-net nic,model=' for non-help arguments

Message ID c5f7438e2e0c40b0f89030de1096335f5704d3a5.camel@infradead.org
State New
Headers show
Series net: Fix '-net nic,model=' for non-help arguments | expand

Commit Message

David Woodhouse Aug. 6, 2024, 5:21 p.m. UTC
From: David Woodhouse <dwmw@amazon.co.uk>

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
---
This whole mess of alternative command line options could really do
with some self tests. And maybe removing half of them. Three ways of
doing the same thing ought to suffice.

 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Tokarev Aug. 11, 2024, 7:39 a.m. UTC | #1
06.08.2024 20:21, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> 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>

Please pick this one up to master as a bugfix (Cc'ing rth), or send a pullreq soon :)

Thanks,

/mjt

> ---
> This whole mess of alternative command line options could really do
> with some self tests. And maybe removing half of them. Three ways of
> doing the same thing ought to suffice.
> 
>   net/net.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/net.c b/net/net.c
> index 2eb8bc9c0b..fc1125111c 100644
> --- 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;
Jason Wang Aug. 12, 2024, 7:29 a.m. UTC | #2
On Sun, Aug 11, 2024 at 3:40 PM Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> 06.08.2024 20:21, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@amazon.co.uk>
> >
> > 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>
>
> Please pick this one up to master as a bugfix (Cc'ing rth), or send a pullreq soon :)
>
> Thanks,
>
> /mjt

I've just sent a pullreq.

Thanks
diff mbox series

Patch

diff --git a/net/net.c b/net/net.c
index 2eb8bc9c0b..fc1125111c 100644
--- 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;