Re: [libvirt] [PATCH] Fix threading problems in python bindings

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

 



2009/11/25 Daniel P. Berrange <berrange@xxxxxxxxxx>:
> * libvirt-override.c: Add many missing calls to allow threading
>  when entering C code, otherwise python blocks & then deadlocks
>  when we have an async event to dispatch back into python code
> ---
>  python/libvirt-override.c |  106 ++++++++++++++++++++++++++++++++++++++++----
>  1 files changed, 96 insertions(+), 10 deletions(-)
>
> diff --git a/python/libvirt-override.c b/python/libvirt-override.c
> index b885190..0f7db9c 100644
> --- a/python/libvirt-override.c
> +++ b/python/libvirt-override.c
[...]
> @@ -418,10 +456,15 @@ libvirt_virDomainPinVcpu(PyObject *self ATTRIBUTE_UNUSED,
>             VIR_UNUSE_CPU(cpumap, i);
>     }
>
> -    virDomainPinVcpu(domain, vcpu, cpumap, cpumaplen);
> +    LIBVIRT_BEGIN_ALLOW_THREADS;
> +    i_retval = virDomainPinVcpu(domain, vcpu, cpumap, cpumaplen);
> +    LIBVIRT_END_ALLOW_THREADS;
>     Py_DECREF(truth);
>     free(cpumap);
>
> +    if (i_retval < 0)
> +        return VIR_PY_INT_FAIL;
> +
>     return VIR_PY_INT_SUCCESS;
>  }
>

You should at least mention this additional fix in the commit message.

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]