mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
b5961c53d9
commit
48610ebecc
@ -887,8 +887,6 @@ static int
|
|||||||
xenUnifiedDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml,
|
xenUnifiedDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
xenUnifiedPrivatePtr priv = dom->conn->privateData;
|
|
||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
if (dxml) {
|
if (dxml) {
|
||||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||||
@ -896,9 +894,7 @@ xenUnifiedDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
|
|
||||||
return xenDaemonDomainSave(dom, to);
|
return xenDaemonDomainSave(dom, to);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -934,7 +930,6 @@ xenUnifiedDomainManagedSave(virDomainPtr dom, unsigned int flags)
|
|||||||
if (!name)
|
if (!name)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
|
|
||||||
ret = xenDaemonDomainSave(dom, name);
|
ret = xenDaemonDomainSave(dom, name);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -982,8 +977,6 @@ static int
|
|||||||
xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
|
xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
|
||||||
const char *dxml, unsigned int flags)
|
const char *dxml, unsigned int flags)
|
||||||
{
|
{
|
||||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
|
||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
if (dxml) {
|
if (dxml) {
|
||||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||||
@ -991,9 +984,7 @@ xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
|
|
||||||
return xenDaemonDomainRestore(conn, from);
|
return xenDaemonDomainRestore(conn, from);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1005,11 +996,7 @@ xenUnifiedDomainRestore(virConnectPtr conn, const char *from)
|
|||||||
static int
|
static int
|
||||||
xenUnifiedDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
|
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 xenDaemonDomainCoreDump(dom, to, flags);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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 */
|
/* We can't save the state of Domain-0, that would mean stopping it too */
|
||||||
if (domain->id == 0) {
|
if (domain->id == 0) {
|
||||||
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
|
_("Cannot save host domain"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user