Bug 1087670 - Error info is not clear/useful and hit AttributeError in debug mode when try to add new device "Filesystem" into guest
Summary: Error info is not clear/useful and hit AttributeError in debug mode when try ...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Giuseppe Scrivano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-15 02:33 UTC by zhengqin
Modified: 2014-04-18 08:02 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-18 08:02:00 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description zhengqin 2014-04-15 02:33:26 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, and prepare a shutoff rhel guest.
#virt-manager --debug

2. Open the guest's detail page, and click "Add Hardware" -> "Filesystem", and Error "Not supported for this hypervisor/libvirt combination" shows.

3. Click "Finish" button




Actual result:
1. Debug mode hit AttributeError:
--------------------------------------
2014-04-14 05:53:00,511 (addhardware:164): Showing addhw
2014-04-14 05:53:05,816 (error:81): error dialog message:
summary=Unable to add device: 'NoneType' object has no attribute 'virtual_device_type'
details=Unable to add device: 'NoneType' object has no attribute 'virtual_device_type'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1032, in finish
    failure, errinfo = self.add_device()
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1308, in add_device
    ret = self.setup_device()
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1301, in setup_device
    if (self._dev.virtual_device_type == self._dev.VIRTUAL_DEV_DISK and
AttributeError: 'NoneType' object has no attribute 'virtual_device_type'
--------------------------------------

2. Error info for virt-manager will show:
Unable to add device: 'NoneType' object has no attribue 'virtual_device_type'


Expected results:
1. No error will be shown in debug mode
2. It is better to disable the "Finish" button since the error shows at step 2 is good enough, and this error from virt-manager is not clear and not useful.


Additional info:
1. This issue also occurs on latest rhel6u5.

Comment 1 Giuseppe Scrivano 2014-04-18 08:02:00 UTC
fixed upstream by:

commit 06e480c8474d0c0ecce66804c473f675a47afe68
Author: Giuseppe Scrivano <gscrivan>
Date:   Thu Apr 17 11:25:01 2014 +0200

    virt-manager, addhardware: disable "Finish" with unsupported devs
    
    Disabled the "Finish" button in the "Add Hardware" window when the
    specified dev is not supported by the HV.
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1087670
    
    Signed-off-by: Giuseppe Scrivano <gscrivan>


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