Received: from eggs.gnu.org ([208.118.235.92]:45448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USlRA-0000tv-PU for qemu-devel@nongnu.org; Thu, 18 Apr 2013 05:47:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USlR8-0007pq-UW for qemu-devel@nongnu.org; Thu, 18 Apr 2013 05:47:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USlR8-0007pO-Mr for qemu-devel@nongnu.org; Thu, 18 Apr 2013 05:47:26 -0400 Date: Thu, 18 Apr 2013 17:47:16 +0800 From: Amos Kong Message-ID: <20130418094716.GA11317@t430s.nay.redhat.com> References: <20130410120519.GA13514@t430s.nay.redhat.com> <51655AF8.40102@suse.de> <20130418081957.GB8913@t430s.nay.redhat.com> <516FB918.3010206@greensocs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <516FB918.3010206@greensocs.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] 'id' assigned to -device could not be set as net-client name (was Re: Nic devices' name are wrongly repeated) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: KONRAD =?iso-8859-1?Q?Fr=E9d=E9ric?= Cc: Anthony Liguori , qemu-devel , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= On Thu, Apr 18, 2013 at 11:12:56AM +0200, KONRAD Fr=E9d=E9ric wrote: > On 18/04/2013 10:19, Amos Kong wrote: > >On Wed, Apr 10, 2013 at 02:28:40PM +0200, Andreas F=E4rber wrote: > >>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. > >>> > >>># qemu-upstream -device virtio-net-pci,netdev=3Dh1 -netdev tap,id=3D= h1 -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,macadd= r=3D52:54:00:12:34:56 > >>> \ h1: index=3D0,type=3Dtap,ifname=3Dtap0,script=3D/etc/qemu-ifup,d= ownscript=3D/etc/qemu-ifdown > >>>virtio-net-pci.0: index=3D0,type=3Dnic,model=3Dvirtio-net-pci,macadd= r=3D52:54:00:12:34:57 > >>> \ h2: index=3D0,type=3Dtap,ifname=3Dtap1,script=3D/etc/qemu-ifup,d= ownscript=3D/etc/qemu-ifdown > >>> > >>>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 -dev= ice. > > > >Hi KONRAD, > > > > Your following patch just introduced a regression, 'id' assigned to = -device > > could not be set as net-client name. >=20 > A regression from "net: make nic name unique" ? No, regression caused by commit: e37da3945fa2fde161e1b217f937fc318c4b7639 > >qemu -device virtio-net-pci,netdev=3Dndev1,id=3Did1 -netdev tap,id=3Dn= dev1 \ > > -device e1000,netdev=3Dndev2,id=3Did2 -netdev tap,id=3D= ndev2 > > > >(qemu) info network > >virtio-net-device.0: index=3D0,type=3Dnic,model=3Dvirtio-net-device,ma= caddr=3D52:54:00:12:34:56 > > \ ndev1: index=3D0,type=3Dtap,ifname=3Dtap0,script=3D/etc/qemu-ifup,= downscript=3D/etc/qemu-ifdown > >id2: index=3D0,type=3Dnic,model=3De1000,macaddr=3D52:54:00:12:34:57 > > \ ndev2: index=3D0,type=3Dtap,ifname=3Dtap1,script=3D/etc/qemu-ifup,= downscript=3D/etc/qemu-ifdown >=20 > yes :/, that seems to be the side effect of cutting virtio-net-pci in >=20 > virtio-net-pci + virtio-net-device. >=20 > Here virtio-net-device is the network device as you see in info network. >=20 > virtio-net-pci isn't anymore. >=20 > I wonder how to solve that as we can't duplicate the id. If we don't assign 'id' for -device, the net-client name will be auto generated (not duplicated). Before your commit e37da394, user assigned 'id' will be record to (DeviceState *)dev->id, it will be used in qemu_new_nic(). > I will take a look. > > Fred --=20 Amos.