From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y74xd-0002n3-MS for qemu-devel@nongnu.org; Fri, 02 Jan 2015 11:20:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y74xY-0004Lc-He for qemu-devel@nongnu.org; Fri, 02 Jan 2015 11:20:25 -0500 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:38551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y74xY-0004LS-BB for qemu-devel@nongnu.org; Fri, 02 Jan 2015 11:20:20 -0500 Received: by mail-we0-f178.google.com with SMTP id p10so4674526wes.37 for ; Fri, 02 Jan 2015 08:20:19 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54A6C53E.3050905@redhat.com> Date: Fri, 02 Jan 2015 17:20:14 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1419353600-30519-2-git-send-email-pbonzini@redhat.com> <20150102140658.GL10823@stefanha-thinkpad.redhat.com> In-Reply-To: <20150102140658.GL10823@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] net: synchronize net_host_device_remove with host_net_remove_completion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, stefanha@redhat.com 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