qemu-devel
[Top][All Lists]
Advanced

[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: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] net: synchronize net_host_device_remove with host_net_remove_completion
Date: Fri, 2 Jan 2015 14:06:58 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

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

Attachment: pgpH2GmPDeyl2.pgp
Description: PGP signature


reply via email to

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