Bug 803577 - virsh attach-disk should detect disk source file type when sourcetype is not specified
Summary: virsh attach-disk should detect disk source file type when sourcetype is not ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-15 06:10 UTC by Huang Wenlong
Modified: 2013-10-20 21:45 UTC (History)
10 users (show)

Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:08:40 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description Huang Wenlong 2012-03-15 06:10:23 UTC
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 09:49:06 UTC
commit 6227a220ccdd0193a1912f3a0010a72d91f06818
Author: Osier Yang <jyang>
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 08:56:03 UTC
Per comment 2, move to POST.

Comment 7 weizhang 2012-07-25 03:58:43 UTC
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 07:08:40 UTC
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.