mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Convert libvirtd over to the new RPC handling APIs
This guts the libvirtd daemon, removing all its networking and RPC handling code. Instead it calls out to the new virServerPtr APIs for all its RPC & networking work As a fallout all libvirtd daemon error reporting now takes place via the normal internal error reporting APIs. There is no need to call separate error reporting APIs in RPC code, nor should code use VIR_WARN/VIR_ERROR for reporting fatal problems anymore. * daemon/qemu_dispatch_*.h, daemon/remote_dispatch_*.h: Remove old generated dispatcher code * daemon/qemu_dispatch.h, daemon/remote_dispatch.h: New dispatch code * daemon/dispatch.c, daemon/dispatch.h: Remove obsoleted code * daemon/remote.c, daemon/remote.h: Rewrite for new dispatch APIs * daemon/libvirtd.c, daemon/libvirtd.h: Remove all networking code * daemon/stream.c, daemon/stream.h: Update for new APIs * daemon/Makefile.am: Link to libvirt-net-rpc-server.la
This commit is contained in:
@@ -24,62 +24,20 @@
|
||||
#ifndef __LIBVIRTD_REMOTE_H__
|
||||
# define __LIBVIRTD_REMOTE_H__
|
||||
|
||||
|
||||
# include "libvirtd.h"
|
||||
|
||||
typedef union {
|
||||
# include "remote_dispatch_args.h"
|
||||
} dispatch_args;
|
||||
verify(sizeof(dispatch_args) > 0);
|
||||
|
||||
typedef union {
|
||||
# include "remote_dispatch_ret.h"
|
||||
} dispatch_ret;
|
||||
verify(sizeof(dispatch_ret) > 0);
|
||||
|
||||
typedef union {
|
||||
# include "qemu_dispatch_args.h"
|
||||
} qemu_dispatch_args;
|
||||
verify(sizeof(qemu_dispatch_args) > 0);
|
||||
|
||||
typedef union {
|
||||
# include "qemu_dispatch_ret.h"
|
||||
} qemu_dispatch_ret;
|
||||
verify(sizeof(qemu_dispatch_ret) > 0);
|
||||
# include "remote_protocol.h"
|
||||
# include "rpc/virnetserverprogram.h"
|
||||
# include "rpc/virnetserverclient.h"
|
||||
|
||||
|
||||
extern virNetServerProgramProc remoteProcs[];
|
||||
extern size_t remoteNProcs;
|
||||
extern virNetServerProgramErrorHander remoteErr;
|
||||
|
||||
/**
|
||||
* When the RPC handler is called:
|
||||
*
|
||||
* - Server object is unlocked
|
||||
* - Client object is unlocked
|
||||
*
|
||||
* Both must be locked before use. Server lock must
|
||||
* be held before attempting to lock client.
|
||||
*
|
||||
* Without any locking, it is safe to use:
|
||||
*
|
||||
* 'conn', 'rerr', 'args and 'ret'
|
||||
*/
|
||||
typedef int (*dispatch_fn) (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
dispatch_args *args,
|
||||
dispatch_ret *ret);
|
||||
|
||||
typedef struct {
|
||||
dispatch_fn fn;
|
||||
xdrproc_t args_filter;
|
||||
xdrproc_t ret_filter;
|
||||
} dispatch_data;
|
||||
|
||||
|
||||
const dispatch_data const *remoteGetDispatchData(int proc);
|
||||
const dispatch_data const *qemuGetDispatchData(int proc);
|
||||
|
||||
extern virNetServerProgramProc qemuProcs[];
|
||||
extern size_t qemuNProcs;
|
||||
extern virNetServerProgramErrorHander qemuErr;
|
||||
|
||||
int remoteClientInitHook(virNetServerPtr srv,
|
||||
virNetServerClientPtr client);
|
||||
|
||||
#endif /* __LIBVIRTD_REMOTE_H__ */
|
||||
|
||||
Reference in New Issue
Block a user