hi,

I have a question about interface hotplug.
I attach and detach interface from vm for several times. I find the
pci slot of interface increases in live xml while keep unchanged in
config xml. Here is my test script and result:

Test Script:
#!/bin/bash

VM=ub1504b
print_xml() {
    echo "$* : ========inactive==========="
    virsh dumpxml --inactive $VM |grep -A 20 "<interface" |grep "mac\|slot"
    echo "$* : ========  active==========="
    virsh dumpxml $VM |grep -A 20 "<interface" |grep "mac\|slot"
}

print_xml begin_
virsh attach-device --config --live $VM if1.xml
print_xml attach
virsh detach-device --config --live $VM if1.xml
print_xml detach

Result:
begin_ : ========inactive===========
      <mac address='0c:da:41:1e:02:9c'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
begin_ : ========  active===========
      <mac address='0c:da:41:1e:02:9c'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
Device attached successfully

attach : ========inactive===========
      <mac address='0c:da:41:1e:02:9c'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
      <mac address='0c:da:11:11:11:11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='*0x0c*'
function='0x0'/>
attach : ========  active===========
      <mac address='0c:da:41:1e:02:9c'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
      <mac address='0c:da:11:11:11:11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='*0x0d*'
function='0x0'/>
Device detached successfully

detach : ========inactive===========
      <mac address='0c:da:41:1e:02:9c'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
detach : ========  active===========
      <mac address='0c:da:41:1e:02:9c'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>

When execute the script for more than 1 times, You can see the pci
slot of attached interface in live xml differs from the one in config
xml.
Is this intentional or a bug ? If not a bug, why?
_______________________________________________
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users

Reply via email to