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

Re: [libvirt] [PATCH] parallels: don't forget to unlock domain after successful virDomainObjListFindByUUID call



On 22.04.2015 17:25, Maxim Nestratov wrote:
> Also a typo is fixed (s/detached/attached/)
> 
> Signed-off-by: Maxim Nestratov mnestratov parallels com
> ---
>  src/parallels/parallels_driver.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
> index 46e6c3e..41908a5 100644
> --- a/src/parallels/parallels_driver.c
> +++ b/src/parallels/parallels_driver.c
> @@ -1081,7 +1081,7 @@ static int parallelsDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
>      privdom = virDomainObjListFindByUUID(privconn->domains, dom->uuid);
>      if (privdom == NULL) {
>          parallelsDomNotFoundError(dom);
> -        goto cleanup;
> +        return -1;
>      }
>  
>      if (!(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
> @@ -1120,13 +1120,14 @@ static int parallelsDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
>          break;
>      default:
>          virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
> -                       _("device type '%s' cannot be detached"),
> +                       _("device type '%s' cannot be attached"),

Technically, this should be in a separate patch. But I'll let it slip
this time.

>                         virDomainDeviceTypeToString(dev->type));
>          break;
>      }
>  
>      ret = 0;
>   cleanup:
> +    virObjectUnlock(privdom);
>      return ret;
>  }
>  
> 

ACKed and pushed.

Michal


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