From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPu8p-0004R4-Uf for qemu-devel@nongnu.org; Wed, 10 Apr 2013 08:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPu8o-0002Sk-Gy for qemu-devel@nongnu.org; Wed, 10 Apr 2013 08:28:43 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49824 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPu8o-0002Sb-A6 for qemu-devel@nongnu.org; Wed, 10 Apr 2013 08:28:42 -0400 Message-ID: <51655AF8.40102@suse.de> Date: Wed, 10 Apr 2013 14:28:40 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <20130410120519.GA13514@t430s.nay.redhat.com> In-Reply-To: <20130410120519.GA13514@t430s.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Nic devices' name are wrongly repeated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: Anthony Liguori , Paolo Bonzini , qemu-devel , Stefan Hajnoczi , Gerd Hoffmann Hi, Am 10.04.2013 14:05, schrieb Amos Kong: > If we don't assign 'id' for nic device, device name will be $model.$idx= . The $idx are always 0 if we set nic by new style. >=20 > # qemu-upstream -device virtio-net-pci,netdev=3Dh1 -netdev tap,id=3Dh1 = -device virtio-net-pci,netdev=3Dh2 -netdev tap,id=3Dh2 ... > (qemu) info network > virtio-net-pci.0: index=3D0,type=3Dnic,model=3Dvirtio-net-pci,macaddr=3D= 52:54:00:12:34:56 > \ h1: index=3D0,type=3Dtap,ifname=3Dtap0,script=3D/etc/qemu-ifup,downs= cript=3D/etc/qemu-ifdown > virtio-net-pci.0: index=3D0,type=3Dnic,model=3Dvirtio-net-pci,macaddr=3D= 52:54:00:12:34:57 > \ h2: index=3D0,type=3Dtap,ifname=3Dtap1,script=3D/etc/qemu-ifup,downs= cript=3D/etc/qemu-ifdown >=20 > it's introduced by commit d33d93b2 I can see that's inconvenient, but... > If we set links down by 'set_link virtio-net-pci.0', the first nic > will be set down. But how to set the second link down by id? As you would do for all devices? I.e., add ,id=3Dyouruniqueid to -device. Having said that, in a different context (USB) I was made aware that we don't know the bus name at QOM initialization time yet and, if we want to create a bus at that point, will need to rename it later. Thus we'd need an overridable ID setter hook to propagate to busses, and if we had such a settable ID property it would be convenient for your use case to have a matching monitor command as well to be able to resolve name conflicts at runtime rather than with a QEMU restart. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg