[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] net: synchronize net_host_device_remove with ho
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] net: synchronize net_host_device_remove with host_net_remove_completion |
Date: |
Fri, 02 Jan 2015 17:20:14 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 02/01/2015 15:06, Stefan Hajnoczi wrote:
> On Tue, Dec 23, 2014 at 05:53:20PM +0100, Paolo Bonzini wrote:
>> @@ -324,6 +324,8 @@ void qemu_del_net_client(NetClientState *nc)
>> NetClientState *ncs[MAX_QUEUE_NUM];
>> int queues, i;
>>
>> + assert(nc->info->type != NET_CLIENT_OPTIONS_KIND_NIC);
>> +
>> /* If the NetClientState belongs to a multiqueue backend, we will
>> change all
>> * other NetClientStates also.
>> */
>> @@ -355,8 +357,6 @@ void qemu_del_net_client(NetClientState *nc)
>> return;
>> }
>>
>> - assert(nc->info->type != NET_CLIENT_OPTIONS_KIND_NIC);
>> -
>> for (i = 0; i < queues; i++) {
>> qemu_cleanup_net_client(ncs[i]);
>> qemu_free_net_client(ncs[i]);
>
> The assert can be dropped completely since the code already has an
> equivalent assert:
>
> queues = qemu_find_net_clients_except(nc->name, ncs,
> NET_CLIENT_OPTIONS_KIND_NIC,
> MAX_QUEUE_NUM);
> assert(queues != 0); <-- fail if type == NET_CLIENT_OPTIONS_KIND_NIC
I left it on purpose for documentation, but I'll send v2 next week that
removes it.
Paolo