提交 48610ebe 编写于 作者: D Daniel P. Berrange

Simplify the Xen domain save/restore driver methods

Unconditionally call the XenD APIs for save/restore, since that
driver will always be open.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 b5961c53
......@@ -887,8 +887,6 @@ static int
xenUnifiedDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml,
unsigned int flags)
{
xenUnifiedPrivatePtr priv = dom->conn->privateData;
virCheckFlags(0, -1);
if (dxml) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
......@@ -896,9 +894,7 @@ xenUnifiedDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml,
return -1;
}
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
return xenDaemonDomainSave(dom, to);
return -1;
return xenDaemonDomainSave(dom, to);
}
static int
......@@ -934,8 +930,7 @@ xenUnifiedDomainManagedSave(virDomainPtr dom, unsigned int flags)
if (!name)
goto cleanup;
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
ret = xenDaemonDomainSave(dom, name);
ret = xenDaemonDomainSave(dom, name);
cleanup:
VIR_FREE(name);
......@@ -982,8 +977,6 @@ static int
xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
const char *dxml, unsigned int flags)
{
xenUnifiedPrivatePtr priv = conn->privateData;
virCheckFlags(0, -1);
if (dxml) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
......@@ -991,9 +984,7 @@ xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
return -1;
}
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
return xenDaemonDomainRestore(conn, from);
return -1;
return xenDaemonDomainRestore(conn, from);
}
static int
......@@ -1005,11 +996,7 @@ xenUnifiedDomainRestore(virConnectPtr conn, const char *from)
static int
xenUnifiedDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
{
xenUnifiedPrivatePtr priv = dom->conn->privateData;
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
return xenDaemonDomainCoreDump(dom, to, flags);
return -1;
return xenDaemonDomainCoreDump(dom, to, flags);
}
static int
......
......@@ -1422,6 +1422,8 @@ xenDaemonDomainSave(virDomainPtr domain, const char *filename)
/* We can't save the state of Domain-0, that would mean stopping it too */
if (domain->id == 0) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Cannot save host domain"));
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册