All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuri Benditovich <yuri.benditovich@daynix.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Yan Vugenfirer <yan@daynix.com>,
	Andrew Melnichenko <andrew@daynix.com>,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH] hmp: Changed hmp_netdev_add() using qmp_marshal_netdev_add()
Date: Sat, 21 Nov 2020 17:31:36 +0200	[thread overview]
Message-ID: <CAOEp5OdiFaCK=Ag8f9oNixhrkW4xoEJ2bXKU7ThXeF9VJXPqTw@mail.gmail.com> (raw)
In-Reply-To: <CAOEp5OfjuR97v0VyyHpXJiZVsU1jMphHh86XwAU4t3Uw1T8Ghg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2274 bytes --]

On Sat, Nov 21, 2020 at 5:24 PM Yuri Benditovich <
yuri.benditovich@daynix.com> wrote:

>
>
> On Fri, Nov 20, 2020 at 2:58 PM Markus Armbruster <armbru@redhat.com>
> wrote:
>
>> Andrew Melnichenko <andrew@daynix.com> writes:
>>
>> > Ping
>> >
>> > On Thu, Jul 16, 2020 at 6:26 AM <andrew@daynix.com> wrote:
>> >
>> >> From: Andrew Melnychenko <andrew@daynix.com>
>> >>
>> >> There is an issue, that netdev can't be removed if it was added using
>> hmp.
>> >> The bug appears after 08712fcb851034228b61f75bd922863a984a4f60 commit.
>> >> It happens because of unclear QemuOpts that was created during
>> >> hmp_netdev_add(), now it uses qmp analog function -
>> >> qmp_marshal_netdev_add().
>> >>
>> >> Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
>> >> ---
>> >>  monitor/hmp-cmds.c | 15 +++------------
>> >>  1 file changed, 3 insertions(+), 12 deletions(-)
>> >>
>> >> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
>> >> index 2b0b58a336..b747935687 100644
>> >> --- a/monitor/hmp-cmds.c
>> >> +++ b/monitor/hmp-cmds.c
>> >> @@ -1597,19 +1597,10 @@ void hmp_migrate(Monitor *mon, const QDict
>> *qdict)
>> >>  void hmp_netdev_add(Monitor *mon, const QDict *qdict)
>> >>  {
>> >>      Error *err = NULL;
>> >> -    QemuOpts *opts;
>> >> -
>> >> -    opts = qemu_opts_from_qdict(qemu_find_opts("netdev"), qdict,
>> &err);
>> >> -    if (err) {
>> >> -        goto out;
>> >> -    }
>> >> +    QDict *non_constant_dict = qdict_clone_shallow(qdict);
>> >>
>> >> -    netdev_add(opts, &err);
>> >> -    if (err) {
>> >> -        qemu_opts_del(opts);
>> >> -    }
>> >> -
>> >> -out:
>> >> +    qmp_marshal_netdev_add(non_constant_dict, NULL, &err);
>> >> +    qobject_unref(non_constant_dict);
>> >>      hmp_handle_error(mon, err);
>> >>  }
>>
>> qmp_marshal_netdev_add() uses the QObject input visitor, which feels
>> wrong for HMP input.
>>
>> What exactly is the problem you're trying to solve?  Can you show us a
>> reproducer?
>>
>> The problem was found during work on hotplug/unplug problems with q35
> run q35 VM with netdev and hotpluggable nic (virtio or e1000e)
> unplug the nic (device_del)
> delete the netdev ()
> add netdev with the same id as before - fail (Duplicated ID)
>
> Q35 is not mandatory for reproduction, the same with '-machine pc'

[-- Attachment #2: Type: text/html, Size: 3634 bytes --]

  reply	other threads:[~2020-11-21 15:32 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 [this message]
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
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='CAOEp5OdiFaCK=Ag8f9oNixhrkW4xoEJ2bXKU7ThXeF9VJXPqTw@mail.gmail.com' \
    --to=yuri.benditovich@daynix.com \
    --cc=andrew@daynix.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yan@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.