From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51998 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OK3tH-00063n-HO for qemu-devel@nongnu.org; Thu, 03 Jun 2010 02:26:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OK3tF-0004dQ-TY for qemu-devel@nongnu.org; Thu, 03 Jun 2010 02:26:55 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:40612) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OK3tF-0004dC-I8 for qemu-devel@nongnu.org; Thu, 03 Jun 2010 02:26:53 -0400 Message-ID: <4C074B2C.60304@web.de> Date: Thu, 03 Jun 2010 08:26:52 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] qdev: Reject duplicate and anti-social device IDs References: <3715da16813f7cdcb7ec023167a84a94e8a37089.1274612367.git.jan.kiszka@web.de> <4C021ED5.1080703@redhat.com> <4C038882.3080007@redhat.com> <20100601100434.380c6ab3@redhat.com> <20100601114920.1afb505a@redhat.com> <4C055755.7060309@codemonkey.ws> In-Reply-To: <4C055755.7060309@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig812709713168F57A1586BC2E" Sender: jan.kiszka@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Juan Quintela , Jan Kiszka , qemu-devel@nongnu.org, Markus Armbruster , Blue Swirl , Gerd Hoffmann , Luiz Capitulino , Avi Kivity This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig812709713168F57A1586BC2E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > On 06/01/2010 01:35 PM, Markus Armbruster wrote: >> Luiz Capitulino writes: >> >> =20 >>> On Tue, 01 Jun 2010 16:44:24 +0200 >>> Markus Armbruster wrote: >>> >>> =20 >>>> Luiz Capitulino writes: >>>> >>>> =20 >>>>> On Mon, 31 May 2010 16:13:12 +0200 >>>>> Markus Armbruster wrote: >>>>> >>>>> =20 >>>>>> We need Device IDs to be unique and not contain '/' so device tree= >>>>>> nodes can always be unambigously referenced by tree path. >>>>>> >>>>>> We already have some protection against duplicate IDs, but it got >>>>>> holes: >>>>>> >>>>>> * We don't assign IDs to default devices. >>>>>> >>>>>> * -device and device_add use the ID of a qemu_device_opts. Which >>>>>> rejects duplicate IDs. >>>>>> >>>>>> * pci_add nic -net use either the ID or option "name" of >>>>>> qemu_net_opts. And there's our hole. Reproducible with "-net >>>>>> user >>>>>> -net nic,id=3Dfoo -device lsi,id=3Dfoo". >>>>>> =20 >>>>> Two bugs that might not be related to this thread: >>>>> >>>>> * "id" member is not mandatory for the device_add command: >>>>> >>>>> { "execute": "device_add", "arguments": { "driver": "e1000" } = } >>>>> {"return": {}} >>>>> =20 >>>> Works as designed. >>>> =20 >>> What about netdev_add? >>> >>> { "execute": "netdev_add", "arguments": { "type": "user" } } >>> {"error": {"class": "MissingParameter", "desc": "Parameter 'id' is >>> missing", "data": {"name": "id"}}} >>> =20 >> The only way to put a netdev to use is connecting it to a NIC with >> -device DRIVER,netdev=3DID,... And that requires an ID. >> =20 >=20 > To be honest, I think we should universally require an id parameter or > we should auto-assign one and return it during creation. >=20 > Implicit/Null ids with QemuOpts are really difficult to work with and i= t > certainly makes device addressing a lot easier. I really see no need for this additional burden. We always have unique qtree paths for devices. Jan --------------enig812709713168F57A1586BC2E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkwHSywACgkQitSsb3rl5xSGwwCfdJFQ1ugw1NoLWwFGCpm7TuUK wToAoKMiQ2LM+xaJW5cvAFRLOUWBxE6v =Vtz6 -----END PGP SIGNATURE----- --------------enig812709713168F57A1586BC2E--