提交 a4543b1b 编写于 作者: S Shmulik Ladkani 提交者: Jason Wang

net: hmp_host_net_remove: Del the -net option of the removed host_net

Upon hmp_host_net_remove(), the appropriate -net client is deleted
(according to the given vlan_id and device id), as well as the
corresponsing hub port.

However, the relevant '-net' option that was added by former
hmp_host_net_add() call is still present in "net" options group.

This makes the following legit HMP sequence erroneous:

(qemu) host_net_add tap id=n1,ifname=tap1,script=no,downscript=no,vlan=1
(qemu) host_net_remove 1 n1
(qemu) host_net_add tap id=n1,ifname=tap1,script=no,downscript=no,vlan=1
Duplicate ID 'n1' for net

Fix, by deleting the stored '-net' option associated with the given
device id.
Signed-off-by: NShmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Signed-off-by: NJason Wang <jasowang@redhat.com>
上级 1c0fbfa3
......@@ -1179,6 +1179,7 @@ void hmp_host_net_remove(Monitor *mon, const QDict *qdict)
qemu_del_net_client(nc->peer);
qemu_del_net_client(nc);
qemu_opts_del(qemu_opts_find(qemu_find_opts("net"), device));
}
void netdev_add(QemuOpts *opts, Error **errp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册