Commit Graph

24 Commits

Author SHA1 Message Date
Daniel P. Berrange
47cab73499 Split out code for handling incoming method call messages
The remoteDispatchClientRequest() method is currently hardwired to
assume there is only one type of incoming message, a method call.
To allow for alternate types of incoming messags, the code that is
specific to method calls is being split into a separate method
remoteDispatchClientCall

* qemud/dispatch.c: Move method call specific code out into
  remoteDispatchClientCall. Add a helper remoteSerializeError
  for returning error messages to client
2009-07-16 16:09:47 +01:00
Daniel P. Berrange
af4dad0fa2 Change the way client event loop watches are managed
The current qemudRegisterClientEvent() code is used both for
registering the initial socket watch, and updating the already
registered watch. This causes unneccessary complexity in alot
of code which only cares about updating existing watches. The
updating of a watch cannot ever fail, nor is a reference to the
'qemud_server' object required.

This introduces a new qemudUpdateClientEvent() method for that
case, allowing the elimination of unneccessary error checking
and removal of the server back-reference in struct qemud_client.

* qemud/qemud.h: Remove 'server' field from struct qemud_client.
  Add qemudUpdateClientEvent() method. Remove 'update' param
  from qemudRegisterClientEvent method
* qemud/dispatch.c, qemud/qemud.c, qemud/remote.c: Update alot
  of code to use qemudUpdateClientEvent() instead of
  qemudRegisterClientEvent(). Move more logic from remoteRelayDomainEvent
  into remoteDispatchDomainEventSend.
2009-07-16 16:09:47 +01:00
Daniel P. Berrange
c40e14b4be Move queuing of RPC replies into dispatch code
This removes an assumption from qemudWorker() code that every
incoming message will generate a reply.

* qemud/dispatch.c: remoteDispatchClientRequest now has responsibility
  for queuing the reply message to the RPC call
* qemud/qemud.c: Do not queue the RPC call reply in qemudWorker(),
  allowing remoteDispatchClientRequest() to take care of it
2009-07-16 16:09:47 +01:00
Daniel P. Berrange
852fa7d04a Separate code for encoding outgoing remote message headers
Introduces an API for encoding the header field for outgoing messages
allowing some duplicated code to be eliminated

* qemud/dispatch.c, qemud/dispatch.h: add remoteEncodeClientMessageHeader
  for encoding message header. Update remoteDispatchClientRequest to
  use this method.
* qemud/remote.c: Update remoteDispatchDomainEventSend to use the
  generic remoteEncodeClientMessageHeader() for encoding event
  message hedaders. Push some logic from remoteRelayDomainEvent
  down into remoteDispatchDomainEventSend.
2009-07-16 16:09:47 +01:00
Daniel P. Berrange
081c6330b1 Decode incoming request header before invoking dispatch code
Separate the decoding of incoming request header out from the
dispatch code. This will allow later code to making dispatcher
routing decisions based on the header field data.

* qemud/dispatch.c, qemud/dispatch.h: Add remoteDecodeClientMessageHeader
  API for decoding the header of a client message. Update the
  remoteDispatchClientRequest method to assume a pre-decoded
  header.
* qemud/qemud.h: Include a 'remote_message_header' field in
  'struct qemud_client_message' for pre-decoded header data
* qemud/qemud.c: Decode the incoming client message header before
  invoking remoteDispatchClientRequest
2009-07-16 16:09:47 +01:00
Daniel P. Berrange
a147ef3837 Split generic RPC message dispatch code out from remote protocol API handlers
* po/POTFILES.in: Add qemud/dispatch.c
* qemud/dispatch.c, qemud/dispatch.h: Generic code handling dispatch of
  RPC messages.
* qemud/Makefile.am: Add dispatch.c to build
* qemud/qemud.c: Include dispatch.h
* qemud/qemud.h: Remove remoteDispatchClientRequest, remoteRelayDomainEvent
  now in dispatch.h
* qemud/remote.c: Remove remoteDispatchClientRequest, remoteRelayDomainEvent
  now in dispatch.c, and dispatch_args, dispatch_ret, dispatch_fn & dispatch_data
  now in remote.h
* qemud/remote.h: Add typedefs for dispatch_args, dispatch_ret,
  dispatch_fn, dispath_data. Add remoteGetDispatchData() API
2009-07-16 16:09:41 +01:00
Daniel P. Berrange
a78a6602df Move QEMU driver into main libvirt.so and use single daemon for all drivers 2007-06-26 23:48:46 +00:00
Daniel P. Berrange
133fdfe9e8 Move code relating to vm/network lookups into conf.c 2007-06-26 22:42:47 +00:00
Daniel P. Berrange
a041de159f Update to comply with internal driver API 2007-06-26 22:39:53 +00:00
Daniel P. Berrange
b63f8cc9f9 Split up struct qemud_server to move qemu stuff into conf.c 2007-06-26 22:13:21 +00:00
Daniel P. Berrange
498cc57835 Updated to use virError object & APIs for error reporting 2007-06-26 20:51:00 +00:00
Daniel P. Berrange
8ebda57b2e Move capabilities XML generation into driver.c 2007-06-26 19:49:50 +00:00
Richard W.M. Jones
9172d0ec27 Mon Jun 11 12:49:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* qemud/Makefile.am, qemud/dispatch.c, qemud/dispatch.h,
	  qemud/internal.h, qemud/protocol.c,
	  qemud/protocol.h, qemud/protocol.x, qemud/qemud.c:
	  libvirt_qemud server-side modifications to use
	  XDR-based protocol instead of homebrew (Dan Berrange).
	  QEMUD server modified to dispatch calls from remote
	  clients (Richard Jones).  Added TLS support (Richard Jones).
	  Added TCP & IPv6 support (Richard Jones).
	  Additional configuration file, command-line handling, and
	  usage (Richard Jones).
	* qemud/conf.c: Remove unnecessary header file.
