提交 7329f91f 编写于 作者: D Daniel P. Berrange

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
上级 a8f3222a
......@@ -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])
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return xenXMDomainGetAutostart(dom, autostart);
} else {
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
else
return xenDaemonDomainGetAutostart(dom, autostart);
}
virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
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])
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return xenXMDomainSetAutostart(dom, autostart);
} else {
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
else
return xenDaemonDomainSetAutostart(dom, autostart);
}
virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册