All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hmp: Changed hmp_netdev_add() using qmp_marshal_netdev_add()
@ 2020-07-16  3:55 andrew
  2020-11-20 11:05 ` Andrew Melnichenko
  0 siblings, 1 reply; 22+ messages in thread
From: andrew @ 2020-07-16  3:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: dgilbert

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);
 }
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-11-25 10:28 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.