[libvirt] [PATCH] do not lock vm while allocating memory

Eric Blake eblake at redhat.com
Fri Apr 1 16:24:53 UTC 2011


On 03/30/2011 01:46 AM, Wen Congyang wrote:
> There is no need to lock vm while allocating memory. If allocating
> memory failed, we forgot to unlock vm.
> 
> ---
>  src/qemu/qemu_process.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index e31e1b4..e74e0f1 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -525,8 +525,6 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
>      virDomainEventGraphicsSubjectPtr subject = NULL;
>      int i;
>  
> -    virDomainObjLock(vm);
> -
>      if (VIR_ALLOC(localAddr) < 0)
>          goto no_memory;
>      localAddr->family = localFamily;
> @@ -560,6 +558,7 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
>          subject->nidentity++;
>      }
>  
> +    virDomainObjLock(vm);

ACK.  It only affects the OOM path, but is worth including in 0.9.0.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110401/ef5c75cd/attachment-0001.sig>


More information about the libvir-list mailing list