Bug 532216 - virt-manager should disable unimplemented reboot option for qemu/kvm
Summary: virt-manager should disable unimplemented reboot option for qemu/kvm
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 12
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 560678 624195 (view as bug list)
Depends On:
Blocks: F12VirtTarget
TreeView+ depends on / blocked
 
Reported: 2009-10-31 14:22 UTC by Michael Monreal
Modified: 2010-08-21 22:07 UTC (History)
10 users (show)

Fixed In Version: virt-manager-0.8.3-2.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-09 03:55:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Screenshot (74.21 KB, image/png)
2009-10-31 14:22 UTC, Michael Monreal
no flags Details
Screenshot 2 (27.57 KB, image/png)
2009-10-31 14:24 UTC, Michael Monreal
no flags Details

Description Michael Monreal 2009-10-31 14:22:24 UTC
Created attachment 366931 [details]
Screenshot

Pressing "Reboot" in the GUI of a KVM based VM leads to this:

---
Error shutting down domain: this function is not supported by the hypervisor: virDomainReboot

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 609, in reboot_domain
    vm.reboot()
  File "/usr/share/virt-manager/virtManager/domain.py", line 660, in reboot
    self.vm.reboot(0)
  File "/usr/lib/python2.6/site-packages/libvirt.py", line 398, in reboot
    if ret == -1: raise libvirtError ('virDomainReboot() failed', dom=self)
libvirtError: this function is not supported by the hypervisor: virDomainReboot
---

Does KVM really not support reboot? If not, can't virt-manager simply gray out this menu item?

Comment 1 Michael Monreal 2009-10-31 14:24:43 UTC
Created attachment 366932 [details]
Screenshot 2

Depending on the outcome of this bug, the error window should probably be improved, e.g. not have a window title (currently "Error") and a bold headline.

http://library.gnome.org/devel/hig-book/stable/windows-alert.html.en#alerts-error

Comment 2 Chris Lalancette 2009-11-02 08:21:25 UTC
(In reply to comment #0)
> Created an attachment (id=366931) [details]
> Screenshot
> 
> Pressing "Reboot" in the GUI of a KVM based VM leads to this:
> 
> ---
> Error shutting down domain: this function is not supported by the hypervisor:
> virDomainReboot
> 
> Traceback (most recent call last):
>   File "/usr/share/virt-manager/virtManager/engine.py", line 609, in
> reboot_domain
>     vm.reboot()
>   File "/usr/share/virt-manager/virtManager/domain.py", line 660, in reboot
>     self.vm.reboot(0)
>   File "/usr/lib/python2.6/site-packages/libvirt.py", line 398, in reboot
>     if ret == -1: raise libvirtError ('virDomainReboot() failed', dom=self)
> libvirtError: this function is not supported by the hypervisor: virDomainReboot
> ---
> 
> Does KVM really not support reboot? If not, can't virt-manager simply gray out
> this menu item?  

Yeah, at present time, the Qemu/KVM driver in libvirt doesn't actually support reboot.  There's an open bug about it somewhere, but it's not implemented currently.

I do agree that it would be nice if virt-manager greyed out options for things it doesn't support.

Chris Lalancette

Comment 3 Paul Jenner 2009-11-12 20:22:27 UTC
For info, the bug for Qemu/KVM driver support for reboot is bug #496537.

Does not change the point that virt-manager should grey out the option based on missing capability though.

Comment 4 Michael Monreal 2009-11-12 20:26:54 UTC
(In reply to comment #3)
> Does not change the point that virt-manager should grey out the option based on
> missing capability though.  

What about the "Save" menu entry... this does not seem to work with KVM as well?

Comment 5 Cole Robinson 2009-11-15 16:41:00 UTC
'save' is supported, but I believe it was busted until recently. We should only grey out options that are explicitly not implemented for a certain driver.

The larger problem here is that there is no good way to determine if something is supported by a libvirt driver or not. Some functions you can just test, reboot isn't one of them. So we have to hardcode that logic into virt-manager. What happens when reboot is finally implemented for qemu + libvirt? We then need to change virt-manager in lockstep, but also detect the proper libvirt and qemu versions so we don't 'enable' the unimplemented option if run against older versions. That's an annoying road to go down, because if we get detection wrong, we may be disabling reboot support for versions that support it.

We can skip adding the version detection logic, but then we essentially regress this bug for anything accept the latest and greatest libvirt + qemu combo, and it still requires commits to disable and reenable this option in virt-manager, which would then prevent any old versions of virt-manager without the reenable commit from working with latest libvirt + qemu. Crappy situation, huh?

Maybe connection capabilities should export its function table for each driver, so apps can programatically determine whether a function is even implemented or not, and enable/disable things as expected. This would be very useful for virt-manager, and help solve this issue.

Comment 6 Bug Zapper 2009-11-16 14:45:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Cole Robinson 2010-02-27 02:33:20 UTC
*** Bug 560678 has been marked as a duplicate of this bug. ***

Comment 8 Cole Robinson 2010-03-17 20:51:49 UTC
I've committed a fix upstream:

http://hg.fedorahosted.org/hg/virt-manager/rev/fc1360e7ded9

If we attempt a reboot and libvirt says 'not supported', we try to do it manually: request a vm.shutdown(), wait for the state to change, request a vm.startup(). Any user invoked 'shutdown' or 'destroy' will clear the reboot flag: this is how xen works, and I think it's the least confusing mode of operation.

A couple use cases I can see people complaining about:

- User clicks reboot, libvirt doesn't support it, so we run vm.shutdown()
- VM begins shutting down, user closes virt-manager
- VM is not rebooted because virt-manager isn't running, and won't remember
  the reboot flag between runs

- User clicks reboot, libvirt doesn't support it, so we run vm.shutdown()
- gnome-power-manager in the guest pops up, asking 'Do you want to shutdown, restart, log out?'
- User selects 'restart'. VM does a soft restart, which to virt-manager doesn't look like a state change at all. The reboot flag is never cleared.
- Later, user shuts down the VM from inside the guest, and virt-manager reboots it. User says 'WTF?'

A proper reboot impl at the libvirt level could solve both (though I don't think the proper qemu events exist for the latter example at the moment), but virt-manager is stuck. Either way, I think these drawbacks aren't going to be too common, and are offset by the benefit of having some sort of reboot impl. Users are already used to shutdown related flakyness, given that linux guests usually require manual gnome-power-manager intervention when clicking shutdown anyways.

Comment 9 Fedora Update System 2010-03-22 16:33:21 UTC
virt-manager-0.8.3-2.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/virt-manager-0.8.3-2.fc13

Comment 10 Fedora Update System 2010-03-23 23:23:09 UTC
virt-manager-0.8.3-2.fc13 has been pushed to the Fedora 13 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 update virt-manager'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/virt-manager-0.8.3-2.fc13

Comment 11 Fedora Update System 2010-04-09 03:55:22 UTC
virt-manager-0.8.3-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Cole Robinson 2010-08-21 22:07:26 UTC
*** Bug 624195 has been marked as a duplicate of this bug. ***


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