提交 91ac0195 编写于 作者: J Jiri Denemark 提交者: Cole Robinson

qemu: Fix persistent migration of transient domains

While fixing a bug with incorrectly freed memory in commit
v3.1.0-399-g5498aa29, I accidentally broke persistent migration of
transient domains. Before adding qemuDomainDefCopy in the path, the code
just took NULL from vm->newDef and used it as the persistent def, which
resulted in no persistent XML being sent in the migration cookie. This
scenario is perfectly valid and the destination correctly handles it by
using the incoming live definition and storing it as the persistent one.

After the mentioned commit libvirtd would just segfault in the described
scenario.

https://bugzilla.redhat.com/show_bug.cgi?id=1446205Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 59307fad)
上级 ce275361
......@@ -3620,15 +3620,15 @@ qemuMigrationRun(virQEMUDriverPtr driver,
if (flags & VIR_MIGRATE_PERSIST_DEST) {
if (persist_xml) {
persistDef = qemuMigrationPrepareDef(driver, persist_xml,
NULL, NULL);
} else {
persistDef = qemuDomainDefCopy(driver, vm->newDef,
VIR_DOMAIN_XML_SECURE |
VIR_DOMAIN_XML_MIGRATABLE);
if (!(persistDef = qemuMigrationPrepareDef(driver, persist_xml,
NULL, NULL)))
goto cleanup;
} else if (vm->newDef) {
if (!(persistDef = qemuDomainDefCopy(driver, vm->newDef,
VIR_DOMAIN_XML_SECURE |
VIR_DOMAIN_XML_MIGRATABLE)))
goto cleanup;
}
if (!persistDef)
goto cleanup;
}
mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册