[libvirt] [PATCH] unlock the monitor when unwatching the monitor

Eric Blake eblake at redhat.com
Thu Mar 17 23:43:07 UTC 2011


On 03/17/2011 04:54 AM, Daniel P. Berrange wrote:
> On Wed, Mar 16, 2011 at 02:54:28PM +0800, Wen Congyang wrote:
>> Steps to reproduce this bug:
>> # virsh qemu-monitor-command domain 'cpu_set 2 online' --hmp
>> The domain has 2 cpus, and we try to set the third cpu online.
>> The qemu crashes, and this command will hang.
>>
>> The reason is that the refs is not 1 when we unwatch the monitor.
>> We lock the monitor, but we do not unlock it. So virCondWait()
>> will be blocked.
>>

>>      qemuMonitorLock(mon);
>> -    qemuMonitorUnref(mon);
>> +    if (qemuMonitorUnref(mon) > 0)
>> +        qemuMonitorUnlock(mon);
>>  }
> 
> ACK

Pushed.

> 
> We should probably annotate qemuMonitorUnref() (and similar functions)
> with ATTRIBUTE_RETURN_CHECK too

I'm working on that now...

-- 
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/20110317/89279a9b/attachment-0001.sig>


More information about the libvir-list mailing list