mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +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,11 +1117,9 @@ xenUnifiedDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
|||||||
{
|
{
|
||||||
xenUnifiedPrivatePtr priv = dom->conn->privateData;
|
xenUnifiedPrivatePtr priv = dom->conn->privateData;
|
||||||
|
|
||||||
if (dom->id == -1 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
if (dom->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
||||||
if (priv->opened[XEN_UNIFIED_XM_OFFSET])
|
|
||||||
return xenXMDomainGetXMLDesc(dom, flags);
|
return xenXMDomainGetXMLDesc(dom, flags);
|
||||||
} else {
|
} else {
|
||||||
if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
|
|
||||||
char *cpus, *res;
|
char *cpus, *res;
|
||||||
xenUnifiedLock(priv);
|
xenUnifiedLock(priv);
|
||||||
cpus = xenDomainUsedCpus(dom);
|
cpus = xenDomainUsedCpus(dom);
|
||||||
@ -1132,10 +1130,6 @@ xenUnifiedDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
xenUnifiedConnectDomainXMLFromNative(virConnectPtr conn,
|
xenUnifiedConnectDomainXMLFromNative(virConnectPtr conn,
|
||||||
|
@ -1610,17 +1610,11 @@ xenDaemonDomainGetXMLDesc(virDomainPtr domain,
|
|||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
const char *cpus)
|
const char *cpus)
|
||||||
{
|
{
|
||||||
xenUnifiedPrivatePtr priv = domain->conn->privateData;
|
|
||||||
virDomainDefPtr def;
|
virDomainDefPtr def;
|
||||||
char *xml;
|
char *xml;
|
||||||
|
|
||||||
/* Flags checked by virDomainDefFormat */
|
/* 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,
|
if (!(def = xenDaemonDomainFetch(domain->conn,
|
||||||
domain->id,
|
domain->id,
|
||||||
domain->name,
|
domain->name,
|
||||||
|
Loading…
Reference in New Issue
Block a user