[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Nic devices' name are wrongly repeated

From: Andreas Färber
Subject: Re: [Qemu-devel] Nic devices' name are wrongly repeated
Date: Wed, 10 Apr 2013 14:28:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5


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.


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]