[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] 'id' assigned to -device could not be set as net-client
From: |
Amos Kong |
Subject: |
Re: [Qemu-devel] 'id' assigned to -device could not be set as net-client name (was Re: Nic devices' name are wrongly repeated) |
Date: |
Thu, 18 Apr 2013 17:47:16 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Apr 18, 2013 at 11:12:56AM +0200, KONRAD Frédéric wrote:
> On 18/04/2013 10:19, 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.
> >
> >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: e37da3945fa2fde161e1b217f937fc318c4b7639
> >qemu -device virtio-net-pci,netdev=ndev1,id=id1 -netdev tap,id=ndev1 \
> > -device e1000,netdev=ndev2,id=id2 -netdev tap,id=ndev2
> >
> >(qemu) info network
> >virtio-net-device.0:
> >index=0,type=nic,model=virtio-net-device,macaddr=52:54:00:12:34:56
> > \ ndev1:
> > index=0,type=tap,ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
> >id2: index=0,type=nic,model=e1000,macaddr=52:54:00:12:34:57
> > \ ndev2:
> > index=0,type=tap,ifname=tap1,script=/etc/qemu-ifup,downscript=/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 network.
>
> 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().
> I will take a look.
> > Fred
--
Amos.
[Qemu-devel] 'id' assigned to -device could not be set as net-client name (was Re: Nic devices' name are wrongly repeated), Amos Kong, 2013/04/18