Re: [PATCH 2/3] qemu: Don't access vm->priv on unlocked domain

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

 



On 11/06/2013 02:06 PM, Michal Privoznik wrote:
> Since 86d90b3a (yes, my patch; again) we are supporting NBD storage
> migration. However, on error recovery path we got the steps reversed.
> The correct order is: return NBD port to the virPortAllocator and then
> either unlock the vm or remove it from the driver. Not vice versa.
> 
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_migration.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 4f35a7a..13d0808 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -2450,13 +2450,14 @@ cleanup:
>      VIR_FORCE_CLOSE(dataFD[0]);
>      VIR_FORCE_CLOSE(dataFD[1]);
>      if (vm) {
> -        if (ret >= 0 || vm->persistent)
> -            virObjectUnlock(vm);
> -        else
> -            qemuDomainRemoveInactive(driver, vm);
>          if (ret < 0) {
>              virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
>              priv->nbdPort = 0;
> +        } else {
> +            if (vm->persistent)
> +                virObjectUnlock(vm);
> +            else
> +                qemuDomainRemoveInactive(driver, vm);
>          }
>      }
>      if (event)
> 

On second thought, this doesn't unlock the VM if (ret < 0) && (vm->persistent).

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]