qemulibvirtpcivirsh

Why virsh domxml-to-native changes PCI slot number


I have the following definition of network define virsh edit vm:

    <controller type='pci' index='0' model='pci-root'/>                                             
    <interface type='bridge'>                                                                       
      <mac address='f2:ff:ff:ff:ff:07'/>                                                            
      <source bridge='br0:'/>                                                                       
      <model type='e1000'/>                                                                         
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>                   
    </interface>

i.e slot=3, but after running virsh domxml-to-native qemu-argv i'm getting -

qemu-system-x86_64 -name guest=vm07 -machine pc-i440fx-2.12,accel=kvm,usb=off,dump-guest-core=off -cpu SandyBridge-IBRS -m 4096
.... -netdev tap,fd=21,id=hostnet0
-device e1000,netdev=hostnet0,id=net0,mac=f2:ff:ff:ff:ff:07,bus=pci.0,addr=0x2

i.e slot=2, which change previous ens3 interface -> ens2 interface and failing getting IP by dhcp.

Any idea why it's happen and how to keep the slot number? Thanks!


Solution

  • verified with libvirt user group as bug in version 4.5.0, fix is in the way.