Bug 429485 - Error when adding floppy disk device to existing VM
Summary: Error when adding floppy disk device to existing VM
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 9
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-21 00:02 UTC by Adam Huffman
Modified: 2008-12-21 08:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-12-21 08:28:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Virt-manager logfile (227.95 KB, text/plain)
2008-03-11 11:08 UTC, Adam Huffman
no flags Details

Description Adam Huffman 2008-01-21 00:02:54 UTC
Description of problem:
I tried adding a floppy disk device to an existing VM in virt-manager but it
failed with the following error:

Unable to complete install '<type 'exceptions.NameError'> global name
'libvirtError' is not defined
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 530, in add_device
    self.vm.add_device(xml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 684, in add_device
    except libvirtError, e:
NameError: global name 'libvirtError' is not defined


Version-Release number of selected component (if applicable):
virt-manager-0.5.2-2.fc8
libvirt-0.4.0-3.fc8

How reproducible:

Tried several times with the same result

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Daniel Berrangé 2008-01-21 02:21:50 UTC
Please re-test with virt-manager 0.5.3-1.fc8 available from updates-testing - it
should fix this issue.


Comment 2 Adam Huffman 2008-01-21 16:40:53 UTC
Just done that, having re-started virt-manager and it appeared to finish but
then there was an error message:

Unable to complete install: 'Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 513, in add_device
    self.vm.add_device(xml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 729, in add_device
    raise RuntimeError, "Unable to attach device to live guest, libvirt reported
error:\n" + device_exception
RuntimeError: Unable to attach device to live guest, libvirt reported error:
virDomainAttachDevice() failed only CDROM disk devices can be attached
'

Does this mean I need to restart the VM?

Comment 3 Adam Huffman 2008-01-22 12:44:21 UTC
I shutdown the VM and a floppy device had been created.  However, I was then
unable to start the VM in virt-manager.  The error is:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 472, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 379, in startup
    self.vm.create()
  File "/usr/lib64/python2.5/site-packages/libvirt.py", line 240, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: virDomainCreate() failed QEMU quit during console startup
qemu: could not open floppy disk image
'/dev/disk/by-id/usb-Y-E_DATA_USB_Floppy_Drive'

This error relates to device fdb, as I tried creating another floppy device, but
using a different method of referring to the 'real' device.

The mention of a 'floppy disk image' is odd, as it's not an image, but a USB
floppy drive.

Comment 4 Adam Huffman 2008-02-13 13:45:03 UTC
I've just tried adding a USB flash drive as a device, and received a related error:

Unable to complete install: 'Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 513, in add_device
    self.vm.add_device(xml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 724, in add_device
    self.get_connection().define_domain(newxml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 446, in
define_domain
    self.vmm.defineXML(xml)
  File "/usr/lib64/python2.5/site-packages/libvirt.py", line 601, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirtError: virDomainDefineXML() failed Invalid harddisk device name: sda
'
The mention of 'sda' is odd as the device I tried to add was '/dev/sdj'.

If you'd prefer I report this as a separate bug, let me know.

Comment 5 Cole Robinson 2008-02-14 22:46:28 UTC
The usb issue seems seperate. Please file a different bug, and specify if the
guest is running or shutdown, whether using qemu/kvm or xen, and exactly what
input you are using that triggers the issue. Thanks!

Comment 6 Cole Robinson 2008-02-19 22:36:47 UTC
In response to comment #3: I tried to reproduce this but had no luck. That error
is what you should see if qemu can not find the specified floppy path. 

Could you try and reproduce this, and make sure that the path is still present
after the failure? If you still get the error, attach
~/.virt-manager/virt-manager.log and virsh dumpxml <domnam> to this bz.

Comment 7 Cole Robinson 2008-02-25 22:18:27 UTC
I opened a seperate bug for the scsi issue (bz 434871), which is now fixed
upstream. Setting this bug to needinfo with regards to the info requested of
comment #3.

Comment 8 Adam Huffman 2008-03-11 11:06:18 UTC
Have just been able to reproduce it, when using /dev/sdd as the device (it's a
USB external floppy drive):

Unable to complete install: 'Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 513, in add_device
    self.vm.add_device(xml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 729, in add_device
    raise RuntimeError, "Unable to attach device to live guest, libvirt reported
error:\n" + device_exception
RuntimeError: Unable to attach device to live guest, libvirt reported error:
virDomainAttachDevice() failed only CDROM disk devices can be attached
'

Comment 9 Adam Huffman 2008-03-11 11:08:13 UTC
Created attachment 297593 [details]
Virt-manager logfile

Comment 10 Adam Huffman 2008-03-11 11:09:32 UTC
When I try virsh dumpxml XP2, the response is:

error: failed to connect to hypervisor

It's a KVM guest.

Comment 11 Cole Robinson 2008-03-11 13:56:05 UTC
This error is actually expected behavior. For a qemu/kvm guest, the only devices
that can actually be manipulated on a live guest are cdroms, and only for
connect or disconnecting an individual disk. The error message is certainly
unclear though, and virt-manager in general needs some better way to handle
attaching devices to live guests, either outright denying it or giving some
message like "This device will be available after the next reboot".

For dumpxml, try virsh --connect qemu:///system dumpxml XP2 (this issue will be
fixed in the next virt-manager release). However the xml isn't really neccessary
since it is in the log file you posted.

I'm still interest in comment #3, since that is an error I can't reproduce. My
guess is the device was disconnect from your machine when you tried to boot the
guest, the guest couldn't find the device and bombed, which is fine. But if you
can reproduce, please explain.

Comment 12 Adam Huffman 2008-03-11 18:14:34 UTC
Re. https://bugzilla.redhat.com/show_bug.cgi?id=429485#c3 - yes, it's the guest
refusing to boot when the USB floppy drive is disconnected.

In this case I think your idea of a message indicating that a guest reboot is
necessary for the device to be available is a good idea.


Comment 13 Cole Robinson 2008-09-03 20:42:16 UTC
Okay! I've finally fixed this upstream:

http://hg.et.redhat.com/virt/applications/virt-manager--devel?cs=935f3b243a91

If the guest is running and the user attempts to connect a device which is not hotpluggable, a warning will pop up saying something like "This change will only take affect on the next reboot". Error reporting and general interaction for this operations is a lot better as well.

Setting to POST.

Thanks,
Cole

Comment 14 Bug Zapper 2008-11-26 09:30:20 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 15 Cole Robinson 2008-11-26 15:33:44 UTC
This stuff is a bit too invasive for F8, so moving this bug to F9. This will be fixed in the next update.

Comment 16 Fedora Update System 2008-12-01 18:10:09 UTC
virt-manager-0.6.0-0.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/virt-manager-0.6.0-0.fc9

Comment 17 Fedora Update System 2008-12-01 18:23:19 UTC
virt-manager-0.6.0-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/virt-manager-0.6.0-1.fc9

Comment 18 Fedora Update System 2008-12-03 01:30:12 UTC
virt-manager-0.6.0-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update virt-manager'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-10705

Comment 19 Fedora Update System 2008-12-21 08:27:17 UTC
virt-manager-0.6.0-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.


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