From b2835da3c8554db4e220ff54f937e0c33ce95aca Mon Sep 17 00:00:00 2001 From: coreyberla <88115821+coreyberla@users.noreply.github.com> Date: Wed, 28 Jul 2021 15:02:25 -0700 Subject: [PATCH] libvirtobject: reapply autostart setting after rename Fixes: #204 --- virtManager/object/libvirtobject.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virtManager/object/libvirtobject.py b/virtManager/object/libvirtobject.py index 5833e2809..18c7df620 100644 --- a/virtManager/object/libvirtobject.py +++ b/virtManager/object/libvirtobject.py @@ -102,6 +102,7 @@ class vmmLibvirtObject(vmmGObject): def define_name(self, newname): oldname = self.get_xmlobj().name + oldautostart = self.get_autostart() self.ensure_latest_xml() xmlobj = self._make_xmlobj_to_define() @@ -117,6 +118,7 @@ class vmmLibvirtObject(vmmGObject): try: self._name = newname self.conn.rename_object(self, origxml, newxml) + self.set_autostart(oldautostart) except Exception: # pragma: no cover self._name = oldname raise