Bug 851979

Summary: The controller device still exist after clicking remove button by virt-manager
Product: Red Hat Enterprise Linux 6 Reporter: Daisy Wu <jwu>
Component: virt-managerAssignee: virt-mgr-maint
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, codong, cwei, dallan, gscrivan, lcui, mjenner, mzhan, tzheng, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 949201 (view as bug list) Environment:
Last Closed: 2014-01-30 12:52:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 949201    

Description Daisy Wu 2012-08-27 08:15:53 UTC
Description of problem:
The controller device can not be removed by virt-manager successfully and virt-manager does not pop up any relative info to remind customer.

Version-Release number of selected component (if applicable):
virt-manager-0.9.0-14.el6.x86_64
libvirt-0.10.0-0rc0.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.303.el6.x86_64
# uname -a
Linux jwu.redhat.com 2.6.32-288.el6.x86_64 #1 SMP Thu Jul 19 23:09:22 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux


How reproducible:
100%

Steps to Reproduce:
1.  prepare one guest, make sure the guest with some controller. Just like:
#virsh dumpxml rhel63-qcow2
...
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
...

2. launch virt-manager -> shut down this guest
3. open one guest -> click "show virtual hardware detials"-> choose "Controller IDE"-> click remove button -> pop up windows "Are you sure you want to remove this device?" click yes


Actual results:
The Controller IDE device still exist and virt-manager does not pop up any relative info to customer.

Expected results:
1. The Controller IDE device disappear on virt-manager
2. If this kind of device can not be removed by customer, virt-manager should pop up some relative info to remind customer.

Additional info:
1. #virt-manager --debug:
...
2012-08-27 02:29:06,748 (details:2249): Removing device: controller <virtinst.VirtualController.VirtualController object at 0x30c51d0>
2012-08-27 02:29:15,965 (libvirtobject:135): Redefining 'rhel63-qcow2' with XML diff:
--- Original XML 
+++ New XML 
@@ -34,9 +34,6 @@
     <controller type="usb" index="0">
       <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
     </controller>
-    <controller type="ide" index="0">
-      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
-    </controller>
     <interface type="network">
       <mac address="52:54:00:06:e6:db"/>
       <source network="default"/>


2. After click remove, check the dumpxml, Controller IDE still exist:
# virsh dumpxml rhel63-qcow2
...
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
...

Comment 3 CongDong 2013-04-02 08:22:17 UTC
Reproduce  this bug on RHEL6.4

[root@localhost ~]# rpm -qa virt-manager libvirt qemu-kvm
virt-manager-0.9.0-18.el6.x86_64
libvirt-0.10.2-18.el6.x86_64
qemu-kvm-0.12.1.2-2.355.el6.x86_64
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Comment 4 Giuseppe Scrivano 2014-01-30 12:52:29 UTC
from what I can see, libvirt implicitly adds an IDE controller when there are IDE disks.  You can check this by removing the IDE controller manually using "virsh" and see it is re-added.