virt-manager/virtman-device-flags.patch
Charles Arnold 898a7107e7 - bnc#868676 - Error changing VM configuration: unsupported
configuration: unknown driver format value 'block' 
  virtinst-xen-drive-type.patch

- bnc#868200 - Unable to complete install: "NoneType' object has no
  attribute '__getitem__" 
  virtinst-detect-suse-distros.patch

- For Xen always have the arch expander expanded.
- For Xen and KVM default to Network install if host was installed
  from the network
- Default to a bridge with an actual inet address if available
  virtinst-modify-gui-defaults.patch
- We are not supporting PV ISO installs with virt-install.
  Drop the following patches
  virtinst-allow-pv-iso-install.patch
  virtman-allow-pv-iso-install.patc

- Upstream bug fixes
  5321d3cd-virtinst-drop-cpu_map-parsing-of-arch-features.patch
  5321d3d0-virtinst-drop-parsing-of-cpu-features.patch
  5321f256-virtinst-use-libvirt-getCPUModelNames.patch
  532255b4-unselect_all-members-before-clear-model.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=152
2014-03-19 15:18:34 +00:00

72 lines
2.9 KiB
Diff

Index: virt-manager-1.0.0/virtManager/addhardware.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/addhardware.py
+++ virt-manager-1.0.0/virtManager/addhardware.py
@@ -1287,6 +1287,18 @@ class vmmAddHardware(vmmGObjectUI):
if controller is not None:
logging.debug("Adding controller:\n%s",
controller.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 ...")
+
# Hotplug device
attach_err = False
try:
Index: virt-manager-1.0.0/virtManager/details.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/details.py
+++ virt-manager-1.0.0/virtManager/details.py
@@ -2280,6 +2280,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-1.0.0/virtManager/domain.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/domain.py
+++ virt-manager-1.0.0/virtManager/domain.py
@@ -898,6 +898,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
@@ -916,6 +920,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():