Bug 502095

Summary: RHEL5.4: libvirt QEMU driver is using old pci_add/pci_del syntax
Product: Red Hat Enterprise Linux 5 Reporter: Mark McLoughlin <markmc>
Component: libvirtAssignee: Daniel Berrangé <berrange>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.4CC: llim, mtosatti, nzhang, ovirt-maint, veillard, virt-maint, xen-maint, yoyzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 499669 Environment:
Last Closed: 2009-09-02 09:21:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix disk hotplug for KVM
none
Trivial rediff of upstream patch to RHEL5 tree none

Description Mark McLoughlin 2009-05-21 20:22:29 UTC
+++ This bug was initially created as a clone of Bug #499669 +++

Description of problem:

Hot-removing a virtio-blk device succeeds even if the guest did not remove
it, because device was in use. 

...

Actually, it was working with kvm-74 installed. After the upgrade to the new 
qemu packages in FC11 PCI hot-add broke:

pci_add 0 storage file=/tmp/file10,if=scsi
Invalid pci address^
info balloon

Which is the old syntax for pci_add.

The RHEL5 version of kvm has required this syntax since Marcelo backported it; kvm-83-20.el5ovirt was the first version that included this backport

Comment 1 Daniel Berrangé 2009-07-10 12:23:11 UTC
Possible patch posted upstream, not yet merged though.

http://www.redhat.com/archives/libvir-list/2009-July/msg00115.html


Hotplug is completely broken for libvirt KVM without this fix.

Comment 3 Daniel Berrangé 2009-07-20 19:57:03 UTC
*** Bug 511831 has been marked as a duplicate of this bug. ***

Comment 5 Daniel Berrangé 2009-07-20 20:02:47 UTC
Created attachment 354385 [details]
Fix disk hotplug for KVM

Patch from upstream

http://libvirt.org/git/?p=libvirt.git;a=commit;h=326ecb78145cfeb7706ef0dcd521b19d934950e7

Comment 8 Daniel Berrangé 2009-07-22 10:17:59 UTC
Created attachment 354661 [details]
Trivial rediff of upstream patch to RHEL5 tree

Comment 9 Daniel Veillard 2009-07-22 11:38:25 UTC
libvirt-0.6.3-16.el5 was built in dist-5E-qu-candidate with the fix,

Daniel

Comment 12 Nan Zhang 2009-07-24 09:58:17 UTC
This bug has been verified with libvirt 0.6.3-16.el5 on RHEL-5.4. Set status to VERIFIED.

[root@dhcp-66-70-85 ~]# cat disk1.xml
    <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/RHEL-Server-5.4-64.raw'/>
      <target dev='sdb' bus='scsi'/>
    </disk>

[root@dhcp-66-70-85 ~]# cat disk2.xml
    <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/RHEL-Server-5.4-64-virtio.qcow2'/>
      <target dev='vdc' bus='virtio'/>
    </disk>

[root@dhcp-66-70-85 ~]# virsh start demo
Domain demo started

[root@dhcp-66-70-85 ~]# virsh list --all
 Id Name                 State
----------------------------------
  1 demo                 idle
  - foo                  shut off

[root@dhcp-66-70-85 ~]# virsh attach-device demo disk1.xml
Device attached successfully

[root@dhcp-66-70-85 ~]# virsh attach-device demo disk2.xml
Device attached successfully

[root@dhcp-66-70-85 ~]# virsh dumpxml demo
--- snip ---
    <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/demo.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/RHEL-Server-5.4-64.raw'/>
      <target dev='sdb' bus='scsi'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/RHEL-Server-5.4-64-virtio.qcow2'/>
      <target dev='vdc' bus='virtio'/>
    </disk>
--- snip ---

[root@dhcp-66-70-85 ~]# virsh detach-device demo disk1.xml
Device detached successfully

[root@dhcp-66-70-85 ~]# virsh detach-device demo disk2.xml
Device detached successfully

[root@dhcp-66-70-85 ~]# virsh dumpxml demo
--- snip ---
    <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/demo.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
--- snip ---

Comment 14 errata-xmlrpc 2009-09-02 09:21:22 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1269.html