Received: from eggs.gnu.org ([2001:4830:134:3::10]:59748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJjMn-0003uU-TJ for qemu-devel@nongnu.org; Fri, 06 Feb 2015 08:54:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJjMi-0007aU-Uy for qemu-devel@nongnu.org; Fri, 06 Feb 2015 08:54:41 -0500 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:56662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJjMi-0007aM-OV for qemu-devel@nongnu.org; Fri, 06 Feb 2015 08:54:36 -0500 Received: by mail-we0-f173.google.com with SMTP id w55so2288050wes.4 for ; Fri, 06 Feb 2015 05:54:36 -0800 (PST) Date: Fri, 6 Feb 2015 13:54:33 +0000 From: Stefan Hajnoczi Message-ID: <20150206135433.GB18729@stefanha-thinkpad.redhat.com> References: <1419353600-30519-2-git-send-email-pbonzini@redhat.com> <20150102140658.GL10823@stefanha-thinkpad.redhat.com> <54A6C53E.3050905@redhat.com> <54BCEA0F.8070707@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Content-Disposition: inline In-Reply-To: <54BCEA0F.8070707@redhat.com> 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: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@redhat.com --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 19, 2015 at 12:27:11PM +0100, Paolo Bonzini wrote: > On 02/01/2015 17:20, Paolo Bonzini wrote: > >> >=20 > >> > The assert can be dropped completely since the code already has an > >> > equivalent assert: > >> >=20 > >> > queues =3D qemu_find_net_clients_except(nc->name, ncs, > >> > NET_CLIENT_OPTIONS_KIND_NIC, > >> > MAX_QUEUE_NUM); > >> > assert(queues !=3D 0); <-- fail if type =3D=3D NET_CLIENT_OPTIONS_= KIND_NIC > > I left it on purpose for documentation, but I'll send v2 next week that > > removes it. >=20 > Actually it's not the same. If you have "-netdev user,id=3De1000 -device > e1000,netdev=3De1000" you will be able to call qemu_del_net_client on the > NIC, and it will _not_ fail if the assertion is removed. I don't follow. If you call qemu_del_net_client(e1000_nic) then qemu_find_net_clients_except(nc->name, ncs, NET_CLIENT_OPTIONS_KIND_NIC, MAX_QUEUE_NUM) returns 0. This causes the assert(queues !=3D 0) to fail. Can you explain the scenario? Stefan --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU1MeZAAoJEJykq7OBq3PIOZwH/jyGWzYpjN4DKZL1fHWM3Rbw rxBniUKPoGVL32eg0sk2b4X4CmT4qDqz7dsoCWoBa9rK2JB6ujTgBx4WoDAalH7J ZYcl6JPN3EUpJIREoM07gokim2vES3t+65aDyagDYeHLFNcAlv1/jXfesxsuyUXF +fcHbPKAjBug600enWQnsEgTqwTX+eot6Ny7on7B7GL9mfSeKygU5FMFXjcSGxOo UQ1EFmcjhP3HVgJXA6E2xqD4ylCY0/WBMfH0bxZj6SsSm7t/TSQTV1ao0Pqe2N8A 7YEKzaiXcL2c8vzpLNlTZTSoah1Y11XzCUnIav+z9GYnTsjEwoZxysrxRV5J0sw= =OY7F -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o--