Bug 683731

Summary: Need delete 2 times of a hotplug block storage when forceoff the guest with virt-manager
Product: Red Hat Enterprise Linux 6 Reporter: Min Zhan <mzhan>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: dyuan, llim, mzhan, xen-maint
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-10 15:10:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Min Zhan 2011-03-10 08:26:40 UTC
Description of problem:
Use virt-manager, run a guest, hotplug a block storage /dev/sda5, hotplug successfully. Forceoff this guest, found that need delete this storage 2 times

Version-Release number of selected component (if applicable):
kernel:kernel-2.6.32-71.18.1.el6
libvirt:libvirt-0.8.1-27.el6_0.3
kvm:qemu-kvm-0.12.1.2-2.113.el6_0.8
virt-manager-0.8.4-8.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run a health guest
2. Hotplug a block storage, such as /dev/sda5, type as virtio. Hotplug successfully. Check in guest found this storage
3. Forceoff this guest
4. Remove this hotplug storage
  
Actual results:
Need remove for 2 times. And check this guest xml, 2 same disk xml can be found in # virsh edit.

# virsh dumpxml <guest>
...
 <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/new.img'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sda5'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
...

# virsh edit <guest>
...
 <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/new.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sda5'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sda5'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <controller type='ide' index='0'>
...

Expected results:
Need remove for 1 time successfully

Additional info:
Also try with libvirt command, attach-device uses xml to hotplug the same disk, then forceoff the guest, remove the hotplug storage, it works well.

Comment 1 Min Zhan 2011-03-10 10:35:45 UTC
I think it is a Regression for bug 623066 which is fixed in RHEL6

Comment 3 Cole Robinson 2011-03-10 15:10:10 UTC
It looks like you were testing with 6.0 packages:

kernel:kernel-2.6.32-71.18.1.el6
libvirt:libvirt-0.8.1-27.el6_0.3
kvm:qemu-kvm-0.12.1.2-2.113.el6_0.8
virt-manager-0.8.4-8.el6.noarch

However that bug 623066 is only queued up in 6.1 packages. So I think this is just another instance of bug 623066 like you mention. Closing as a dup.

If you can reproduce against latest virt-manager/libvirt, please reopen.

*** This bug has been marked as a duplicate of bug 623066 ***