* [Qemu-devel] [PATCH] host_device_remove: remove incorrect check for device name
@ 2009-03-19 16:11 Eduardo Habkost
  2009-03-19 20:16 ` Marcelo Tosatti
  2009-03-28 15:59 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Eduardo Habkost @ 2009-03-19 16:11 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel
There is no need to check for valid prefixes on the the device name
when removing it. If the device name is found on the vlan client list,
it can be removed, regardless of the prefix used on its name.
To reproduce the bug, just run this on the monitor:
 (qemu) host_net_add user name=foobar
 (qemu) host_net_remove 0 foobar
 invalid host network device foobar
 (qemu)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 net.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/net.c b/net.c
index c853daf..395ee4f 100644
--- a/net.c
+++ b/net.c
@@ -1822,11 +1822,6 @@ void net_host_device_remove(Monitor *mon, int vlan_id, const char *device)
     VLANState *vlan;
     VLANClientState *vc;
 
-    if (!net_host_check_device(device)) {
-        monitor_printf(mon, "invalid host network device %s\n", device);
-        return;
-    }
-
     vlan = qemu_find_vlan(vlan_id);
     if (!vlan) {
         monitor_printf(mon, "can't find vlan %d\n", vlan_id);
-- 
1.6.1
^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] host_device_remove: remove incorrect check for device name
  2009-03-19 16:11 [Qemu-devel] [PATCH] host_device_remove: remove incorrect check for device name Eduardo Habkost
@ 2009-03-19 20:16 ` Marcelo Tosatti
  2009-03-28 15:59 ` [Qemu-devel] " Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2009-03-19 20:16 UTC (permalink / raw)
  To: qemu-devel
ACK, thanks Eduardo.
On Thu, Mar 19, 2009 at 01:11:07PM -0300, Eduardo Habkost wrote:
> There is no need to check for valid prefixes on the the device name
> when removing it. If the device name is found on the vlan client list,
> it can be removed, regardless of the prefix used on its name.
> 
> To reproduce the bug, just run this on the monitor:
> 
>  (qemu) host_net_add user name=foobar
>  (qemu) host_net_remove 0 foobar
>  invalid host network device foobar
>  (qemu)
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  net.c |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
> 
> diff --git a/net.c b/net.c
> index c853daf..395ee4f 100644
> --- a/net.c
> +++ b/net.c
> @@ -1822,11 +1822,6 @@ void net_host_device_remove(Monitor *mon, int vlan_id, const char *device)
>      VLANState *vlan;
>      VLANClientState *vc;
>  
> -    if (!net_host_check_device(device)) {
> -        monitor_printf(mon, "invalid host network device %s\n", device);
> -        return;
> -    }
> -
>      vlan = qemu_find_vlan(vlan_id);
>      if (!vlan) {
>          monitor_printf(mon, "can't find vlan %d\n", vlan_id);
> -- 
> 1.6.1
> 
> 
^ permalink raw reply	[flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [PATCH] host_device_remove: remove incorrect check for device name
  2009-03-19 16:11 [Qemu-devel] [PATCH] host_device_remove: remove incorrect check for device name Eduardo Habkost
  2009-03-19 20:16 ` Marcelo Tosatti
@ 2009-03-28 15:59 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2009-03-28 15:59 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: qemu-devel
Eduardo Habkost wrote:
> There is no need to check for valid prefixes on the the device name
> when removing it. If the device name is found on the vlan client list,
> it can be removed, regardless of the prefix used on its name.
>
> To reproduce the bug, just run this on the monitor:
>
>  (qemu) host_net_add user name=foobar
>  (qemu) host_net_remove 0 foobar
>  invalid host network device foobar
>  (qemu)
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>   
Applied to stable and trunk.  Thanks.
Regards,
Anthony Liguori
> ---
>  net.c |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/net.c b/net.c
> index c853daf..395ee4f 100644
> --- a/net.c
> +++ b/net.c
> @@ -1822,11 +1822,6 @@ void net_host_device_remove(Monitor *mon, int vlan_id, const char *device)
>      VLANState *vlan;
>      VLANClientState *vc;
>  
> -    if (!net_host_check_device(device)) {
> -        monitor_printf(mon, "invalid host network device %s\n", device);
> -        return;
> -    }
> -
>      vlan = qemu_find_vlan(vlan_id);
>      if (!vlan) {
>          monitor_printf(mon, "can't find vlan %d\n", vlan_id);
>   
^ permalink raw reply	[flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-28 15:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-19 16:11 [Qemu-devel] [PATCH] host_device_remove: remove incorrect check for device name Eduardo Habkost
2009-03-19 20:16 ` Marcelo Tosatti
2009-03-28 15:59 ` [Qemu-devel] " Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).