]> git.ipfire.org Git - thirdparty/libvirt.git/commit
release PCI address only when we have ensured it successfully
authorWen Congyang <wency@cn.fujitsu.com>
Tue, 26 Apr 2011 03:40:01 +0000 (11:40 +0800)
committerWen Congyang <wency@cn.fujitsu.com>
Wed, 27 Apr 2011 12:12:14 +0000 (20:12 +0800)
commit968fd0111aed4b0ef39e24282db5642c8dd6ca7f
tree298b7d918540964f5e8e3ef538420a0f0d0f2e7e
parent3c1326385a7c74b6628cd5b3323d13d7de85b51e
release PCI address only when we have ensured it successfully

Steps to reproduce this bug:
1. # cat net.xml # 00:03.0 has been used
    <interface type='network'>
      <mac address='52:54:00:04:72:f3'/>
      <source network='default'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

2. # virsh attach-device vm1 net.xml
   error: Failed to attach device from net.xml
   error: internal error unable to reserve PCI address 0:0:3

3. # virsh attach-device vm1 net.xml
   error: Failed to attach device from net.xml
   error: internal error unable to execute QEMU command 'device_add': Device 'rtl8139' could not be initialized

The reason of this bug is that: we can not reserve PCI address 0:0:3 because it has
been used, but we release PCI address when we reserve it failed.
src/qemu/qemu_hotplug.c