2006-06-28 18:19:13 +00:00
|
|
|
/*
|
|
|
|
* proxy.h: common definitions for proxy usage
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* See COPYING.LIB for the License of this software
|
|
|
|
*
|
|
|
|
* Daniel Veillard <veillard@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __LIBVIR_PROXY_H__
|
|
|
|
#define __LIBVIR_PROXY_H__
|
|
|
|
|
Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c,
qemud/remote.c, src/internal.h, src/openvz_conf.c,
src/openvz_driver.c, src/proxy_internal.h, src/qemu_conf.c,
src/qemu_driver.c, src/remote_internal.h, src/test.h, src/util.c,
src/xen_unified.c, src/xen_unified.h, tests/nodeinfotest.c,
tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/reconnect.c,
tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c,
tests/xmconfigtest.c, tests/xml2sexprtest.c:
Change #include <> to #include "" for local includes.
Removed many includes from src/internal.h and put them in
the C files which actually use them.
Removed <ansidecl.h> - unused.
Added a comment around __func__.
Removed a clashing redefinition of VERSION symbol.
All limits (PATH_MAX etc) now done in src/internal.h, so we
don't need to include those headers in other files.
2007-12-05 13:56:22 +00:00
|
|
|
#include "libvirt/libvirt.h"
|
2006-06-28 18:19:13 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define PROXY_SOCKET_PATH "/tmp/livirt_proxy_conn"
|
|
|
|
#define PROXY_PROTO_VERSION 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* the command allowed though the proxy
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_PROXY_NONE = 0,
|
|
|
|
VIR_PROXY_VERSION = 1,
|
|
|
|
VIR_PROXY_NODE_INFO = 2,
|
|
|
|
VIR_PROXY_LIST = 3,
|
|
|
|
VIR_PROXY_NUM_DOMAIN = 4,
|
|
|
|
VIR_PROXY_LOOKUP_ID = 5,
|
|
|
|
VIR_PROXY_LOOKUP_UUID = 6,
|
|
|
|
VIR_PROXY_LOOKUP_NAME = 7,
|
|
|
|
VIR_PROXY_MAX_MEMORY = 8,
|
2006-08-09 15:21:16 +00:00
|
|
|
VIR_PROXY_DOMAIN_INFO = 9,
|
|
|
|
VIR_PROXY_DOMAIN_XML = 10,
|
2007-04-30 16:58:26 +00:00
|
|
|
VIR_PROXY_DOMAIN_OSTYPE = 11,
|
|
|
|
VIR_PROXY_GET_CAPABILITIES = 12
|
2006-06-28 18:19:13 +00:00
|
|
|
} virProxyCommand;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* structure used by the client to make a request to the proxy
|
|
|
|
* and by the proxy when answering the client.
|
|
|
|
* the size may not be fixed, it's passed as len.
|
|
|
|
*/
|
|
|
|
struct _virProxyPacket {
|
|
|
|
unsigned short version; /* version of the proxy protocol */
|
|
|
|
unsigned short command; /* command number a virProxyCommand */
|
|
|
|
unsigned short serial; /* command serial number */
|
|
|
|
unsigned short len; /* the length of the request */
|
|
|
|
union {
|
|
|
|
char string[8]; /* string data */
|
|
|
|
int arg; /* or int argument */
|
|
|
|
long larg; /* or long argument */
|
|
|
|
} data;
|
|
|
|
};
|
|
|
|
typedef struct _virProxyPacket virProxyPacket;
|
|
|
|
typedef virProxyPacket *virProxyPacketPtr;
|
|
|
|
|
2006-06-29 14:44:37 +00:00
|
|
|
/*
|
|
|
|
* If there is extra data sent from the proxy to the client,
|
|
|
|
* they are appended after the packet.
|
|
|
|
* the size may not be fixed, it's passed as len and includes the
|
|
|
|
* extra data.
|
|
|
|
*/
|
|
|
|
struct _virProxyFullPacket {
|
|
|
|
unsigned short version; /* version of the proxy protocol */
|
|
|
|
unsigned short command; /* command number a virProxyCommand */
|
|
|
|
unsigned short serial; /* command serial number */
|
|
|
|
unsigned short len; /* the length of the request */
|
|
|
|
union {
|
|
|
|
char string[8]; /* string data */
|
|
|
|
int arg; /* or int argument */
|
|
|
|
long larg; /* or long argument */
|
|
|
|
} data;
|
|
|
|
/* that should be aligned on a 16bytes boundary */
|
|
|
|
union {
|
2006-06-29 22:12:47 +00:00
|
|
|
char str[4080]; /* extra char array */
|
2006-06-29 14:44:37 +00:00
|
|
|
int arg[1020]; /* extra int array */
|
2007-03-15 17:24:56 +00:00
|
|
|
virDomainInfo dinfo; /* domain information */
|
|
|
|
virNodeInfo ninfo; /* node information */
|
2006-06-29 14:44:37 +00:00
|
|
|
} extra;
|
|
|
|
};
|
|
|
|
typedef struct _virProxyFullPacket virProxyFullPacket;
|
|
|
|
typedef virProxyFullPacket *virProxyFullPacketPtr;
|
2007-04-04 14:19:49 +00:00
|
|
|
|
Fri Jul 6 16:08:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/proxy_internal.c, src/proxy_internal.h,
src.xen_internal.c, src/xen_internal.h,
src/xen_unified.c, src/xen_unified.h,
src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h,
src/xs_internal.c, src/xs_internal.h: The interface
between xen_unified.c and its underlying driver now uses
a custom structure (struct xenUnifiedDriver) instead
of reusing virDriver.
* src/xen_unified.c: virDomainLookup* functions in Xen
now throw VIR_ERR_NO_DOMAIN if the domain does not exist.
* src/xs_internal.c: Fix indentation.
2007-07-06 15:11:22 +00:00
|
|
|
/* xen_unified makes direct calls or indirect calls through here. */
|
|
|
|
extern struct xenUnifiedDriver xenProxyDriver;
|
|
|
|
extern int xenProxyInit (void);
|
|
|
|
|
|
|
|
extern virDomainPtr xenProxyLookupByID(virConnectPtr conn, int id);
|
|
|
|
extern virDomainPtr xenProxyLookupByUUID(virConnectPtr conn,
|
|
|
|
const unsigned char *uuid);
|
|
|
|
extern virDomainPtr xenProxyLookupByName(virConnectPtr conn,
|
|
|
|
const char *domname);
|
2006-06-28 18:19:13 +00:00
|
|
|
|
2007-10-31 09:39:13 +00:00
|
|
|
extern char * xenProxyDomainDumpXML(virDomainPtr domain,
|
|
|
|
int flags);
|
2006-06-28 18:19:13 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* __LIBVIR_PROXY_H__ */
|
2007-03-15 17:24:56 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* vim: set tabstop=4:
|
|
|
|
* vim: set shiftwidth=4:
|
|
|
|
* vim: set expandtab:
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* c-indent-level: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 4
|
|
|
|
* End:
|
|
|
|
*/
|