mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-27 01:55:20 +03:00
domain: virtinst: custom implement _redefine_xmlobj
This commit is contained in:
parent
cfa1a0569b
commit
a6495bb38f
@ -1649,8 +1649,10 @@ class vmmDomainVirtinst(vmmDomain):
|
||||
self._orig_xml = self._backend.get_xml()
|
||||
return self._backend
|
||||
|
||||
def _redefine_xmlobj(self, xmlobj, origxml=None):
|
||||
vmmDomain._redefine_xmlobj(self, xmlobj, origxml=self._orig_xml)
|
||||
def _redefine_xmlobj(self, xmlobj):
|
||||
newxml = xmlobj.get_xml()
|
||||
self.log_redefine_xml_diff(self, self._orig_xml or "", newxml)
|
||||
self._define(newxml)
|
||||
|
||||
def rename_domain(self, new_name):
|
||||
self.define_name(new_name)
|
||||
|
@ -371,19 +371,14 @@ class vmmLibvirtObject(vmmGObject):
|
||||
"""
|
||||
return self.get_xmlobj(inactive=True)
|
||||
|
||||
def _redefine_xmlobj(self, xmlobj, origxml=None):
|
||||
def _redefine_xmlobj(self, xmlobj):
|
||||
"""
|
||||
Redefine the passed xmlobj, which should be generated with
|
||||
self._make_xmlobj_to_define()
|
||||
|
||||
Most subclasses shouldn't touch this, but vmmDomainVirtinst needs to.
|
||||
|
||||
:param origxml: vmmDomainVirtinst uses that field to make sure
|
||||
we detect the actual XML change and log it correctly.
|
||||
"""
|
||||
if not origxml:
|
||||
origxml = self._make_xmlobj_to_define().get_xml()
|
||||
|
||||
origxml = self._make_xmlobj_to_define().get_xml()
|
||||
newxml = xmlobj.get_xml()
|
||||
self.log_redefine_xml_diff(self, origxml, newxml)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user