[libvirt-users] How to Position a Network Interface in Physical PCI Slot

Laine Stump laine at laine.org
Tue Dec 17 14:38:24 UTC 2013


On 12/17/2013 08:02 AM, Thiru Murugan wrote:
> Hi ,
>
> I would like to assign a Network Interface card to Physical Slot X in
> the virtual machine,
>
> I have gone through the XML file definition[Now i have some idea on
> how to position the Network Interface in Logical PCI Slot.]

What is logical slot X vs. physical slot X? There are only two PCI
addresses associated with any PCI passthrough device (the slot on the
host, and the slot on the guest), which you say you aren't interested in
anyway, and there is only one PCI address associated with any emulated
device - the slot on the guest, which is set with the <address>
sub-element of any device. In general, whatever address you set there
will be the location of the device on the guest, although I've heard
some people mention that this isn't necessarily always the case, but
depends on the guest OS.


>  
>
> I am NOT interested in using a PCI Pass-through from the Host.
>
> currently running  Fedora 19  with libvirt 1.2.0
>
> I would like to create an network interface card on Physical Slot 5 so
> all my network interfaces under the pci-bridge get detected as pci5px

This should place the card in slot 5 of bus 0:

    <interface type=....>
      ...
      <address type='pci' domain='0' bus='0' slot='5' function='0'/>
    </interface>

Showing up on a particular slot doesn't necessarily guarantee the name
that will be given to the interface - that is completely up to the guest
OS. For example, on my F19 hardware, I have an ethernet at bus=4 slot=0
function=0 which was given the name "p13p1", another at 4:0.1 which is
"p13p2", and another that is integrated on the motherboard at 6:0.0
which is named "p32p1". On several F19 guests (some installed with F19
from scratch, at least one upgraded from F18), the network interfaces
are all named ethX. I believe this is now somehow controlled by systemd,
but I haven't had any need to learn the details.




More information about the libvirt-users mailing list