It will need to be called from a place above its current definition. Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- src/qemu/qemu_migration.c | 88 +++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2e87db883e..e8e0474558 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5262,6 +5262,50 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver, } +static int +qemuMigrationSrcPerformResume(virQEMUDriver *driver, + virConnectPtr conn, + virDomainObj *vm, + const char *uri, + qemuMigrationParams *migParams, + const char *cookiein, + int cookieinlen, + char **cookieout, + int *cookieoutlen, + unsigned int flags) +{ + int ret; + + VIR_DEBUG("vm=%p, uri=%s", vm, uri); + + if (!qemuMigrationAnyCanResume(vm, VIR_ASYNC_JOB_MIGRATION_OUT, flags, + QEMU_MIGRATION_PHASE_BEGIN_RESUME)) + return -1; + + if (qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM_RESUME) < 0) + return -1; + + virCloseCallbacksUnset(driver->closeCallbacks, vm, + qemuMigrationAnyConnectionClosed); + qemuDomainCleanupRemove(vm, qemuProcessCleanupMigrationJob); + + ret = qemuMigrationSrcPerformNative(driver, vm, NULL, uri, + cookiein, cookieinlen, + cookieout, cookieoutlen, flags, + 0, NULL, NULL, 0, NULL, migParams, NULL); + + if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn, + qemuMigrationAnyConnectionClosed) < 0) + ret = -1; + + if (ret < 0) + ignore_value(qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_POSTCOPY_FAILED)); + + qemuMigrationJobContinue(vm, qemuProcessCleanupMigrationJob); + return ret; +} + + /* This is essentially a re-impl of virDomainMigrateVersion2 * from libvirt.c, but running in source libvirtd context, * instead of client app context & also adding in tunnel @@ -6074,50 +6118,6 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver, } -static int -qemuMigrationSrcPerformResume(virQEMUDriver *driver, - virConnectPtr conn, - virDomainObj *vm, - const char *uri, - qemuMigrationParams *migParams, - const char *cookiein, - int cookieinlen, - char **cookieout, - int *cookieoutlen, - unsigned int flags) -{ - int ret; - - VIR_DEBUG("vm=%p, uri=%s", vm, uri); - - if (!qemuMigrationAnyCanResume(vm, VIR_ASYNC_JOB_MIGRATION_OUT, flags, - QEMU_MIGRATION_PHASE_BEGIN_RESUME)) - return -1; - - if (qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM_RESUME) < 0) - return -1; - - virCloseCallbacksUnset(driver->closeCallbacks, vm, - qemuMigrationAnyConnectionClosed); - qemuDomainCleanupRemove(vm, qemuProcessCleanupMigrationJob); - - ret = qemuMigrationSrcPerformNative(driver, vm, NULL, uri, - cookiein, cookieinlen, - cookieout, cookieoutlen, flags, - 0, NULL, NULL, 0, NULL, migParams, NULL); - - if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn, - qemuMigrationAnyConnectionClosed) < 0) - ret = -1; - - if (ret < 0) - ignore_value(qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_POSTCOPY_FAILED)); - - qemuMigrationJobContinue(vm, qemuProcessCleanupMigrationJob); - return ret; -} - - /* * This implements perform phase of v3 migration protocol. */ -- 2.39.0