All of lore.kernel.org
 help / color / mirror / Atom feed
From: "KONRAD Frédéric" <fred.konrad@greensocs.com>
To: Amos Kong <akong@redhat.com>
Cc: "Anthony Liguori" <anthony@codemonkey.ws>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
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 12:03:32 +0200	[thread overview]
Message-ID: <516FC4F4.8030002@greensocs.com> (raw)
In-Reply-To: <20130418094716.GA11317@t430s.nay.redhat.com>

On 18/04/2013 11:47, Amos Kong wrote:
> 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().

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

      reply	other threads:[~2013-04-18 10:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 12:05 [Qemu-devel] Nic devices' name are wrongly repeated Amos Kong
2013-04-10 12:28 ` Andreas Färber
2013-04-10 14:17   ` Amos Kong
2013-04-11  8:22     ` Stefan Hajnoczi
2013-04-11 11:58       ` [Qemu-devel] [PATCH] net: make nic name unique Amos Kong
2013-04-12  9:06         ` Stefan Hajnoczi
2013-04-12 10:50           ` Markus Armbruster
2013-04-15 10:55         ` [Qemu-devel] [PATCH v2] net: make network client " Amos Kong
2013-04-18 11:25           ` Stefan Hajnoczi
2013-04-18  8:19   ` [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  9:12     ` KONRAD Frédéric
2013-04-18  9:47       ` Amos Kong
2013-04-18 10:03         ` KONRAD Frédéric [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516FC4F4.8030002@greensocs.com \
    --to=fred.konrad@greensocs.com \
    --cc=afaerber@suse.de \
    --cc=akong@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.