qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Amos Kong <akong@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] Nic devices' name are wrongly repeated
Date: Wed, 10 Apr 2013 14:28:40 +0200	[thread overview]
Message-ID: <51655AF8.40102@suse.de> (raw)
In-Reply-To: <20130410120519.GA13514@t430s.nay.redhat.com>

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.

Having said that, in a different context (USB) I was made aware that we
don't know the bus name at QOM initialization time yet and, if we want
to create a bus at that point, will need to rename it later. Thus we'd
need an overridable ID setter hook to propagate to busses, and if we had
such a settable ID property it would be convenient for your use case to
have a matching monitor command as well to be able to resolve name
conflicts at runtime rather than with a QEMU restart.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2013-04-10 12:28 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 [this message]
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

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=51655AF8.40102@suse.de \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).