Red Hat Bugzilla – Bug 803577
virsh attach-disk should detect disk source file type when sourcetype is not specified
Last modified: 2013-10-20 17:45:35 EDT
Description of problem: virsh attach-disk should detect disk source file type when sourcetype is not specified Version-Release number of selected component (if applicable): libvirt-0.9.10-4.el6.x86_64 qemu-kvm-0.12.1.2-2.241.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.create a file img #qemu-img create /var/lib/libvirt/images/hotplug.img 1G 2.hotplug file disk to guest # virsh attach-disk $domain_name /var/lib/libvirt/images/hotplug.img vdb 3. check xml of domain disk type should be file not block . #virsh dumpxml $domain_name ... <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/var/lib/libvirt/images/hotplug.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> ... Actual results: do not detect disk source file type Expected results: detect disk source file type Additional info:
commit 6227a220ccdd0193a1912f3a0010a72d91f06818 Author: Osier Yang <jyang@redhat.com> Date: Thu Mar 15 18:16:52 2012 +0800 virsh: A bit smarter attach-disk Detects the file type of source path if no "--sourcetype" and "driver" is specified, instead of always set the disk type as "block". Patch comitted to upstream
Per comment 2, move to POST.
Verify pass on libvirt-0.9.13-3.el6.x86_64 kernel-2.6.32-289.el6.x86_64 qemu-kvm-0.12.1.2-2.298.el6.x86_64 # virsh attach-disk vr-rhel6u3-x86_64-kvm /dev/sdb1 vdc # virsh attach-disk vr-rhel6u3-x86_64-kvm /var/lib/libvirt/images/attch.img vdb # virsh dumpxml vr-rhel6u3-x86_64-kvm ... <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/attch.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/sdb1'/> <target dev='vdc' bus='virtio'/> <alias name='virtio-disk2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> ...
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0276.html