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; > > #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 ? Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@xxxxxxxxxx | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/