Daniel Veillard wrote:
On Wed, Apr 18, 2007 at 04:33:58PM +0100, Richard W.M. Jones wrote:Daniel Veillard wrote: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:Can we recognize that the connection is on localhost and just serve the request directly and synchronously instead ?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;#if QEMU_INTERNAL_IS_REALLY_LINKED_TO_THE_SERVER /* 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.
Rich. -- 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)
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature