Bug 803577 - virsh attach-disk should detect disk source file type when sourcetype is not specified
virsh attach-disk should detect disk source file type when sourcetype is not ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-15 02:10 EDT by Huang Wenlong
Modified: 2013-10-20 17:45 EDT (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:08:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Huang Wenlong 2012-03-15 02:10:23 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:
Comment 2 Osier Yang 2012-03-15 05:49:06 EDT
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
Comment 4 Osier Yang 2012-05-28 04:56:03 EDT
Per comment 2, move to POST.
Comment 7 weizhang 2012-07-24 23:58:43 EDT
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>
...
Comment 8 errata-xmlrpc 2013-02-21 02:08:40 EST
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

Note You need to log in before you can comment on or make changes to this bug.