mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Simplify the Xen domain get XML driver method
The xenUnifiedDomainGetXMLDesc driver can assume that the XM and XenD drivers are always present Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
7c21e500a4
commit
970092dcde
@ -1117,23 +1117,17 @@ xenUnifiedDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
||||
{
|
||||
xenUnifiedPrivatePtr priv = dom->conn->privateData;
|
||||
|
||||
if (dom->id == -1 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
||||
if (priv->opened[XEN_UNIFIED_XM_OFFSET])
|
||||
return xenXMDomainGetXMLDesc(dom, flags);
|
||||
if (dom->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
||||
return xenXMDomainGetXMLDesc(dom, flags);
|
||||
} else {
|
||||
if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
|
||||
char *cpus, *res;
|
||||
xenUnifiedLock(priv);
|
||||
cpus = xenDomainUsedCpus(dom);
|
||||
xenUnifiedUnlock(priv);
|
||||
res = xenDaemonDomainGetXMLDesc(dom, flags, cpus);
|
||||
VIR_FREE(cpus);
|
||||
return res;
|
||||
}
|
||||
char *cpus, *res;
|
||||
xenUnifiedLock(priv);
|
||||
cpus = xenDomainUsedCpus(dom);
|
||||
xenUnifiedUnlock(priv);
|
||||
res = xenDaemonDomainGetXMLDesc(dom, flags, cpus);
|
||||
VIR_FREE(cpus);
|
||||
return res;
|
||||
}
|
||||
|
||||
virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1610,17 +1610,11 @@ xenDaemonDomainGetXMLDesc(virDomainPtr domain,
|
||||
unsigned int flags,
|
||||
const char *cpus)
|
||||
{
|
||||
xenUnifiedPrivatePtr priv = domain->conn->privateData;
|
||||
virDomainDefPtr def;
|
||||
char *xml;
|
||||
|
||||
/* Flags checked by virDomainDefFormat */
|
||||
|
||||
if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
||||
/* fall-through to the next driver to handle */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(def = xenDaemonDomainFetch(domain->conn,
|
||||
domain->id,
|
||||
domain->name,
|
||||
|
Loading…
Reference in New Issue
Block a user