提交 0355de2e 编写于 作者: J Jiri Denemark

qemuProcessReconnect: Avoid relabeling images after migration

Restarting libvirtd on the source host at the end of migration when a
domain is already running on the destination would cause image labels to
be reset effectively killing the domain. Commit e8d0166e fixed similar
issue on the destination host, but kept the source always resetting the
labels, which was mostly correct except for the specific case handled by
this patch.

https://bugzilla.redhat.com/show_bug.cgi?id=1343858Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 ee3ea86b
......@@ -2951,7 +2951,8 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
virConnectPtr conn,
qemuMigrationJobPhase phase,
virDomainState state,
int reason)
int reason,
unsigned int *stopFlags)
{
bool postcopy = state == VIR_DOMAIN_PAUSED &&
(reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
......@@ -3015,6 +3016,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
case QEMU_MIGRATION_PHASE_CONFIRM3:
/* migration completed, we need to kill the domain here */
*stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED;
return -1;
}
......@@ -3040,7 +3042,8 @@ static int
qemuProcessRecoverJob(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn,
const struct qemuDomainJobObj *job)
const struct qemuDomainJobObj *job,
unsigned int *stopFlags)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainState state;
......@@ -3051,7 +3054,7 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver,
switch (job->asyncJob) {
case QEMU_ASYNC_JOB_MIGRATION_OUT:
if (qemuProcessRecoverMigrationOut(driver, vm, conn, job->phase,
state, reason) < 0)
state, reason, stopFlags) < 0)
return -1;
break;
......@@ -3398,7 +3401,7 @@ qemuProcessReconnect(void *opaque)
if (qemuProcessRefreshBalloonState(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
goto error;
if (qemuProcessRecoverJob(driver, obj, conn, &oldjob) < 0)
if (qemuProcessRecoverJob(driver, obj, conn, &oldjob, &stopFlags) < 0)
goto error;
if (qemuProcessUpdateDevices(driver, obj) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册