304b81595d
Windows2008 guest with virtio disk and network device (kvm) - Update to virt-manager 0.9.0 * Use a hiding toolbar for fullscreen mode * Use libguestfs to show guest packagelist and more (Richard W.M. Jones) * Basic 'New VM' wizard support for LXC guests * Remote serial console access (with latest libvirt) * Remote URL guest installs (with latest libvirt) * Add Hardware: Support <filesystem> devices * Add Hardware: Support <smartcard> devices (Marc-André Lureau) * Enable direct interface selection for qemu/kvm (Gerhard Stenzel) * Allow viewing and changing disk serial number - Update to virtinst 0.600.0 * virt-install: Various improvements to enable LXC/container guests: * New --filesystem option for <filesystem> devices * New --init option for container <init> path * New --container option (similar to --paravirt or --hvm) * virt-install: Make --location remotely (with latest libvirt) * virt-install: New --smartcard option for <smartcard> devices * (Marc-André Lureau) * virt-install: New --numatune option for building guest <numatune> XML * virt-install: option to set --disk error_policy= * virt-install: option to set --disk serial= OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=59
72 lines
3.0 KiB
Diff
72 lines
3.0 KiB
Diff
Index: virt-manager-0.9.0/src/virtManager/addhardware.py
|
|
===================================================================
|
|
--- virt-manager-0.9.0.orig/src/virtManager/addhardware.py
|
|
+++ virt-manager-0.9.0/src/virtManager/addhardware.py
|
|
@@ -1021,6 +1021,18 @@ class vmmAddHardware(vmmGObjectUI):
|
|
self._dev.get_xml_config()
|
|
logging.debug("Adding device:\n" + self._dev.get_xml_config())
|
|
|
|
+ # If vm is active, Try to hotplug the device and modify persistent
|
|
+ # config in one go
|
|
+ if self.vm.is_active():
|
|
+ try:
|
|
+ self.vm.attach_device_flags(self._dev, 3)
|
|
+ return (False, None)
|
|
+ except Exception, e:
|
|
+ logging.debug("Could not hotplug device and modify persistent "
|
|
+ "config at the same time: %s" % str(e))
|
|
+ logging.debug("Trying the operations seperately ...")
|
|
+
|
|
+ # Try hotplug then modify persistent config
|
|
# Hotplug device
|
|
attach_err = False
|
|
try:
|
|
Index: virt-manager-0.9.0/src/virtManager/details.py
|
|
===================================================================
|
|
--- virt-manager-0.9.0.orig/src/virtManager/details.py
|
|
+++ virt-manager-0.9.0/src/virtManager/details.py
|
|
@@ -2242,6 +2242,17 @@ class vmmDetails(vmmGObjectUI):
|
|
text1=(_("Are you sure you want to remove this device?"))):
|
|
return
|
|
|
|
+ # If vm is running, try to hot remove the device and modify
|
|
+ # persistent config in one go
|
|
+ if self.vm.is_active():
|
|
+ try:
|
|
+ self.vm.detach_device_flags(dev_type, dev_id_info, 3)
|
|
+ return
|
|
+ except Exception, e:
|
|
+ logging.debug("Could not hot remove device and modify "
|
|
+ "persistent config at the same time: %s" % str(e))
|
|
+ logging.debug("Trying the operations seperately ...")
|
|
+
|
|
# Define the change
|
|
try:
|
|
self.vm.remove_device(dev_id_info)
|
|
Index: virt-manager-0.9.0/src/virtManager/domain.py
|
|
===================================================================
|
|
--- virt-manager-0.9.0.orig/src/virtManager/domain.py
|
|
+++ virt-manager-0.9.0/src/virtManager/domain.py
|
|
@@ -697,6 +697,10 @@ class vmmDomain(vmmLibvirtObject):
|
|
devxml = devobj.get_xml_config()
|
|
self._backend.attachDevice(devxml)
|
|
|
|
+ def attach_device_flags(self, devobj, flags):
|
|
+ xml = devobj.get_xml_config()
|
|
+ self._backend.attachDeviceFlags(xml, flags)
|
|
+
|
|
def detach_device(self, devobj):
|
|
"""
|
|
Hotunplug device from running guest
|
|
@@ -715,6 +719,10 @@ class vmmDomain(vmmLibvirtObject):
|
|
xml = devobj.get_xml_config()
|
|
self._backend.updateDeviceFlags(xml, flags)
|
|
|
|
+ def detach_device_flags(self, devtype, dev_id_info, flags):
|
|
+ xml = self._get_device_xml(devtype, dev_id_info)
|
|
+ self._backend.detachDeviceFlags(xml, flags)
|
|
+
|
|
def hotplug_vcpus(self, vcpus):
|
|
vcpus = int(vcpus)
|
|
if vcpus != self.vcpu_count():
|