Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
libvirt.18121
e39c66d3-libxl-fix-p2p-migration.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File e39c66d3-libxl-fix-p2p-migration.patch of Package libvirt.18121
commit e39c66d3ce3e65170a1db1324eb1fb8e57d82ecb Author: Jim Fehlig <jfehlig@suse.com> Date: Tue Aug 28 17:13:54 2018 -0600 libxl: fix logic in P2P migration libxlDoMigrateSrcP2P() performs all phases of the migration protocol for peer-to-peer migration. Unfortunately the logic was a bit flawed since it is possible to skip the confirm phase after a successfull begin and prepare phase. Fix the logic to always call the confirm phase after a successful begin and perform. Skip the confirm phase if begin or perform fail. Signed-off-by: Jim Fehlig <jfehlig@suse.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com> Index: libvirt-2.0.0/src/libxl/libxl_migration.c =================================================================== --- libvirt-2.0.0.orig/src/libxl/libxl_migration.c +++ libvirt-2.0.0/src/libxl/libxl_migration.c @@ -667,18 +667,10 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr char *cookieout = NULL; int cookieoutlen; bool cancelled = true; + bool notify_source = true; virErrorPtr orig_err = NULL; int ret = -1; - dom_xml = libxlDomainMigrationBegin(sconn, vm, xmlin, - &cookieout, &cookieoutlen); - if (!dom_xml) - goto cleanup; - - if (virTypedParamsAddString(¶ms, &nparams, &maxparams, - VIR_MIGRATE_PARAM_DEST_XML, dom_xml) < 0) - goto cleanup; - if (dname && virTypedParamsAddString(¶ms, &nparams, &maxparams, VIR_MIGRATE_PARAM_DEST_NAME, dname) < 0) @@ -689,6 +681,19 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr VIR_MIGRATE_PARAM_URI, uri) < 0) goto cleanup; + dom_xml = libxlDomainMigrationBegin(sconn, vm, xmlin, + &cookieout, &cookieoutlen); + /* + * If dom_xml is non-NULL the begin phase has succeeded, and the + * confirm phase must be called to cleanup the migration operation. + */ + if (!dom_xml) + goto cleanup; + + if (virTypedParamsAddString(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_DEST_XML, dom_xml) < 0) + goto confirm; + /* We don't require the destination to have P2P support * as it looks to be normal migration from the receiver perpective. */ @@ -701,7 +706,7 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr virObjectLock(vm); if (ret == -1) - goto cleanup; + goto confirm; if (uri_out) { if (virTypedParamsReplaceString(¶ms, &nparams, @@ -719,8 +724,10 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr ret = libxlDomainMigrationPerform(driver, vm, NULL, NULL, uri_out, NULL, flags); - if (ret < 0) + if (ret < 0) { + notify_source = false; orig_err = virSaveLastError(); + } cancelled = (ret < 0); @@ -748,12 +755,15 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr if (!orig_err) orig_err = virSaveLastError(); - VIR_DEBUG("Confirm3 cancelled=%d vm=%p", cancelled, vm); - ret = libxlDomainMigrationConfirm(driver, vm, flags, cancelled); - - if (ret < 0) - VIR_WARN("Guest %s probably left in 'paused' state on source", - vm->def->name); + confirm: + if (notify_source) { + VIR_DEBUG("Confirm3 cancelled=%d vm=%p", cancelled, vm); + ret = libxlDomainMigrationConfirm(driver, vm, flags, cancelled); + + if (ret < 0) + VIR_WARN("Guest %s probably left in 'paused' state on source", + vm->def->name); + } cleanup: if (ddomain) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor