mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
Simplify the Xen domain autostart driver method
Unconditionally call into the XenD or XM drivers for autostart handling, since they are guaranteed to be open
This commit is contained in:
parent
a8f3222a40
commit
7329f91f26
@ -1475,16 +1475,10 @@ xenUnifiedDomainGetAutostart(virDomainPtr dom, int *autostart)
|
||||
{
|
||||
xenUnifiedPrivatePtr priv = dom->conn->privateData;
|
||||
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
||||
if (priv->opened[XEN_UNIFIED_XM_OFFSET])
|
||||
return xenXMDomainGetAutostart(dom, autostart);
|
||||
} else {
|
||||
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
|
||||
return xenDaemonDomainGetAutostart(dom, autostart);
|
||||
}
|
||||
|
||||
virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
return -1;
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
|
||||
return xenXMDomainGetAutostart(dom, autostart);
|
||||
else
|
||||
return xenDaemonDomainGetAutostart(dom, autostart);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -1492,16 +1486,10 @@ xenUnifiedDomainSetAutostart(virDomainPtr dom, int autostart)
|
||||
{
|
||||
xenUnifiedPrivatePtr priv = dom->conn->privateData;
|
||||
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
||||
if (priv->opened[XEN_UNIFIED_XM_OFFSET])
|
||||
return xenXMDomainSetAutostart(dom, autostart);
|
||||
} else {
|
||||
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
|
||||
return xenDaemonDomainSetAutostart(dom, autostart);
|
||||
}
|
||||
|
||||
virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
return -1;
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
|
||||
return xenXMDomainSetAutostart(dom, autostart);
|
||||
else
|
||||
return xenDaemonDomainSetAutostart(dom, autostart);
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -2540,13 +2540,6 @@ xenDaemonDomainGetAutostart(virDomainPtr domain, int *autostart)
|
||||
{
|
||||
struct sexpr *root;
|
||||
const char *tmp;
|
||||
xenUnifiedPrivatePtr priv = domain->conn->privateData;
|
||||
|
||||
/* xm_internal.c (the support for defined domains from /etc/xen
|
||||
* config files used by old Xen) will handle this.
|
||||
*/
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
|
||||
return -1;
|
||||
|
||||
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
|
||||
if (root == NULL) {
|
||||
@ -2573,13 +2566,6 @@ xenDaemonDomainSetAutostart(virDomainPtr domain, int autostart)
|
||||
virBuffer buffer = VIR_BUFFER_INITIALIZER;
|
||||
char *content = NULL;
|
||||
int ret = -1;
|
||||
xenUnifiedPrivatePtr priv = domain->conn->privateData;
|
||||
|
||||
/* xm_internal.c (the support for defined domains from /etc/xen
|
||||
* config files used by old Xen) will handle this.
|
||||
*/
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
|
||||
return -1;
|
||||
|
||||
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
|
||||
if (root == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user