* src/driver.h: add new driver functions virDrvNumOfDefinedInterfaces
and virDrvListDefinedInterfaces
* src/libvirt.c: implements the entry points, calling new driver
functions
* qemud/remote.c qemud/remote_dispatch_args.h qemud/remote_protocol.[chx]
qemud/remote_dispatch_prototypes.h qemud/remote_dispatch_ret.h
qemud/remote_dispatch_table.h src/remote_internal.c: implement the
client/server side of the RPC
The 'remote_message_header' struct has a mis-leadingly named
field 'direction'. It is really a reflection of the type of
message, and some types can be sent in either direction. Thus
the field is more accurately named 'type'. No function change.
* qemud/remote_protocol.x: Rename 'direction' to 'type' in
'remote_message_header. Write better docs describing the
message header field semantics & usage
* qemud/remote_protocol.c, qemud/remote_protocol.h: Regenerate
* qemud/remote.c, qemud/dispatch.c, src/remote_internal.c
Update to reflect rename of 'direction' to 'type'
All incoming messages currently get routed to the generic method
remoteDispatchClientRequest() for processing. To allow incoming
data stream messages to bypass this and be routed to a specific
location, a concept of dispatch filters is introduced.
* qemud/qemud.h: Add a qemud_client_filter struct and a callback
qemud_client_filter_func. Maintain a list of filters on every
struct qemud_client
* qemud/qemud.c: Move remoteDecodeClientMessageHeader() out of
qemudWorker() into qemudDispatchClientRead(). Check registered
message filters in qemudDispatchClientRead() to decide where
to send incoming messages for dispatch.
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
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.
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
The naming convention for structs used in the RPC layer is for
incoming requests to be called XXXX_args, and the associated
outgoing reply to be called XXXX_ret. Asynchronously emitted
messages (eg events) are re-using the XXXX_ret naming scheme.
This patch changes that such that async messages are XXXX_msg,
and stops adding entries for them in the dispatch table, avoiding
the need for a dummy no-op implementation.
* qemud/remote.c: Remove dummy remoteDispatchDomainEvent, no
longer required. Update to replace remote_domain_event_ret
with xdr_remote_domain_event_msg
* qemud/remote_protocol.x: Rename remote_domain_event_ret to
remote_domain_event_msg
* qemud/remote_generate_stubs.pl: Adding handling for new
XXX_msg structs.
* src/remote_internal.c: Rename remote_domain_event_ret to
remote_domain_event_msg
* qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_ret.h,
qemud/remote_dispatch_table.h, qemud/remote_protocol.h,
qemud/remote_protocol.c: auto-regenerate
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.
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
by running this command:
git ls-files -z | xargs -0 perl -pi -0777 -e 's/\n\n+$/\n/'
This is in preparation for a more strict make syntax-check
rule that will detect trailing blank lines.
* qemud/remote.c: Send back the actual libvirt connection error
rather than formatting a generic error for security driver
methods
* src/libvirt.c: Fix virDomainGetSecurityLabel, and
virNodeGetSecurityModel to correctly set the error on
the virConnectPtr object, and raise a full error rather
than warning when not supported
* docs/logging.html[.in] qemud/libvirtd.conf qemud/qemud.c
src/logging.[ch]: cleanup the logging code and docs to remove
all references to log level 0, cleanup hardcoded values and add
a default VIR_LOG_DEFAULT value, patch by Amy Griffis
daniel
* src/opennebula/one_conf.[ch] src/opennebula/one_driver.[ch]:
the OpenNebula driver
* configure.in include/libvirt/virterror.h qemud/Makefile.am
qemud/qemud.c src/Makefile.am src/domain_conf.[ch] src/driver.h
src/libvirt.c src/virterror.c: integration of the OpenNebula
driver in the libvirt infrastructure
* AUTHORS: add Abel Miguez Rodriguez
daniel
* qemud/qemud.c src/console.c src/network_driver.c
src/node_device_conf.c src/node_device_hal.c src/storage_conf.c
src/util.c: cleanup of some direct stderr logging
daniel
* qemud/remote.c qemud/remote_dispatch_args.h
qemud/remote_dispatch_prototypes.h qemud/remote_dispatch_table.h
qemud/remote_protocol.c qemud/remote_protocol.h
qemud/remote_protocol.x src/remote_internal.c: Implement
attach/reattach/reset in the remote driver, patch by Mark
McLoughlin.
Daniel
bridge.c: In function 'brSetInetAddr':
bridge.c:665: error: dereferencing pointer '({anonymous})' does break strict-aliasing rules
bridge.c:665: note: initialized from here
bridge.c:666: error: dereferencing pointer '({anonymous})' does break strict-aliasing rules
bridge.c:666: note: initialized from here
Fix qemud.c warnings with gcc-4.4
qemud.c: In function ‘remoteListenTCP’:
qemud.c:675: error: dereferencing pointer ‘sa.72’ does break strict-aliasing rules
qemud.c:675: note: initialized from here
qemud.c:678: error: dereferencing pointer ‘sa.73’ does break strict-aliasing rules
qemud.c:678: note: initialized from here
Before this change, the unix socket directory was hard-coded
to be e.g., /var/run/libvirt for euid==0 and ~/.libvirt otherwise.
With this change, you may now specify that directory in libvirtd's
config file via a line like this: unix_sock_dir = "/var/run/libvirt".
This is essential for running tests that do not impinge on any
existing libvirtd process, and in running tests in parallel.
* qemud/libvirtd.conf (unix_sock_dir): Add comment and example.
* qemud/qemud.h (struct qemud_server) [logDir]: Change type
from char[PATH_MAX] to char*.
* qemud/qemud.c (unix_sock_dir): New global
(remoteReadConfigFile): Set the global.
(qemudInitPaths): Use the global, unix_sock_dir, if non-NULL.
One minor improvement: unlink both sockets or none, never
just one of them.
(qemudCleanup): Free logDir.
(main): Use the new global rather than hard-coding "/run/libvirt".
* qemud/libvirtd.aug (sock_acl_entry): Add "unix_sock_dir".