domain: Remove the description/title hotplug hacks

We would unconditionally read VM description/hotplug from the inactive
domain XML, this allowed us to emulate metadata hotplug where it wasn't
implemented. However this means we end up doing many needless XMLDesc
calls, which slows down connection startup for low latency connections.

Since SetMetadata has been in libvirt for 2 years now, drop this hack.
This commit is contained in:
Cole Robinson 2014-09-12 08:57:13 -04:00
parent fb671b4d92
commit f36d2ed960

View File

@ -960,9 +960,6 @@ class vmmDomain(vmmLibvirtObject):
self._backend.setMaxMemory(val) self._backend.setMaxMemory(val)
def _hotplug_metadata(val, mtype): def _hotplug_metadata(val, mtype):
if not self.conn.check_support(
self.conn.SUPPORT_DOMAIN_SET_METADATA, self._backend):
return
flags = (libvirt.VIR_DOMAIN_AFFECT_LIVE | flags = (libvirt.VIR_DOMAIN_AFFECT_LIVE |
libvirt.VIR_DOMAIN_AFFECT_CONFIG) libvirt.VIR_DOMAIN_AFFECT_CONFIG)
self._backend.setMetadata(mtype, val, None, None, flags) self._backend.setMetadata(mtype, val, None, None, flags)
@ -1097,12 +1094,9 @@ class vmmDomain(vmmLibvirtObject):
return self.get_name() return self.get_name()
def get_title(self): def get_title(self):
return self.get_xmlobj(inactive=True).title return self.get_xmlobj().title
def get_description(self): def get_description(self):
# Always show the inactive <description>, let's us fake hotplug return self.get_xmlobj().description
# for a field that's strictly metadata
return self.get_xmlobj(inactive=True).description
def get_memory(self): def get_memory(self):
return int(self.get_xmlobj().memory) return int(self.get_xmlobj().memory)