qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 3/7] net: Check device passed to host_net_remove


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH 3/7] net: Check device passed to host_net_remove
Date: Wed, 15 Apr 2009 16:04:12 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Mark McLoughlin wrote:
> On Tue, 2009-04-14 at 19:29 +0200, Jan Kiszka wrote:
>> Make sure that we do not delete guest NICs via host_net_remove.
>>
>> Signed-off-by: Jan Kiszka <address@hidden>
>> ---
>>
>>  net.c |   11 +++++++++--
>>  1 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/net.c b/net.c
>> index 36c0509..787f249 100644
>> --- a/net.c
>> +++ b/net.c
>> @@ -1861,9 +1861,16 @@ void net_host_device_remove(Monitor *mon, int 
>> vlan_id, const char *device)
>>          return;
>>      }
>>  
>> -   for(vc = vlan->first_client; vc != NULL; vc = vc->next)
>> -        if (!strcmp(vc->name, device))
>> +    if (!net_host_check_device(device)) {
>> +        monitor_printf(mon, "invalid host network device %s\n", device);
>> +        return;
>> +    }
> 
> Doesn't this mean that if you assign a name with e.g. "name=foo1234" you
> won't be able to remove it?

Good point.

> 
> Probably makes more sense to find the client, then check vc->model using
> net_host_check_device()?

Yes, will fix.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux




reply via email to

[Prev in Thread] Current Thread [Next in Thread]