[Libvir] Remote & the problem with qemu deadlock

Richard W.M. Jones rjones at redhat.com
Thu Apr 19 10:49:23 UTC 2007

Daniel Veillard wrote:
> On Wed, Apr 18, 2007 at 04:33:58PM +0100, Richard W.M. Jones wrote:
>> Daniel Veillard wrote:
>>>  Can we recognize that the connection is on localhost and just serve
>>> the request directly and synchronously instead ?
>> Yes you can.  In real terms what this would mean is that all the 
>> functions in qemu_internal.c are changed so that they become:
>> static int qemuDestroyDomain(virDomainPtr domain) {
>>     qemud_packet_client req;
>>     qemud_packet_server reply;
>>     qemuPrivatePtr priv = (qemuPrivatePtr) domain->conn->privateData;
>>     req.data.type = QEMUD_CLIENT_PKT_DOMAIN_DESTROY;
>>     req.data.qemud_packet_client_data_u.domainDestroyRequest.id = 
>> domain->id;
>>     /* some code to get the fake server & client, and then: */
>>     qemudDispatchDomainDestroy (server, client, req, rep);
>>     /* followed by some code to decode the fake "reply packet" */
>> #else /* existing code: */
>>     if (qemuProcessRequest(domain->conn, priv->qemud_fd, NULL, &req, 
>> &reply) < 0) {
>>         return -1;
>>     }
>>     return 0;
>> #endif
>> }
>> So it can be done but qemu_internal is sure going to look ugly afterwards.
>   Maybe you can centralize the dispatcher one level up and keep it like
> a driver, this could avoid the issue, no ?

The individual driver calls (qemuDestroyDomain, etc.) are called from 
the driver table, and since the qemud calls aren't compatible I can't 
see how to do it except to special-case every call.

The real issue though is summarised in the attached diagram.  I'm 
proposing that we don't hack qemu_internal in the above way (top 
diagram, dot-dash line) when in the long term that should all be going 
away (bottom diagram).  Note that this hack only affects 
qemu-over-remote.  Current usage of qemu continues same as before.


Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421

Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.
Registered in England and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David
Owens (Ireland)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qemu-paths.png
Type: image/png
Size: 11474 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070419/ffb4fd23/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070419/ffb4fd23/attachment-0001.bin>

More information about the libvir-list mailing list