All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net: hmp_host_net_remove: Del the -net option of the removed host_net
@ 2016-09-05  9:11 Shmulik Ladkani
  2016-09-12 18:49 ` Shmulik Ladkani
  2016-09-21 23:49 ` Jason Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Shmulik Ladkani @ 2016-09-05  9:11 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel, idan.brown, Shmulik Ladkani

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>
---
 net/net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/net.c b/net/net.c
index d51cb29882..0bec096d75 100644
--- a/net/net.c
+++ b/net/net.c
@@ -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)
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH] net: hmp_host_net_remove: Del the -net option of the removed host_net
  2016-09-05  9:11 [Qemu-devel] [PATCH] net: hmp_host_net_remove: Del the -net option of the removed host_net Shmulik Ladkani
@ 2016-09-12 18:49 ` Shmulik Ladkani
  2016-09-21 23:49 ` Jason Wang
  1 sibling, 0 replies; 3+ messages in thread
From: Shmulik Ladkani @ 2016-09-12 18:49 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel, idan.brown, Shmulik Ladkani

On Mon,  5 Sep 2016 12:11:02 +0300 Shmulik Ladkani <shmulik.ladkani@gmail.com> wrote:
> 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>

ping?

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

* Re: [Qemu-devel] [PATCH] net: hmp_host_net_remove: Del the -net option of the removed host_net
  2016-09-05  9:11 [Qemu-devel] [PATCH] net: hmp_host_net_remove: Del the -net option of the removed host_net Shmulik Ladkani
  2016-09-12 18:49 ` Shmulik Ladkani
@ 2016-09-21 23:49 ` Jason Wang
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Wang @ 2016-09-21 23:49 UTC (permalink / raw)
  To: Shmulik Ladkani; +Cc: qemu-devel, idan.brown, Shmulik Ladkani



On 2016年09月05日 17:11, Shmulik Ladkani wrote:
> 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>
> ---
>   net/net.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/net/net.c b/net/net.c
> index d51cb29882..0bec096d75 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -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)

Applied, thanks.

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

end of thread, other threads:[~2016-09-21 23:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-05  9:11 [Qemu-devel] [PATCH] net: hmp_host_net_remove: Del the -net option of the removed host_net Shmulik Ladkani
2016-09-12 18:49 ` Shmulik Ladkani
2016-09-21 23:49 ` Jason Wang

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.