提交 9172d0ec 编写于 作者: R Richard W.M. Jones

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.
上级 b4f7816b
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.
Mon Jun 11 12:48:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/qemu_internal.c: QEMU client-side modifications to
......
......@@ -5,23 +5,28 @@ UUID=$(shell uuidgen)
sbin_PROGRAMS = libvirt_qemud
libvirt_qemud_SOURCES = qemud.c internal.h protocol.h \
libvirt_qemud_SOURCES = \
qemud.c internal.h \
driver.c driver.h \
dispatch.c dispatch.h \
conf.c conf.h \
bridge.c bridge.h \
iptables.c iptables.h \
uuid.c uuid.h \
buf.c buf.h
buf.c buf.h \
protocol.h protocol.c \
remote_protocol.h remote_protocol.c \
remote.c
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
libvirt_qemud_CFLAGS = \
-I$(top_srcdir)/include -I$(top_builddir)/include $(LIBXML_CFLAGS) \
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
-DSYSCONF_DIR="\"$(sysconfdir)\"" \
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
libvirt_qemud_LDFLAGS = $(WARN_CFLAGS) $(LIBXML_LIBS) $(SYSFS_LIBS)
libvirt_qemud_DEPENDENCIES =
libvirt_qemud_LDADD =
libvirt_qemud_DEPENDENCIES = ../src/libvirt.la
libvirt_qemud_LDADD = ../src/libvirt.la
install-data-local:
mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
......@@ -41,7 +46,41 @@ uninstall-local:
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
EXTRA_DIST = libvirtd.in default-network.xml
# Distribute the generated files so that rpcgen isn't required on the
# target machine (although almost any Unix machine will have it).
EXTRA_DIST = libvirtd.in default-network.xml \
protocol.x remote_protocol.x \
protocol.c protocol.h \
remote_protocol.c remote_protocol.h \
remote_dispatch_prototypes.h \
remote_dispatch_localvars.h \
remote_dispatch_proc_switch.h
.x.c:
rm -f $@
rpcgen -c -o $@ $<
mv $@ $@.bak
perl -w rpcgen_fix.pl < $@.bak > $@
.x.h:
rm -f $@
rpcgen -h -o $@ $<
protocol.c: protocol.h
remote_protocol.c: remote_protocol.h
remote.c: remote_dispatch_prototypes.h \
remote_dispatch_localvars.h \
remote_dispatch_proc_switch.h
remote_dispatch_prototypes.h: remote_generate_stubs.pl remote_protocol.x
perl -w remote_generate_stubs.pl -i remote_protocol.x > $@
remote_dispatch_localvars.h: remote_generate_stubs.pl remote_protocol.x
perl -w remote_generate_stubs.pl -v remote_protocol.x > $@
remote_dispatch_proc_switch.h: remote_generate_stubs.pl remote_protocol.x
perl -w remote_generate_stubs.pl -w remote_protocol.x > $@
if LIBVIRT_INIT_SCRIPTS_RED_HAT
initdir = $(sysconfdir)/rc.d/init.d
......
......@@ -42,7 +42,6 @@
#include <libvirt/virterror.h>
#include "protocol.h"
#include "internal.h"
#include "conf.h"
#include "driver.h"
......
此差异已折叠。
......@@ -29,7 +29,7 @@
int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
struct qemud_packet *in, struct qemud_packet *out);
struct qemud_packet_client_data *in, struct qemud_packet_server_data *out);
#endif
......
......@@ -27,8 +27,11 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include "protocol.h"
#include "remote_protocol.h"
#include "bridge.h"
#include "iptables.h"
......@@ -58,15 +61,6 @@ typedef enum {
#endif
} qemudLogPriority;
typedef enum {
QEMUD_DIR_CONFIG = 0,
QEMUD_DIR_AUTOSTART,
QEMUD_DIR_NETWORK_CONFIG,
QEMUD_DIR_NETWORK_AUTOSTART,
QEMUD_N_CONFIG_DIRS
} qemudConfigDirType;
/* Different types of QEMU acceleration possible */
enum qemud_vm_virt_type {
QEMUD_VIRT_QEMU,
......@@ -277,22 +271,61 @@ struct qemud_network {
struct qemud_network *next;
};
enum qemud_mode {
QEMUD_MODE_RX_HEADER,
QEMUD_MODE_RX_PAYLOAD,
QEMUD_MODE_TX_PACKET,
QEMUD_MODE_TLS_HANDSHAKE,
};
/* These have to remain compatible with gnutls_record_get_direction. */
enum qemud_tls_direction {
QEMUD_TLS_DIRECTION_READ = 0,
QEMUD_TLS_DIRECTION_WRITE = 1,
};
/* Stores the per-client connection state */
struct qemud_client {
int magic;
int fd;
int readonly;
struct qemud_packet incoming;
unsigned int incomingReceived;
struct qemud_packet outgoing;
unsigned int outgoingSent;
int tx;
enum qemud_mode mode;
struct sockaddr_storage addr;
socklen_t addrlen;
/* If set, TLS is required on this socket. */
int tls;
gnutls_session_t session;
enum qemud_tls_direction direction;
unsigned int incomingSerial;
unsigned int outgoingSerial;
char buffer [REMOTE_MESSAGE_MAX];
unsigned int bufferLength;
unsigned int bufferOffset;
/* This is only valid if a remote open call has been made on this
* connection, otherwise it will be NULL. Also if remote close is
* called, it will be set back to NULL if that succeeds.
*/
virConnectPtr conn;
struct qemud_client *next;
};
#define QEMUD_CLIENT_MAGIC 0x7788aaee
struct qemud_socket {
int fd;
int readonly;
/* If set, TLS is required on this socket. */
int tls;
struct qemud_socket *next;
};
......@@ -315,7 +348,6 @@ struct qemud_server {
struct qemud_network *networks;
brControl *brctl;
iptablesContext *iptables;
char configDirs[QEMUD_N_CONFIG_DIRS][PATH_MAX];
char *configDir;
char *autostartDir;
char *networkConfigDir;
......@@ -347,6 +379,9 @@ void qemudLog(int priority, const char *fmt, ...)
#define qemudDebug(fmt, ...) do {} while(0)
#endif
void remoteDispatchClientRequest (struct qemud_server *server,
struct qemud_client *client);
static inline int
qemudIsActiveVM(struct qemud_vm *vm)
{
......
此差异已折叠。
此差异已折叠。
/* -*- c -*-
* protocol_xdr.x: wire protocol message format & data structures
*
* Copyright (C) 2006, 2007 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Daniel P. Berrange <berrange@redhat.com>
*/
const QEMUD_UUID_RAW_LEN = 16;
const QEMUD_MAX_NAME_LEN = 50;
const QEMUD_MAX_XML_LEN = 4096;
/*#define QEMUD_MAX_IFNAME_LEN IF_NAMESIZE */
const QEMUD_MAX_IFNAME_LEN = 50;
const QEMUD_MAX_NUM_DOMAINS = 100;
const QEMUD_MAX_NUM_NETWORKS = 100;
/*
* Damn, we can't do multiplcation when declaring
* constants with XDR !
* These two should be QEMUD_MAX_NUM_DOMAIN * QEMUD_MAX_NAME_LEN
*/
const QEMUD_MAX_DOMAINS_NAME_BUF = 5000;
const QEMUD_MAX_NETWORKS_NAME_BUF = 5000;
const QEMUD_MAX_ERROR_LEN = 1024;
/* Possible guest VM states */
enum qemud_domain_runstate {
QEMUD_STATE_RUNNING = 1,
QEMUD_STATE_PAUSED,
QEMUD_STATE_STOPPED
};
/* Message sent by a client */
enum qemud_packet_client_data_type {
QEMUD_CLIENT_PKT_GET_VERSION,
QEMUD_CLIENT_PKT_GET_NODEINFO,
QEMUD_CLIENT_PKT_LIST_DOMAINS,
QEMUD_CLIENT_PKT_NUM_DOMAINS,
QEMUD_CLIENT_PKT_DOMAIN_CREATE,
QEMUD_CLIENT_PKT_DOMAIN_LOOKUP_BY_ID,
QEMUD_CLIENT_PKT_DOMAIN_LOOKUP_BY_UUID,
QEMUD_CLIENT_PKT_DOMAIN_LOOKUP_BY_NAME,
QEMUD_CLIENT_PKT_DOMAIN_SUSPEND,
QEMUD_CLIENT_PKT_DOMAIN_RESUME,
QEMUD_CLIENT_PKT_DOMAIN_DESTROY,
QEMUD_CLIENT_PKT_DOMAIN_GET_INFO,
QEMUD_CLIENT_PKT_DOMAIN_SAVE,
QEMUD_CLIENT_PKT_DOMAIN_RESTORE,
QEMUD_CLIENT_PKT_DUMP_XML,
QEMUD_CLIENT_PKT_LIST_DEFINED_DOMAINS,
QEMUD_CLIENT_PKT_NUM_DEFINED_DOMAINS,
QEMUD_CLIENT_PKT_DOMAIN_START,
QEMUD_CLIENT_PKT_DOMAIN_DEFINE,
QEMUD_CLIENT_PKT_DOMAIN_UNDEFINE,
QEMUD_CLIENT_PKT_NUM_NETWORKS,
QEMUD_CLIENT_PKT_LIST_NETWORKS,
QEMUD_CLIENT_PKT_NUM_DEFINED_NETWORKS,
QEMUD_CLIENT_PKT_LIST_DEFINED_NETWORKS,
QEMUD_CLIENT_PKT_NETWORK_LOOKUP_BY_UUID,
QEMUD_CLIENT_PKT_NETWORK_LOOKUP_BY_NAME,
QEMUD_CLIENT_PKT_NETWORK_CREATE,
QEMUD_CLIENT_PKT_NETWORK_DEFINE,
QEMUD_CLIENT_PKT_NETWORK_UNDEFINE,
QEMUD_CLIENT_PKT_NETWORK_START,
QEMUD_CLIENT_PKT_NETWORK_DESTROY,
QEMUD_CLIENT_PKT_NETWORK_DUMP_XML,
QEMUD_CLIENT_PKT_NETWORK_GET_BRIDGE_NAME,
QEMUD_CLIENT_PKT_DOMAIN_GET_AUTOSTART,
QEMUD_CLIENT_PKT_DOMAIN_SET_AUTOSTART,
QEMUD_CLIENT_PKT_NETWORK_GET_AUTOSTART,
QEMUD_CLIENT_PKT_NETWORK_SET_AUTOSTART,
QEMUD_CLIENT_PKT_GET_CAPABILITIES,
QEMUD_CLIENT_PKT_MAX
};
/* Messages sent by a server */
enum qemud_packet_server_data_type {
QEMUD_SERVER_PKT_FAILURE = 0,
QEMUD_SERVER_PKT_GET_VERSION,
QEMUD_SERVER_PKT_GET_NODEINFO,
QEMUD_SERVER_PKT_LIST_DOMAINS,
QEMUD_SERVER_PKT_NUM_DOMAINS,
QEMUD_SERVER_PKT_DOMAIN_CREATE,
QEMUD_SERVER_PKT_DOMAIN_LOOKUP_BY_ID,
QEMUD_SERVER_PKT_DOMAIN_LOOKUP_BY_UUID,
QEMUD_SERVER_PKT_DOMAIN_LOOKUP_BY_NAME,
QEMUD_SERVER_PKT_DOMAIN_SUSPEND,
QEMUD_SERVER_PKT_DOMAIN_RESUME,
QEMUD_SERVER_PKT_DOMAIN_DESTROY,
QEMUD_SERVER_PKT_DOMAIN_GET_INFO,
QEMUD_SERVER_PKT_DOMAIN_SAVE,
QEMUD_SERVER_PKT_DOMAIN_RESTORE,
QEMUD_SERVER_PKT_DUMP_XML,
QEMUD_SERVER_PKT_LIST_DEFINED_DOMAINS,
QEMUD_SERVER_PKT_NUM_DEFINED_DOMAINS,
QEMUD_SERVER_PKT_DOMAIN_START,
QEMUD_SERVER_PKT_DOMAIN_DEFINE,
QEMUD_SERVER_PKT_DOMAIN_UNDEFINE,
QEMUD_SERVER_PKT_NUM_NETWORKS,
QEMUD_SERVER_PKT_LIST_NETWORKS,
QEMUD_SERVER_PKT_NUM_DEFINED_NETWORKS,
QEMUD_SERVER_PKT_LIST_DEFINED_NETWORKS,
QEMUD_SERVER_PKT_NETWORK_LOOKUP_BY_UUID,
QEMUD_SERVER_PKT_NETWORK_LOOKUP_BY_NAME,
QEMUD_SERVER_PKT_NETWORK_CREATE,
QEMUD_SERVER_PKT_NETWORK_DEFINE,
QEMUD_SERVER_PKT_NETWORK_UNDEFINE,
QEMUD_SERVER_PKT_NETWORK_START,
QEMUD_SERVER_PKT_NETWORK_DESTROY,
QEMUD_SERVER_PKT_NETWORK_DUMP_XML,
QEMUD_SERVER_PKT_NETWORK_GET_BRIDGE_NAME,
QEMUD_SERVER_PKT_DOMAIN_GET_AUTOSTART,
QEMUD_SERVER_PKT_DOMAIN_SET_AUTOSTART,
QEMUD_SERVER_PKT_NETWORK_GET_AUTOSTART,
QEMUD_SERVER_PKT_NETWORK_SET_AUTOSTART,
QEMUD_SERVER_PKT_GET_CAPABILITIES,
QEMUD_SERVER_PKT_MAX
};
struct qemud_packet_failure_reply {
uint32_t code;
char message[QEMUD_MAX_ERROR_LEN];
};
struct qemud_packet_get_version_reply {
uint32_t versionNum;
};
struct qemud_packet_get_node_info_reply {
char model[32];
uint32_t memory;
uint32_t cpus;
uint32_t mhz;
uint32_t nodes;
uint32_t sockets;
uint32_t cores;
uint32_t threads;
};
struct qemud_packet_get_capabilities_reply {
char xml[QEMUD_MAX_XML_LEN];
};
struct qemud_packet_list_domains_reply {
int32_t numDomains;
int32_t domains[QEMUD_MAX_NUM_DOMAINS];
};
struct qemud_packet_num_domains_reply{
int32_t numDomains;
};
struct qemud_packet_domain_create_request {
char xml[QEMUD_MAX_XML_LEN];
};
struct qemud_packet_domain_create_reply {
int32_t id;
unsigned char uuid[QEMUD_UUID_RAW_LEN];
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_domain_lookup_by_id_request {
int32_t id;
};
struct qemud_packet_domain_lookup_by_id_reply {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_domain_lookup_by_name_request {
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_domain_lookup_by_name_reply {
int32_t id;
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_domain_lookup_by_uuid_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_domain_lookup_by_uuid_reply {
int32_t id;
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_domain_suspend_request {
int32_t id;
};
struct qemud_packet_domain_resume_request {
int32_t id;
};
struct qemud_packet_domain_destroy_request {
int32_t id;
};
struct qemud_packet_domain_get_info_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_domain_get_info_reply {
uint64_t cpuTime;
uint32_t runstate;
uint32_t memory;
uint32_t maxmem;
uint32_t nrVirtCpu;
};
struct qemud_packet_domain_save_request {
int32_t id;
char file[PATH_MAX];
};
struct qemud_packet_domain_restore_request {
char file[PATH_MAX];
};
struct qemud_packet_domain_restore_reply {
int32_t id;
};
struct qemud_packet_domain_dump_xml_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_domain_dump_xml_reply {
char xml[QEMUD_MAX_XML_LEN];
};
struct qemud_packet_list_defined_domains_reply{
uint32_t numDomains;
char domains[QEMUD_MAX_DOMAINS_NAME_BUF];
};
struct qemud_packet_num_defined_domains_reply{
uint32_t numDomains;
};
struct qemud_packet_domain_start_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_domain_start_reply {
int32_t id;
};
struct qemud_packet_domain_define_request {
char xml[QEMUD_MAX_XML_LEN];
};
struct qemud_packet_domain_define_reply {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_domain_undefine_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_num_networks_reply {
uint32_t numNetworks;
};
struct qemud_packet_list_networks_reply {
uint32_t numNetworks;
char networks[QEMUD_MAX_NETWORKS_NAME_BUF];
};
struct qemud_packet_num_defined_networks_reply {
uint32_t numNetworks;
};
struct qemud_packet_list_defined_networks_reply {
uint32_t numNetworks;
char networks[QEMUD_MAX_NETWORKS_NAME_BUF];
};
struct qemud_packet_network_lookup_by_name_request {
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_network_lookup_by_name_reply {
int32_t id;
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_lookup_by_uuid_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_lookup_by_uuid_reply {
int32_t id;
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_network_create_request {
char xml[QEMUD_MAX_XML_LEN];
};
struct qemud_packet_network_create_reply {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_network_define_request {
char xml[QEMUD_MAX_XML_LEN];
};
struct qemud_packet_network_define_reply {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
char name[QEMUD_MAX_NAME_LEN];
};
struct qemud_packet_network_undefine_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_start_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_destroy_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_dump_xml_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_dump_xml_reply {
char xml[QEMUD_MAX_XML_LEN];
};
struct qemud_packet_network_get_bridge_name_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_get_bridge_name_reply {
char ifname[QEMUD_MAX_IFNAME_LEN];
};
struct qemud_packet_domain_get_autostart_request{
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_domain_get_autostart_reply {
uint32_t autostart;
};
struct qemud_packet_domain_set_autostart_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
uint32_t autostart;
};
struct qemud_packet_network_get_autostart_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
};
struct qemud_packet_network_get_autostart_reply {
uint32_t autostart;
};
struct qemud_packet_network_set_autostart_request {
unsigned char uuid[QEMUD_UUID_RAW_LEN];
uint32_t autostart;
};
union qemud_packet_client_data switch (qemud_packet_client_data_type type) {
case QEMUD_CLIENT_PKT_GET_VERSION:
void;
case QEMUD_CLIENT_PKT_GET_NODEINFO:
void;
case QEMUD_CLIENT_PKT_LIST_DOMAINS:
void;
case QEMUD_CLIENT_PKT_NUM_DOMAINS:
void;
case QEMUD_CLIENT_PKT_DOMAIN_CREATE:
qemud_packet_domain_create_request domainCreateRequest;
case QEMUD_CLIENT_PKT_DOMAIN_LOOKUP_BY_ID:
qemud_packet_domain_lookup_by_id_request domainLookupByIDRequest;
case QEMUD_CLIENT_PKT_DOMAIN_LOOKUP_BY_UUID:
qemud_packet_domain_lookup_by_uuid_request domainLookupByUUIDRequest;
case QEMUD_CLIENT_PKT_DOMAIN_LOOKUP_BY_NAME:
qemud_packet_domain_lookup_by_name_request domainLookupByNameRequest;
case QEMUD_CLIENT_PKT_DOMAIN_SUSPEND:
qemud_packet_domain_suspend_request domainSuspendRequest;
case QEMUD_CLIENT_PKT_DOMAIN_RESUME:
qemud_packet_domain_resume_request domainResumeRequest;
case QEMUD_CLIENT_PKT_DOMAIN_DESTROY:
qemud_packet_domain_destroy_request domainDestroyRequest;
case QEMUD_CLIENT_PKT_DOMAIN_GET_INFO:
qemud_packet_domain_get_info_request domainGetInfoRequest;
case QEMUD_CLIENT_PKT_DOMAIN_SAVE:
qemud_packet_domain_save_request domainSaveRequest;
case QEMUD_CLIENT_PKT_DOMAIN_RESTORE:
qemud_packet_domain_restore_request domainRestoreRequest;
case QEMUD_CLIENT_PKT_DUMP_XML:
qemud_packet_domain_dump_xml_request domainDumpXMLRequest;
case QEMUD_CLIENT_PKT_LIST_DEFINED_DOMAINS:
void;
case QEMUD_CLIENT_PKT_NUM_DEFINED_DOMAINS:
void;
case QEMUD_CLIENT_PKT_DOMAIN_START:
qemud_packet_domain_start_request domainStartRequest;
case QEMUD_CLIENT_PKT_DOMAIN_DEFINE:
qemud_packet_domain_define_request domainDefineRequest;
case QEMUD_CLIENT_PKT_DOMAIN_UNDEFINE:
qemud_packet_domain_undefine_request domainUndefineRequest;
case QEMUD_CLIENT_PKT_NUM_NETWORKS:
void;
case QEMUD_CLIENT_PKT_LIST_NETWORKS:
void;
case QEMUD_CLIENT_PKT_NUM_DEFINED_NETWORKS:
void;
case QEMUD_CLIENT_PKT_LIST_DEFINED_NETWORKS:
void;
case QEMUD_CLIENT_PKT_NETWORK_LOOKUP_BY_UUID:
qemud_packet_network_lookup_by_uuid_request networkLookupByUUIDRequest;
case QEMUD_CLIENT_PKT_NETWORK_LOOKUP_BY_NAME:
qemud_packet_network_lookup_by_name_request networkLookupByNameRequest;
case QEMUD_CLIENT_PKT_NETWORK_CREATE:
qemud_packet_network_create_request networkCreateRequest;
case QEMUD_CLIENT_PKT_NETWORK_DEFINE:
qemud_packet_network_define_request networkDefineRequest;
case QEMUD_CLIENT_PKT_NETWORK_UNDEFINE:
qemud_packet_network_undefine_request networkUndefineRequest;
case QEMUD_CLIENT_PKT_NETWORK_START:
qemud_packet_network_start_request networkStartRequest;
case QEMUD_CLIENT_PKT_NETWORK_DESTROY:
qemud_packet_network_destroy_request networkDestroyRequest;
case QEMUD_CLIENT_PKT_NETWORK_DUMP_XML:
qemud_packet_network_dump_xml_request networkDumpXMLRequest;
case QEMUD_CLIENT_PKT_NETWORK_GET_BRIDGE_NAME:
qemud_packet_network_get_bridge_name_request networkGetBridgeNameRequest;
case QEMUD_CLIENT_PKT_DOMAIN_GET_AUTOSTART:
qemud_packet_domain_get_autostart_request domainGetAutostartRequest;
case QEMUD_CLIENT_PKT_DOMAIN_SET_AUTOSTART:
qemud_packet_domain_set_autostart_request domainSetAutostartRequest;
case QEMUD_CLIENT_PKT_NETWORK_GET_AUTOSTART:
qemud_packet_network_get_autostart_request networkGetAutostartRequest;
case QEMUD_CLIENT_PKT_NETWORK_SET_AUTOSTART:
qemud_packet_network_set_autostart_request networkSetAutostartRequest;
case QEMUD_CLIENT_PKT_GET_CAPABILITIES:
void;
};
union qemud_packet_server_data switch (qemud_packet_server_data_type type) {
case QEMUD_SERVER_PKT_FAILURE:
qemud_packet_failure_reply failureReply;
case QEMUD_SERVER_PKT_GET_VERSION:
qemud_packet_get_version_reply getVersionReply;
case QEMUD_SERVER_PKT_GET_NODEINFO:
qemud_packet_get_node_info_reply getNodeInfoReply;
case QEMUD_SERVER_PKT_LIST_DOMAINS:
qemud_packet_list_domains_reply listDomainsReply;
case QEMUD_SERVER_PKT_NUM_DOMAINS:
qemud_packet_num_domains_reply numDomainsReply;
case QEMUD_SERVER_PKT_DOMAIN_CREATE:
qemud_packet_domain_create_reply domainCreateReply;
case QEMUD_SERVER_PKT_DOMAIN_LOOKUP_BY_ID:
qemud_packet_domain_lookup_by_id_reply domainLookupByIDReply;
case QEMUD_SERVER_PKT_DOMAIN_LOOKUP_BY_UUID:
qemud_packet_domain_lookup_by_uuid_reply domainLookupByUUIDReply;
case QEMUD_SERVER_PKT_DOMAIN_LOOKUP_BY_NAME:
qemud_packet_domain_lookup_by_name_reply domainLookupByNameReply;
case QEMUD_SERVER_PKT_DOMAIN_SUSPEND:
void;
case QEMUD_SERVER_PKT_DOMAIN_RESUME:
void;
case QEMUD_SERVER_PKT_DOMAIN_DESTROY:
void;
case QEMUD_SERVER_PKT_DOMAIN_GET_INFO:
qemud_packet_domain_get_info_reply domainGetInfoReply;
case QEMUD_SERVER_PKT_DOMAIN_SAVE:
void;
case QEMUD_SERVER_PKT_DOMAIN_RESTORE:
qemud_packet_domain_restore_reply domainRestoreReply;
case QEMUD_SERVER_PKT_DUMP_XML:
qemud_packet_domain_dump_xml_reply domainDumpXMLReply;
case QEMUD_SERVER_PKT_LIST_DEFINED_DOMAINS:
qemud_packet_list_defined_domains_reply listDefinedDomainsReply;
case QEMUD_SERVER_PKT_NUM_DEFINED_DOMAINS:
qemud_packet_num_defined_domains_reply numDefinedDomainsReply;
case QEMUD_SERVER_PKT_DOMAIN_START:
qemud_packet_domain_start_reply domainStartReply;
case QEMUD_SERVER_PKT_DOMAIN_DEFINE:
qemud_packet_domain_define_reply domainDefineReply;
case QEMUD_SERVER_PKT_DOMAIN_UNDEFINE:
void;
case QEMUD_SERVER_PKT_NUM_NETWORKS:
qemud_packet_num_networks_reply numNetworksReply;
case QEMUD_SERVER_PKT_LIST_NETWORKS:
qemud_packet_list_networks_reply listNetworksReply;
case QEMUD_SERVER_PKT_NUM_DEFINED_NETWORKS:
qemud_packet_num_defined_networks_reply numDefinedNetworksReply;
case QEMUD_SERVER_PKT_LIST_DEFINED_NETWORKS:
qemud_packet_list_defined_networks_reply listDefinedNetworksReply;
case QEMUD_SERVER_PKT_NETWORK_LOOKUP_BY_UUID:
qemud_packet_network_lookup_by_uuid_reply networkLookupByUUIDReply;
case QEMUD_SERVER_PKT_NETWORK_LOOKUP_BY_NAME:
qemud_packet_network_lookup_by_name_reply networkLookupByNameReply;
case QEMUD_SERVER_PKT_NETWORK_CREATE:
qemud_packet_network_create_reply networkCreateReply;
case QEMUD_SERVER_PKT_NETWORK_DEFINE:
qemud_packet_network_define_reply networkDefineReply;
case QEMUD_SERVER_PKT_NETWORK_UNDEFINE:
void;
case QEMUD_SERVER_PKT_NETWORK_START:
void;
case QEMUD_SERVER_PKT_NETWORK_DESTROY:
void;
case QEMUD_SERVER_PKT_NETWORK_DUMP_XML:
qemud_packet_network_dump_xml_reply networkDumpXMLReply;
case QEMUD_SERVER_PKT_NETWORK_GET_BRIDGE_NAME:
qemud_packet_network_get_bridge_name_reply networkGetBridgeNameReply;
case QEMUD_SERVER_PKT_DOMAIN_GET_AUTOSTART:
qemud_packet_domain_get_autostart_reply domainGetAutostartReply;
case QEMUD_SERVER_PKT_DOMAIN_SET_AUTOSTART:
void;
case QEMUD_SERVER_PKT_NETWORK_GET_AUTOSTART:
qemud_packet_network_get_autostart_reply networkGetAutostartReply;
case QEMUD_SERVER_PKT_NETWORK_SET_AUTOSTART:
void;
case QEMUD_SERVER_PKT_GET_CAPABILITIES:
qemud_packet_get_capabilities_reply getCapabilitiesReply;
};
struct qemud_packet_client {
uint32_t serial;
struct qemud_packet_client_data data;
};
struct qemud_packet_server {
uint32_t serial;
uint32_t inReplyTo;
struct qemud_packet_server_data data;
};
/* The first two words in the messages are length and program number
* (previously called "magic"). This makes the protocol compatible
* with the remote protocol, although beyond the first two words
* the protocols are completely different.
*
* Note the length is the total number of bytes in the message
* _including_ the length and program number.
*/
const QEMUD_PROGRAM = 0x20001A64;
const QEMUD_PKT_HEADER_XDR_LEN = 8;
struct qemud_packet_header {
uint32_t length;
uint32_t prog;
};
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册