[libvirt] [PATCH 1/2] avoid vm to be deleted if qemuConnectMonitor failed
Eric Blake
eblake at redhat.com
Thu Jan 27 20:40:09 UTC 2011
On 01/26/2011 08:17 AM, Daniel P. Berrange wrote:
> On Tue, Jan 25, 2011 at 02:43:43PM +0800, Wen Congyang wrote:
>> The reason of libvirtd cores dump is that:
>> We add vm->refs when we alloc the memory, and decrease it
>> in the function qemuHandleMonitorEOF() in other thread.
>>
>> We add vm->refs in the function qemuConnectMonitor() and
>> decrease it when the vm is inactive.
>>
>> The libvirtd will block in the function qemuMonitorSetCapabilities()
>> because the vm is stopped by signal SIGSTOP. Now the vm->refs is 2.
>>
>> Then we kill the vm by signal SIGKILL. The function
>> qemuMonitorSetCapabilities() failed, and then we will decrease vm->refs
>> in the function qemuMonitorClose().
>> In another thread, mon->fd is broken and the function
>> qemuHandleMonitorEOF() is called.
>>
>
> On closer examination I see why this change is required.
> Normally we would be doing qemuDomainObjBeginJob before
> doing anything with the monitor and that grabs an extra
> reference.
>
> ACK
Pushed.
--
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/20110127/fac508ce/attachment-0001.sig>
More information about the libvir-list
mailing list