All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>,
	Andrew Melnichenko <andrew@daynix.com>
Cc: Yan Vugenfirer <yan@daynix.com>,
	Yuri Benditovich <yuri.benditovich@daynix.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] hmp: Changed hmp_netdev_add() using qmp_marshal_netdev_add()
Date: Mon, 23 Nov 2020 08:32:53 -0600	[thread overview]
Message-ID: <52abb089-f5e2-a3a6-bf38-71ec76b4f3fc@redhat.com> (raw)
In-Reply-To: <87lfesv2zu.fsf@dusky.pond.sub.org>

On 11/23/20 3:25 AM, Markus Armbruster wrote:

>> Its still actual bug - I've checked it with the
>> master(2c6605389c1f76973d92b69b85d40d94b8f1092c).
> 
> I can see this with an even simpler reproducer:
> 
>     $ qemu-system-x86_64 -S -display none -nodefaults -monitor stdio
>     QEMU 5.1.92 monitor - type 'help' for more information
>     (qemu) netdev_add user,id=net0
>     (qemu) info network
>     net0: index=0,type=user,net=10.0.2.0,restrict=off
>     (qemu) netdev_del net0
>     (qemu) info network
>     (qemu) netdev_add user,id=net0
>     upstream-qemu: Duplicate ID 'net0' for netdev
>     Try "help netdev_add" for more information
> 
> The appended patch fixes it for me.  It relies on nothing using the
> "netdev" QemuOpts anymore.  Eric, what do you think?

Makes sense to me.  My quick audit for qemu_find_opts("netdev") finds only:

monitor/hmp-cmds.c:    opts =
qemu_opts_from_qdict(qemu_find_opts("netdev"), qdict, &err);

net/net.c:    if (qemu_opts_foreach(qemu_find_opts("netdev"),

softmmu/vl.c:                if
(net_client_parse(qemu_find_opts("netdev"), optarg) == -1) {

where the latter two are related (we gather the command line opts, and
initialize net devs based on them, but never refer to those opts again),
and the first is the one you are proposing to change.


> 
> 
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index a6a6684df1..8bc6b7bcc6 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -1638,9 +1638,7 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict)
>      }
>  
>      netdev_add(opts, &err);
> -    if (err) {
> -        qemu_opts_del(opts);
> -    }
> +    qemu_opts_del(opts);
>  
>  out:
>      hmp_handle_error(mon, err);
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2020-11-23 14:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  3:55 [PATCH] hmp: Changed hmp_netdev_add() using qmp_marshal_netdev_add() andrew
2020-11-20 11:05 ` Andrew Melnichenko
2020-11-20 12:58   ` Markus Armbruster
2020-11-21 15:24     ` Yuri Benditovich
2020-11-21 15:31       ` Yuri Benditovich
2020-11-22 10:17         ` Andrew Melnichenko
2020-11-22 16:16           ` Yuri Benditovich
2020-11-23  9:25           ` Markus Armbruster
2020-11-23 14:32             ` Eric Blake [this message]
2020-11-23 15:35             ` Yuri Benditovich
2020-11-23 21:57               ` Yuri Benditovich
2020-11-24  8:55               ` Markus Armbruster
2020-11-24 10:21                 ` Markus Armbruster
2020-11-24 11:36                   ` Yuri Benditovich
2020-11-24 13:22                     ` Markus Armbruster
2020-11-24 13:36                       ` Markus Armbruster
2020-11-24 14:03                         ` Yuri Benditovich
2020-11-24 15:45                           ` Markus Armbruster
2020-11-25  8:54                             ` Yuri Benditovich
2020-11-25 10:27                               ` Markus Armbruster
2020-11-24 14:49                         ` Eric Blake
2020-11-24 15:32                           ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52abb089-f5e2-a3a6-bf38-71ec76b4f3fc@redhat.com \
    --to=eblake@redhat.com \
    --cc=andrew@daynix.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yan@daynix.com \
    --cc=yuri.benditovich@daynix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.