2011/5/24 Daniel P. Berrange <berrange@xxxxxxxxxx>: > When doing migration, if an error occurs in Perform, it must not > be overwritten during Finish/Confirm steps. If an error occurs > in Finish, it must not be overwritten in Confirm. > > Previous commit a9d12c2444e43a0d3e5135eb15b4b62a7c011427 added > code to qemudDomainMigrateFinish2 to preserve the error. This > is not the right place, because it is not applicable in non-p2p > migration. The src/libvirt.c virDomainMigrateV2/3 methods need > code to preserve errors for non-p2p migration, while the > doPeer2PeerMigrate2 and doPeer2PeerMigrate3 methods contain > code to preverse errors for p2p migration. > > Remove the bogus error preservation from qemudDomainMigrateFinish2 > and qemudDomainMigrateFinish3. > > Fix virDomainMigrateV3 and doPeer2PeerMigrate3 so that they > preserve any error hit during the Finish3 step, before invoking > Confirm3. > > Finally if qemuMigrationFinish fails to resume the CPUs, it must > preserve the error before tearing down the VM, so that VM cleanup > doesn't overwrite it. > > * src/libvirt.c: Preserve error before invoking Confirm3 > * src/qemu/qemu_driver.c: Remove bogus error preservation > Âcode in qemudDomainMigrateFinish2/qemudDomainMigrateFinish3 > * src/qemu/qemu_migration.c: Preserve error before invoking Confirm3 > Âand after resume fails in qemuMigrationFinish. > --- > Âsrc/libvirt.c       |  Â6 ++++++ > Âsrc/qemu/qemu_driver.c  Â|  24 ------------------------ > Âsrc/qemu/qemu_migration.c |  23 ++++++++++++++++++++--- > Â3 files changed, 26 insertions(+), 27 deletions(-) > diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c > index 280b8cb..a0365ac 100644 > --- a/src/qemu/qemu_migration.c > +++ b/src/qemu/qemu_migration.c > @@ -2382,6 +2394,11 @@ cleanup: >   if (event) >     qemuDomainEventQueue(driver, event); >   qemuMigrationCookieFree(mig); > +  Âif (orig_err) { > +    ÂvirSetError(orig_err); > +    ÂvirFreeError(orig_err); > +    Âorig_err = virGetLastError(); > +  Â} >   return dom; > Â} The last virGetLastError isn't necessary and can be removed, can't it? ACK. Matthias -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list