Re: [PATCH 8/9] Fix preservation of errors across migration steps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]