]> git.proxmox.com Git - mirror_qemu.git/commit
net: hmp_host_net_remove: Del the -net option of the removed host_net
authorShmulik Ladkani <shmulik.ladkani@gmail.com>
Mon, 5 Sep 2016 09:11:02 +0000 (12:11 +0300)
committerJason Wang <jasowang@redhat.com>
Tue, 27 Sep 2016 09:54:21 +0000 (17:54 +0800)
commita4543b1b37dc05be84c7a95751af9d473f5fb41a
tree882380d4604770ca193cba1e5ea37f23b4a64dba
parent1c0fbfa3dedf49115e194e533a7b6a640a28447c
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: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/net.c