From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USlgy-0005T8-33 for qemu-devel@nongnu.org; Thu, 18 Apr 2013 06:03:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USlgt-00050O-E3 for qemu-devel@nongnu.org; Thu, 18 Apr 2013 06:03:48 -0400 Received: from greensocs.com ([87.106.252.221]:47852 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USlgt-000507-3d for qemu-devel@nongnu.org; Thu, 18 Apr 2013 06:03:43 -0400 Message-ID: <516FC4F4.8030002@greensocs.com> Date: Thu, 18 Apr 2013 12:03:32 +0200 From: =?ISO-8859-1?Q?KONRAD_Fr=E9d=E9ric?= MIME-Version: 1.0 References: <20130410120519.GA13514@t430s.nay.redhat.com> <51655AF8.40102@suse.de> <20130418081957.GB8913@t430s.nay.redhat.com> <516FB918.3010206@greensocs.com> <20130418094716.GA11317@t430s.nay.redhat.com> In-Reply-To: <20130418094716.GA11317@t430s.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Amos Kong Cc: Anthony Liguori , qemu-devel , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , =?ISO-8859-1?Q?Andreas_F=E4rber?= On 18/04/2013 11:47, Amos Kong wrote: > 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,macad= dr=3D52:54:00:12:34:56 >>>>> \ h1: index=3D0,type=3Dtap,ifname=3Dtap0,script=3D/etc/qemu-ifup,= downscript=3D/etc/qemu-ifdown >>>>> virtio-net-pci.0: index=3D0,type=3Dnic,model=3Dvirtio-net-pci,macad= dr=3D52:54:00:12:34:57 >>>>> \ h2: index=3D0,type=3Dtap,ifname=3Dtap1,script=3D/etc/qemu-ifup,= downscript=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 -de= vice. >>> Hi KONRAD, >>> >>> Your following patch just introduced a regression, 'id' assigned to= -device >>> could not be set as net-client name. >> A regression from "net: make nic name unique" ? > No, regression caused by commit: e37da3945fa2fde161e1b217f937fc318c4b76= 39 > >>> qemu -device virtio-net-pci,netdev=3Dndev1,id=3Did1 -netdev tap,id=3D= ndev1 \ >>> -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,m= acaddr=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 >> yes :/, that seems to be the side effect of cutting virtio-net-pci in >> >> virtio-net-pci + virtio-net-device. >> >> Here virtio-net-device is the network device as you see in info networ= k. >> >> virtio-net-pci isn't anymore. >> >> 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(). Yes sure, what I mean, is: virtio-net-pci actually get the id and is not the nic device anymore. and virtio-net-pci create the new virtio-net-device which has no id (so it is autogenerated). That's why you didn't the id in info network. >> I will take a look. >>> Fred