File virtman-autorestart.diff of Package virt-manager

Index: virt-manager-0.8.5/src/virtManager/details.py
===================================================================
--- virt-manager-0.8.5.orig/src/virtManager/details.py
+++ virt-manager-0.8.5/src/virtManager/details.py
@@ -1397,8 +1397,15 @@ class vmmDetails(gobject.GObject):
                                           self.vm.hotplug_both_mem,
                                           (curmem, maxmem))
 
-    # Boot device / Autostart
+    # Boot device
     def config_boot_options_apply(self):
+        bootdevs = self.get_config_boot_devs()
+        return self._change_config_helper(self.vm.set_boot_device,
+                                          (bootdevs,))
+
+    # Autostart - See bnc#624250 - L3: virt-manager doesn't update
+    #             "Autostart" setting in vm configuration correctly
+    def update_on_xend_start(self):
         auto = self.window.get_widget("config-autostart")
 
         if auto.get_property("sensitive"):
@@ -1407,11 +1414,6 @@ class vmmDetails(gobject.GObject):
             except Exception, e:
                 self.err.show_err((_("Error changing autostart value: %s") %
                                    str(e)), "".join(traceback.format_exc()))
-                return False
-
-        bootdevs = self.get_config_boot_devs()
-        return self._change_config_helper(self.vm.set_boot_device,
-                                          (bootdevs,))
 
     # CDROM
     def change_storage_media(self, dev_id_info, newpath, _type=None):
@@ -1570,6 +1572,9 @@ class vmmDetails(gobject.GObject):
             else:
                 self.err.show_info(_("These changes will take effect after "
                                      "the next guest reboot."))
+
+        self.update_on_xend_start()
+
         return True
 
     ########################