2007-06-11 12:04:54 +00:00
Daniel P. Berrange
33134578b3 Fixed two bugs in QEMU impl of capabilities call 2007-03-15 18:23:00 +00:00
Daniel Veillard
635ae38979 * include/libvirt/libvirt.h[.in] include/libvirt/virterror.h
proxy/libvirt_proxy.c qemud/Makefile.am qemud/conf.c qemud/conf.h
  qemud/dispatch.c qemud/internal.h qemud/protocol.h
  src/driver.h src/internal.h src/libvirt.c src/libvirt_sym.version
  src/proxy_internal.c src/proxy_internal.h src/qemu_internal.c
  src/test.c src/virsh.c src/virterror.c src/xen_internal.c
  src/xen_internal.h src/xend_internal.c src/xm_internal.c
  src/xml.h src/xs_internal.c: applied patch from Richard Jones
  adding virConnectGetCapabilities(), plus various small little
  fixes
* docs/*: fixed the api extractor script and regenerated
Daniel
2007-03-15 17:24:56 +00:00
Mark McLoughlin
efe538b709 Fri Feb 23 09:00:13 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/protocol.h: add the (domain/network)(Get/Set)Autostart
        requests and replies to the protocol.

        * src/qemu_internal.c: hookup the qemu driver autostart
        methods

        * qemud/dispatch.c, qemud/driver.[ch], internal.h: add
        the daemon side, but just set an in-memory autostart
        flag for now.
2007-02-23 09:03:25 +00:00
Mark McLoughlin
593d20d400 Fri Feb 23 08:40:52 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/driver.[ch], qemud/dispatch.c: fix the fact that
        qemudDispatchDomainStart() doesn't report an error if the uuid
        lookup fails and also move the uuid lookup into the driver
        so that it matches the way we do Destroy().
2007-02-23 08:41:23 +00:00
Mark McLoughlin
cfa655f9b8 Fri Feb 16 18:28:32 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/qemud.c, qemud/dispatch.c, qemud/internal.h
        qemud/conf.c, qemud/driver.c, configure.in: add a
        qemudLog() function which uses syslog() if we're in daemon
        mode, doesn't output INFO/DEBUG messages unless the
        verbose flag is set and doesn't output DEBUG messages
        unless compiled with --enable-debug. Also, make a first
        pass through fatal errors and add error messages for them.
2007-02-16 18:30:55 +00:00
Mark McLoughlin
f9f7aeb4b7 Thu Feb 15 15:56:32 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/conf.[ch], qemud/dispatch.c, qemud/internal.h,
	  qemud/qemud.c, qemud/driver.c: allow re-defining network
	configs; basically copying dan's patch for domains.
2007-02-15 16:00:16 +00:00
Daniel P. Berrange
2e5e51151c Refactor to allowing changing config of active domains 2007-02-14 17:05:55 +00:00
Mark McLoughlin
8356c43e42 Tue Feb 14 16:17:51 IST 2007 Mark McLoughlin <markmc@redhat.com>
* include/libvirt/libvirt.h.in, src/libvirt.c: add
        virNetworkGetBridgeName() to allow finding out what
        bridge to connect to in order to join a network.

        * src/driver.h: add networkGetBridgeName() to vtable.

        * qemud/protocol.h: add the request and reply to
        the qemud protocol.

        * qemud/dispatch.c, qemud/driver.[ch]: handle them
        here.

        * src/qemu_internal.c: implement GetBridgeName()
        in the qemu driver.

        * src/libvirt_sym.version: add new symbol.
2007-02-14 16:20:38 +00:00
Mark McLoughlin
f391be00e9 Tue Feb 14 15:52:34 EST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/protocol.h: add the protocol for virtual networks

        * qemud/dispatch.c: implement the protocol

        * qemud/driver.[ch]: add stubs for the driver

        * qemud/internal.h: add struct qemud_network

        * src/qemu_internal.c: add a virtual networks driver
2007-02-14 15:54:10 +00:00
Mark McLoughlin
6a639b917f Tue Feb 14 14:40:52 EST 2007 Mark McLoughlin <markmc@redhat.com
* qemud/conf.c, qemud/dispatch.c, qemud/driver.c,
          qemud/qemud.c: include autoconf's config.h
2007-02-14 15:42:55 +00:00
Daniel P. Berrange
23ad665cb0 Added QEMU support 2007-02-14 01:40:09 +00:00