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

Re: [libvirt] [PATCH 3/5] qemu: migrate: Save MigratePerform error in MigrateFinish.



On Mon, Jan 11, 2010 at 03:34:46PM -0500, Cole Robinson wrote:
> This way we won't squash the original error report in
> MigratePerform, as is done for P2P and Tunneled migration.
> 
> Signed-off-by: Cole Robinson <crobinso redhat com>
> ---
>  src/qemu/qemu_driver.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index daa6f94..fc6b9fa 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -7670,8 +7670,12 @@ qemudDomainMigrateFinish2 (virConnectPtr dconn,
>      virDomainObjPtr vm;
>      virDomainPtr dom = NULL;
>      virDomainEventPtr event = NULL;
> +    virErrorPtr origerr = NULL;
>      int newVM = 1;
>  
> +    /* Migration failed. Save the current error so nothing squashes it */
> +    origerr = virSaveLastError();
> +
>      qemuDriverLock(driver);
>      vm = virDomainFindByName(&driver->domains, dname);
>      if (!vm) {
> @@ -7765,6 +7769,10 @@ endjob:
>          vm = NULL;
>  
>  cleanup:
> +    if (origerr) {
> +        virSetError(origerr);
> +        virFreeError(origerr);
> +    }
>      if (vm)
>          virDomainObjUnlock(vm);
>      if (event)

ACK

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


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