Bug 1081373

Summary: "Remove Hardware" context memu displayed for none hardware item on guest detail page and could not work.
Product: Red Hat Enterprise Linux 7 Reporter: zhengqin <zsong>
Component: virt-managerAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED UPSTREAM QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: codong, dyuan, gscrivan, lcui, mzhan, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1081374 (view as bug list) Environment:
Last Closed: 2014-03-27 12:52:09 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: 1081374    

Description zhengqin 2014-03-27 06:14:20 UTC
Description of problem:
Version-Release number of selected component:
virt-manager-0.10.0-20.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Start virt-manager with --debug.

2. Open a guest's detail page.

3. Right-click on "Overview" item, and the context memu pops up with options "Add Hardware" and "Remove Hardware".

4. Choose option "Remove Hardware".

Actual result:
1. Debug error will pop up "AttributeError: str object has no attribute 'virtual_device_type'"
----------------------------------------------------------------
2014-03-27 13:37:56,618 (details:576): Showing VM details: <vmmDomain object at 0x2764d70 (virtManager+domain+vmmDomain at 0x1b7fae0)>
2014-03-27 13:38:01,480 (cliutils:87): Uncaught exception:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 1532, in remove_xml_dev
    devtype = info.virtual_device_type
AttributeError: 'str' object has no attribute 'virtual_device_type'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 1532, in remove_xml_dev
    devtype = info.virtual_device_type
AttributeError: 'str' object has no attribute 'virtual_device_type'
----------------------------------------------------------------
2. There is no response when choosing "Remove Hardware"
3. There is no "Remove" button at right-lower window for Overview page.


Expected results:
1. "Remove Hardware" option should be removed on context memu since "Overview" is not a hardware.





Additional info:
1. This issue also occurs on RHEL6.
2. This issue also occurs for "Performance", "Processor", "Memory" and "Boot Options"
3. Could not remove Mouse if only one mouse device exists.

Comment 1 Giuseppe Scrivano 2014-03-27 12:52:09 UTC
closed upstream with:

commit 37eecb215d137ffb6e98f36adfa37f96220d7287
Author: Giuseppe Scrivano <gscrivan>
Date:   Thu Mar 27 12:40:42 2014 +0100

    virtManager: hide "Remove Hardware" for non-devices
    
    The menu item "Remove Hardware" in the Overview window is valid only
    when a hardware device is selected, hide it in any other case.
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1081373
    
    Signed-off-by: Giuseppe Scrivano <gscrivan>