提交 73b3e0b7 编写于 作者: D Daniel P. Berrange

Fix resume on destination when doing non-live tunnelled migration

Before running perform in peer-2-peer migration, the current
guest state must be recorded, so that non-live migration can
currently unpause a running guest on completion.

* src/qemu/qemu_migration.c: Move check for offline guest
  to fix non-live migration
上级 13555416
...@@ -1313,6 +1313,13 @@ static int doNativeMigrate(struct qemud_driver *driver, ...@@ -1313,6 +1313,13 @@ static int doNativeMigrate(struct qemud_driver *driver,
goto cleanup; goto cleanup;
} }
/* Before EnterMonitor, since qemuProcessStopCPUs already does that */
if (!(flags & VIR_MIGRATE_LIVE) &&
virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
if (qemuMigrationSetOffline(driver, vm) < 0)
goto cleanup;
}
qemuDomainObjEnterMonitorWithDriver(driver, vm); qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (resource > 0 && if (resource > 0 &&
qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) { qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) {
...@@ -1540,6 +1547,13 @@ static int doTunnelMigrate(struct qemud_driver *driver, ...@@ -1540,6 +1547,13 @@ static int doTunnelMigrate(struct qemud_driver *driver,
VIR_WARN("unable to provide data for graphics client relocation"); VIR_WARN("unable to provide data for graphics client relocation");
/* 3. start migration on source */ /* 3. start migration on source */
/* Before EnterMonitor, since qemuProcessStopCPUs already does that */
if (!(flags & VIR_MIGRATE_LIVE) &&
virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
if (qemuMigrationSetOffline(driver, vm) < 0)
goto cleanup;
}
qemuDomainObjEnterMonitorWithDriver(driver, vm); qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (resource > 0 && if (resource > 0 &&
qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) { qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) {
...@@ -2048,11 +2062,6 @@ int qemuMigrationPerform(struct qemud_driver *driver, ...@@ -2048,11 +2062,6 @@ int qemuMigrationPerform(struct qemud_driver *driver,
priv->jobInfo.type = VIR_DOMAIN_JOB_UNBOUNDED; priv->jobInfo.type = VIR_DOMAIN_JOB_UNBOUNDED;
resume = virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING; resume = virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING;
if (!(flags & VIR_MIGRATE_LIVE) &&
virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
if (qemuMigrationSetOffline(driver, vm) < 0)
goto endjob;
}
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) { if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
if (cookieinlen) { if (cookieinlen) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册