On Wed, Apr 10, 2013 at 10:17:04PM +0800, Amos Kong wrote: > On Wed, Apr 10, 2013 at 02:28:40PM +0200, Andreas Färber 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=h1 -netdev tap,id=h1 > > > -device virtio-net-pci,netdev=h2 -netdev tap,id=h2 ... > > > (qemu) info network > > > virtio-net-pci.0: > > > index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56 > > > \ h1: > > > index=0,type=tap,ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown > > > virtio-net-pci.0: > > > index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:57 > > > \ h2: > > > index=0,type=tap,ifname=tap1,script=/etc/qemu-ifup,downscript=/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=youruniqueid to -device. > > If we also assigned unique ids for nic devices, it works.
I was unaware of this issue. Do you want to send a fix so NICs get unique names? Stefan