mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: rename migration APIs to include Src or Dst in their name
It is very difficult while reading the migration code trying to understand whether a particular function is being called on the src side or the dst side, or either. Putting "Src" or "Dst" in the method names will make this much more obvious. "Any" is used in a few helpers which can be called from both sides. Reviewed-by: John Ferlan <jferlan@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
8f5133f99e
commit
ffb7954f88
@ -754,7 +754,7 @@ qemuStateInitialize(bool privileged,
|
||||
if (!(qemu_driver->sharedDevices = virHashCreate(30, qemuSharedDeviceEntryFree)))
|
||||
goto error;
|
||||
|
||||
if (qemuMigrationErrorInit(qemu_driver) < 0)
|
||||
if (qemuMigrationDstErrorInit(qemu_driver) < 0)
|
||||
goto error;
|
||||
|
||||
if (privileged) {
|
||||
@ -3282,7 +3282,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
|
||||
/* Perform the migration */
|
||||
if (qemuMigrationToFile(driver, vm, fd, compressedpath, asyncJob) < 0)
|
||||
if (qemuMigrationSrcToFile(driver, vm, fd, compressedpath, asyncJob) < 0)
|
||||
goto cleanup;
|
||||
|
||||
/* Touch up file header to mark image complete. */
|
||||
@ -3338,7 +3338,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver,
|
||||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
||||
goto cleanup;
|
||||
|
||||
if (!qemuMigrationIsAllowed(driver, vm, false, 0))
|
||||
if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))
|
||||
goto cleanup;
|
||||
|
||||
if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_SAVE,
|
||||
@ -3893,10 +3893,10 @@ doCoreDump(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!qemuMigrationIsAllowed(driver, vm, false, 0))
|
||||
if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationToFile(driver, vm, fd, compressedpath,
|
||||
ret = qemuMigrationSrcToFile(driver, vm, fd, compressedpath,
|
||||
QEMU_ASYNC_JOB_DUMP);
|
||||
}
|
||||
|
||||
@ -4815,7 +4815,7 @@ processMonitorEOFEvent(virQEMUDriverPtr driver,
|
||||
|
||||
if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) {
|
||||
stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED;
|
||||
qemuMigrationErrorSave(driver, vm->def->name,
|
||||
qemuMigrationDstErrorSave(driver, vm->def->name,
|
||||
qemuMonitorLastError(priv->mon));
|
||||
}
|
||||
|
||||
@ -12109,13 +12109,13 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(def = qemuMigrationPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
if (!(def = qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainMigratePrepareTunnelEnsureACL(dconn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationPrepareTunnel(driver,
|
||||
ret = qemuMigrationDstPrepareTunnel(driver,
|
||||
NULL, 0, NULL, NULL, /* No cookies in v2 */
|
||||
st, &def, origname, flags);
|
||||
|
||||
@ -12158,7 +12158,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(compression = qemuMigrationCompressionParse(NULL, 0, flags)))
|
||||
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virLockManagerPluginUsesState(driver->lockManager)) {
|
||||
@ -12168,7 +12168,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(def = qemuMigrationPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
if (!(def = qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainMigratePrepare2EnsureACL(dconn, def) < 0)
|
||||
@ -12178,7 +12178,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
|
||||
* length was not sufficiently large, causing failures
|
||||
* migrating between old & new libvirtd
|
||||
*/
|
||||
ret = qemuMigrationPrepareDirect(driver,
|
||||
ret = qemuMigrationDstPrepareDirect(driver,
|
||||
NULL, 0, NULL, NULL, /* No cookies */
|
||||
uri_in, uri_out,
|
||||
&def, origname, NULL, 0, NULL, 0,
|
||||
@ -12218,7 +12218,7 @@ qemuDomainMigratePerform(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(compression = qemuMigrationCompressionParse(NULL, 0, flags)))
|
||||
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
@ -12240,7 +12240,7 @@ qemuDomainMigratePerform(virDomainPtr dom,
|
||||
*
|
||||
* Consume any cookie we were able to decode though
|
||||
*/
|
||||
ret = qemuMigrationPerform(driver, dom->conn, vm, NULL,
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, NULL,
|
||||
NULL, dconnuri, uri, NULL, NULL, 0, NULL, 0,
|
||||
compression, &migParams, cookie, cookielen,
|
||||
NULL, NULL, /* No output cookies in v2 */
|
||||
@ -12273,7 +12273,7 @@ qemuDomainMigrateFinish2(virConnectPtr dconn,
|
||||
if (!vm) {
|
||||
virReportError(VIR_ERR_NO_DOMAIN,
|
||||
_("no domain with matching name '%s'"), dname);
|
||||
qemuMigrationErrorReport(driver, dname);
|
||||
qemuMigrationDstErrorReport(driver, dname);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -12286,7 +12286,7 @@ qemuDomainMigrateFinish2(virConnectPtr dconn,
|
||||
* length was not sufficiently large, causing failures
|
||||
* migrating between old & new libvirtd
|
||||
*/
|
||||
dom = qemuMigrationFinish(driver, dconn, vm,
|
||||
dom = qemuMigrationDstFinish(driver, dconn, vm,
|
||||
NULL, 0, NULL, NULL, /* No cookies */
|
||||
flags, retcode, false);
|
||||
|
||||
@ -12320,7 +12320,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return qemuMigrationBegin(domain->conn, vm, xmlin, dname,
|
||||
return qemuMigrationSrcBegin(domain->conn, vm, xmlin, dname,
|
||||
cookieout, cookieoutlen, 0, NULL, flags);
|
||||
}
|
||||
|
||||
@ -12366,7 +12366,7 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = qemuMigrationBegin(domain->conn, vm, xmlin, dname,
|
||||
ret = qemuMigrationSrcBegin(domain->conn, vm, xmlin, dname,
|
||||
cookieout, cookieoutlen,
|
||||
nmigrate_disks, migrate_disks, flags);
|
||||
|
||||
@ -12407,16 +12407,16 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(compression = qemuMigrationCompressionParse(NULL, 0, flags)))
|
||||
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(def = qemuMigrationPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
if (!(def = qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainMigratePrepare3EnsureACL(dconn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationPrepareDirect(driver,
|
||||
ret = qemuMigrationDstPrepareDirect(driver,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
uri_in, uri_out,
|
||||
@ -12483,7 +12483,7 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
|
||||
if (nmigrate_disks < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(compression = qemuMigrationCompressionParse(params, nparams, flags)))
|
||||
if (!(compression = qemuMigrationAnyCompressionParse(params, nparams, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (flags & VIR_MIGRATE_TUNNELLED) {
|
||||
@ -12496,13 +12496,13 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(def = qemuMigrationPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
if (!(def = qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainMigratePrepare3ParamsEnsureACL(dconn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationPrepareDirect(driver,
|
||||
ret = qemuMigrationDstPrepareDirect(driver,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
uri_in, uri_out,
|
||||
@ -12545,13 +12545,13 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(def = qemuMigrationPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
if (!(def = qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainMigratePrepareTunnel3EnsureACL(dconn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationPrepareTunnel(driver,
|
||||
ret = qemuMigrationDstPrepareTunnel(driver,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
st, &def, origname, flags);
|
||||
@ -12598,13 +12598,13 @@ qemuDomainMigratePrepareTunnel3Params(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(def = qemuMigrationPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
if (!(def = qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &origname)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainMigratePrepareTunnel3ParamsEnsureACL(dconn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationPrepareTunnel(driver,
|
||||
ret = qemuMigrationDstPrepareTunnel(driver,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
st, &def, origname, flags);
|
||||
@ -12637,7 +12637,7 @@ qemuDomainMigratePerform3(virDomainPtr dom,
|
||||
|
||||
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
|
||||
|
||||
if (!(compression = qemuMigrationCompressionParse(NULL, 0, flags)))
|
||||
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
|
||||
return -1;
|
||||
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
@ -12648,7 +12648,7 @@ qemuDomainMigratePerform3(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = qemuMigrationPerform(driver, dom->conn, vm, xmlin, NULL,
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, xmlin, NULL,
|
||||
dconnuri, uri, NULL, NULL, 0, NULL, 0,
|
||||
compression, &migParams,
|
||||
cookiein, cookieinlen,
|
||||
@ -12728,7 +12728,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
if (!(migParams = qemuMigrationParams(params, nparams, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(compression = qemuMigrationCompressionParse(params, nparams, flags)))
|
||||
if (!(compression = qemuMigrationAnyCompressionParse(params, nparams, flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
@ -12739,7 +12739,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = qemuMigrationPerform(driver, dom->conn, vm, dom_xml, persist_xml,
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, dom_xml, persist_xml,
|
||||
dconnuri, uri, graphicsuri, listenAddress,
|
||||
nmigrate_disks, migrate_disks, nbdPort,
|
||||
compression, migParams,
|
||||
@ -12779,7 +12779,7 @@ qemuDomainMigrateFinish3(virConnectPtr dconn,
|
||||
if (!vm) {
|
||||
virReportError(VIR_ERR_NO_DOMAIN,
|
||||
_("no domain with matching name '%s'"), dname);
|
||||
qemuMigrationErrorReport(driver, dname);
|
||||
qemuMigrationDstErrorReport(driver, dname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -12788,7 +12788,7 @@ qemuDomainMigrateFinish3(virConnectPtr dconn,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return qemuMigrationFinish(driver, dconn, vm,
|
||||
return qemuMigrationDstFinish(driver, dconn, vm,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
flags, cancelled, true);
|
||||
@ -12827,7 +12827,7 @@ qemuDomainMigrateFinish3Params(virConnectPtr dconn,
|
||||
if (!vm) {
|
||||
virReportError(VIR_ERR_NO_DOMAIN,
|
||||
_("no domain with matching name '%s'"), dname);
|
||||
qemuMigrationErrorReport(driver, dname);
|
||||
qemuMigrationDstErrorReport(driver, dname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -12836,7 +12836,7 @@ qemuDomainMigrateFinish3Params(virConnectPtr dconn,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return qemuMigrationFinish(driver, dconn, vm,
|
||||
return qemuMigrationDstFinish(driver, dconn, vm,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
flags, cancelled, true);
|
||||
@ -12862,7 +12862,7 @@ qemuDomainMigrateConfirm3(virDomainPtr domain,
|
||||
return -1;
|
||||
}
|
||||
|
||||
return qemuMigrationConfirm(domain->conn->privateData, vm, cookiein, cookieinlen,
|
||||
return qemuMigrationSrcConfirm(domain->conn->privateData, vm, cookiein, cookieinlen,
|
||||
flags, cancelled);
|
||||
}
|
||||
|
||||
@ -12890,7 +12890,7 @@ qemuDomainMigrateConfirm3Params(virDomainPtr domain,
|
||||
return -1;
|
||||
}
|
||||
|
||||
return qemuMigrationConfirm(domain->conn->privateData, vm, cookiein, cookieinlen,
|
||||
return qemuMigrationSrcConfirm(domain->conn->privateData, vm, cookiein, cookieinlen,
|
||||
flags, cancelled);
|
||||
}
|
||||
|
||||
@ -13180,13 +13180,13 @@ qemuDomainGetJobInfoMigrationStats(virQEMUDriverPtr driver,
|
||||
jobInfo->status == QEMU_DOMAIN_JOB_STATUS_POSTCOPY) {
|
||||
if (events &&
|
||||
jobInfo->status != QEMU_DOMAIN_JOB_STATUS_ACTIVE &&
|
||||
qemuMigrationFetchStats(driver, vm, QEMU_ASYNC_JOB_NONE,
|
||||
qemuMigrationAnyFetchStats(driver, vm, QEMU_ASYNC_JOB_NONE,
|
||||
jobInfo, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
if (jobInfo->status == QEMU_DOMAIN_JOB_STATUS_ACTIVE &&
|
||||
jobInfo->statsType == QEMU_DOMAIN_JOB_STATS_TYPE_MIGRATION &&
|
||||
qemuMigrationFetchMirrorStats(driver, vm, QEMU_ASYNC_JOB_NONE,
|
||||
qemuMigrationSrcFetchMirrorStats(driver, vm, QEMU_ASYNC_JOB_NONE,
|
||||
jobInfo) < 0)
|
||||
return -1;
|
||||
|
||||
@ -13582,7 +13582,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (!qemuMigrationCapsGet(vm, QEMU_MONITOR_MIGRATION_CAPS_XBZRLE)) {
|
||||
if (!qemuMigrationAnyCapsGet(vm, QEMU_MONITOR_MIGRATION_CAPS_XBZRLE)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("Compressed migration is not supported by "
|
||||
"QEMU binary"));
|
||||
@ -13633,7 +13633,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (!qemuMigrationCapsGet(vm, QEMU_MONITOR_MIGRATION_CAPS_XBZRLE)) {
|
||||
if (!qemuMigrationAnyCapsGet(vm, QEMU_MONITOR_MIGRATION_CAPS_XBZRLE)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("Compressed migration is not supported by "
|
||||
"QEMU binary"));
|
||||
@ -13985,7 +13985,7 @@ qemuDomainSnapshotCreateActiveInternal(virQEMUDriverPtr driver,
|
||||
bool resume = false;
|
||||
int ret = -1;
|
||||
|
||||
if (!qemuMigrationIsAllowed(driver, vm, false, 0))
|
||||
if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
||||
@ -14918,7 +14918,7 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
|
||||
/* do the memory snapshot if necessary */
|
||||
if (memory) {
|
||||
/* check if migration is possible */
|
||||
if (!qemuMigrationIsAllowed(driver, vm, false, 0))
|
||||
if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))
|
||||
goto cleanup;
|
||||
|
||||
/* allow the migration job to be cancelled or the domain to be paused */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,20 @@
|
||||
# include "qemu_conf.h"
|
||||
# include "qemu_domain.h"
|
||||
|
||||
/*
|
||||
* General function naming conventions:
|
||||
*
|
||||
* - qemuMigrationSrcXXX - only runs on source host
|
||||
* - qemuMigrationDstXXX - only runs on dest host
|
||||
* - qemuMigrationAnyXXX - runs on source or dest host
|
||||
*
|
||||
* Exceptions:
|
||||
*
|
||||
* - qemuMigrationParamsXXX - runs on source or dest host
|
||||
* - qemuMigrationOptionXXX - runs on source or dest host
|
||||
* - qemuMigrationJobXXX - runs on source or dest host
|
||||
*/
|
||||
|
||||
typedef struct _qemuMigrationCompression qemuMigrationCompression;
|
||||
typedef qemuMigrationCompression *qemuMigrationCompressionPtr;
|
||||
|
||||
@ -112,11 +126,11 @@ struct _qemuMigrationCompression {
|
||||
};
|
||||
|
||||
qemuMigrationCompressionPtr
|
||||
qemuMigrationCompressionParse(virTypedParameterPtr params,
|
||||
qemuMigrationAnyCompressionParse(virTypedParameterPtr params,
|
||||
int nparams,
|
||||
unsigned long flags);
|
||||
int
|
||||
qemuMigrationCompressionDump(qemuMigrationCompressionPtr compression,
|
||||
qemuMigrationAnyCompressionDump(qemuMigrationCompressionPtr compression,
|
||||
virTypedParameterPtr *params,
|
||||
int *nparams,
|
||||
int *maxparams,
|
||||
@ -134,11 +148,11 @@ qemuMigrationParams(virTypedParameterPtr params,
|
||||
unsigned long flags);
|
||||
|
||||
int
|
||||
qemuMigrationSetOffline(virQEMUDriverPtr driver,
|
||||
qemuMigrationSrcSetOffline(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
char *
|
||||
qemuMigrationBegin(virConnectPtr conn,
|
||||
qemuMigrationSrcBegin(virConnectPtr conn,
|
||||
virDomainObjPtr vm,
|
||||
const char *xmlin,
|
||||
const char *dname,
|
||||
@ -149,13 +163,13 @@ qemuMigrationBegin(virConnectPtr conn,
|
||||
unsigned long flags);
|
||||
|
||||
virDomainDefPtr
|
||||
qemuMigrationPrepareDef(virQEMUDriverPtr driver,
|
||||
qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver,
|
||||
const char *dom_xml,
|
||||
const char *dname,
|
||||
char **origname);
|
||||
|
||||
int
|
||||
qemuMigrationPrepareTunnel(virQEMUDriverPtr driver,
|
||||
qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
||||
const char *cookiein,
|
||||
int cookieinlen,
|
||||
char **cookieout,
|
||||
@ -166,7 +180,7 @@ qemuMigrationPrepareTunnel(virQEMUDriverPtr driver,
|
||||
unsigned long flags);
|
||||
|
||||
int
|
||||
qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
|
||||
qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
|
||||
const char *cookiein,
|
||||
int cookieinlen,
|
||||
char **cookieout,
|
||||
@ -183,7 +197,7 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
|
||||
unsigned long flags);
|
||||
|
||||
int
|
||||
qemuMigrationPerform(virQEMUDriverPtr driver,
|
||||
qemuMigrationSrcPerform(virQEMUDriverPtr driver,
|
||||
virConnectPtr conn,
|
||||
virDomainObjPtr vm,
|
||||
const char *xmlin,
|
||||
@ -207,7 +221,7 @@ qemuMigrationPerform(virQEMUDriverPtr driver,
|
||||
bool v3proto);
|
||||
|
||||
virDomainPtr
|
||||
qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
qemuMigrationDstFinish(virQEMUDriverPtr driver,
|
||||
virConnectPtr dconn,
|
||||
virDomainObjPtr vm,
|
||||
const char *cookiein,
|
||||
@ -219,7 +233,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
bool v3proto);
|
||||
|
||||
int
|
||||
qemuMigrationConfirm(virQEMUDriverPtr driver,
|
||||
qemuMigrationSrcConfirm(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
const char *cookiein,
|
||||
int cookieinlen,
|
||||
@ -227,13 +241,13 @@ qemuMigrationConfirm(virQEMUDriverPtr driver,
|
||||
int cancelled);
|
||||
|
||||
bool
|
||||
qemuMigrationIsAllowed(virQEMUDriverPtr driver,
|
||||
qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
bool remote,
|
||||
unsigned int flags);
|
||||
|
||||
int
|
||||
qemuMigrationToFile(virQEMUDriverPtr driver,
|
||||
qemuMigrationSrcToFile(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
int fd,
|
||||
const char *compressor,
|
||||
@ -241,59 +255,59 @@ qemuMigrationToFile(virQEMUDriverPtr driver,
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
int
|
||||
qemuMigrationCancel(virQEMUDriverPtr driver,
|
||||
qemuMigrationSrcCancel(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
int
|
||||
qemuMigrationFetchStats(virQEMUDriverPtr driver,
|
||||
qemuMigrationAnyFetchStats(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
qemuDomainAsyncJob asyncJob,
|
||||
qemuDomainJobInfoPtr jobInfo,
|
||||
char **error);
|
||||
|
||||
int
|
||||
qemuMigrationErrorInit(virQEMUDriverPtr driver);
|
||||
qemuMigrationDstErrorInit(virQEMUDriverPtr driver);
|
||||
|
||||
void
|
||||
qemuMigrationErrorSave(virQEMUDriverPtr driver,
|
||||
qemuMigrationDstErrorSave(virQEMUDriverPtr driver,
|
||||
const char *name,
|
||||
virErrorPtr err);
|
||||
|
||||
void
|
||||
qemuMigrationErrorReport(virQEMUDriverPtr driver,
|
||||
qemuMigrationDstErrorReport(virQEMUDriverPtr driver,
|
||||
const char *name);
|
||||
|
||||
int
|
||||
qemuMigrationCheckIncoming(virQEMUCapsPtr qemuCaps,
|
||||
qemuMigrationDstCheckProtocol(virQEMUCapsPtr qemuCaps,
|
||||
const char *migrateFrom);
|
||||
|
||||
char *
|
||||
qemuMigrationIncomingURI(const char *migrateFrom,
|
||||
qemuMigrationDstGetURI(const char *migrateFrom,
|
||||
int migrateFd);
|
||||
|
||||
int
|
||||
qemuMigrationRunIncoming(virQEMUDriverPtr driver,
|
||||
qemuMigrationDstRun(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
const char *uri,
|
||||
qemuDomainAsyncJob asyncJob);
|
||||
|
||||
void
|
||||
qemuMigrationPostcopyFailed(virQEMUDriverPtr driver,
|
||||
qemuMigrationAnyPostcopyFailed(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
void
|
||||
qemuMigrationReset(virQEMUDriverPtr driver,
|
||||
qemuMigrationParamsReset(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
qemuDomainAsyncJob job);
|
||||
|
||||
int
|
||||
qemuMigrationFetchMirrorStats(virQEMUDriverPtr driver,
|
||||
qemuMigrationSrcFetchMirrorStats(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
qemuDomainAsyncJob asyncJob,
|
||||
qemuDomainJobInfoPtr jobInfo);
|
||||
|
||||
bool
|
||||
qemuMigrationCapsGet(virDomainObjPtr vm,
|
||||
qemuMigrationAnyCapsGet(virDomainObjPtr vm,
|
||||
qemuMonitorMigrationCaps cap);
|
||||
|
||||
#endif /* __QEMU_MIGRATION_H__ */
|
||||
|
@ -3069,7 +3069,7 @@ qemuProcessRecoverMigrationIn(virQEMUDriverPtr driver,
|
||||
* confirm success or failure yet; killing it seems safest unless
|
||||
* we already started guest CPUs or we were in post-copy mode */
|
||||
if (postcopy) {
|
||||
qemuMigrationPostcopyFailed(driver, vm);
|
||||
qemuMigrationAnyPostcopyFailed(driver, vm);
|
||||
} else if (state != VIR_DOMAIN_RUNNING) {
|
||||
VIR_DEBUG("Killing migrated domain %s", vm->def->name);
|
||||
return -1;
|
||||
@ -3077,7 +3077,7 @@ qemuProcessRecoverMigrationIn(virQEMUDriverPtr driver,
|
||||
break;
|
||||
}
|
||||
|
||||
qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_NONE);
|
||||
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_NONE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3115,11 +3115,11 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
||||
* post-copy mode
|
||||
*/
|
||||
if (postcopy) {
|
||||
qemuMigrationPostcopyFailed(driver, vm);
|
||||
qemuMigrationAnyPostcopyFailed(driver, vm);
|
||||
} else {
|
||||
VIR_DEBUG("Cancelling unfinished migration of domain %s",
|
||||
vm->def->name);
|
||||
if (qemuMigrationCancel(driver, vm) < 0) {
|
||||
if (qemuMigrationSrcCancel(driver, vm) < 0) {
|
||||
VIR_WARN("Could not cancel ongoing migration of domain %s",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -3133,7 +3133,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
||||
* post-copy mode we can use PAUSED_POSTCOPY_FAILED state for this
|
||||
*/
|
||||
if (postcopy)
|
||||
qemuMigrationPostcopyFailed(driver, vm);
|
||||
qemuMigrationAnyPostcopyFailed(driver, vm);
|
||||
break;
|
||||
|
||||
case QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED:
|
||||
@ -3142,7 +3142,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
||||
* as broken in that case
|
||||
*/
|
||||
if (postcopy) {
|
||||
qemuMigrationPostcopyFailed(driver, vm);
|
||||
qemuMigrationAnyPostcopyFailed(driver, vm);
|
||||
} else {
|
||||
VIR_DEBUG("Resuming domain %s after failed migration",
|
||||
vm->def->name);
|
||||
@ -3171,7 +3171,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
||||
}
|
||||
}
|
||||
|
||||
qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_NONE);
|
||||
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_NONE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4142,7 +4142,7 @@ qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps,
|
||||
{
|
||||
qemuProcessIncomingDefPtr inc = NULL;
|
||||
|
||||
if (qemuMigrationCheckIncoming(qemuCaps, migrateFrom) < 0)
|
||||
if (qemuMigrationDstCheckProtocol(qemuCaps, migrateFrom) < 0)
|
||||
return NULL;
|
||||
|
||||
if (VIR_ALLOC(inc) < 0)
|
||||
@ -4151,7 +4151,7 @@ qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps,
|
||||
if (VIR_STRDUP(inc->address, listenAddress) < 0)
|
||||
goto error;
|
||||
|
||||
inc->launchURI = qemuMigrationIncomingURI(migrateFrom, fd);
|
||||
inc->launchURI = qemuMigrationDstGetURI(migrateFrom, fd);
|
||||
if (!inc->launchURI)
|
||||
goto error;
|
||||
|
||||
@ -6348,7 +6348,7 @@ qemuProcessStart(virConnectPtr conn,
|
||||
|
||||
if (incoming &&
|
||||
incoming->deferredURI &&
|
||||
qemuMigrationRunIncoming(driver, vm, incoming->deferredURI, asyncJob) < 0)
|
||||
qemuMigrationDstRun(driver, vm, incoming->deferredURI, asyncJob) < 0)
|
||||
goto stop;
|
||||
|
||||
if (qemuProcessFinishStartup(driver, vm, asyncJob,
|
||||
|
@ -447,7 +447,7 @@ testCompareXMLToArgv(const void *data)
|
||||
goto cleanup;
|
||||
|
||||
if (info->migrateFrom &&
|
||||
!(migrateURI = qemuMigrationIncomingURI(info->migrateFrom,
|
||||
!(migrateURI = qemuMigrationDstGetURI(info->migrateFrom,
|
||||
info->migrateFd)))
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user