build: consistently indent preprocessor directives

* global: patch created by running:
for f in $(git ls-files '*.[ch]') ; do
    cppi $f > $f.t && mv $f.t $f
done
This commit is contained in:
Eric Blake 2010-03-09 19:22:22 +01:00 committed by Jim Meyering
parent 0c39adef95
commit 36d8e7d8d7
172 changed files with 2797 additions and 2797 deletions

View File

@ -22,10 +22,10 @@
*/ */
#ifndef __LIBVIRTD_DISPATCH_H__ #ifndef __LIBVIRTD_DISPATCH_H__
#define __LIBVIRTD_DISPATCH_H__ # define __LIBVIRTD_DISPATCH_H__
#include "libvirtd.h" # include "libvirtd.h"
int int

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIRTD_EVENT_H__ #ifndef __VIRTD_EVENT_H__
#define __VIRTD_EVENT_H__ # define __VIRTD_EVENT_H__
#include "internal.h" # include "internal.h"
/** /**
* virEventAddHandleImpl: register a callback for monitoring file handle events * virEventAddHandleImpl: register a callback for monitoring file handle events

View File

@ -63,60 +63,60 @@
#include "memory.h" #include "memory.h"
#include "stream.h" #include "stream.h"
#ifdef HAVE_AVAHI #ifdef HAVE_AVAHI
#include "mdns.h" # include "mdns.h"
#endif #endif
#ifdef WITH_DRIVER_MODULES #ifdef WITH_DRIVER_MODULES
#include "driver.h" # include "driver.h"
#else #else
#ifdef WITH_QEMU # ifdef WITH_QEMU
#include "qemu/qemu_driver.h" # include "qemu/qemu_driver.h"
#endif # endif
#ifdef WITH_LXC # ifdef WITH_LXC
#include "lxc/lxc_driver.h" # include "lxc/lxc_driver.h"
#endif # endif
#ifdef WITH_UML # ifdef WITH_UML
#include "uml/uml_driver.h" # include "uml/uml_driver.h"
#endif # endif
#ifdef WITH_ONE # ifdef WITH_ONE
#include "opennebula/one_driver.h" # include "opennebula/one_driver.h"
#endif # endif
#ifdef WITH_NETWORK # ifdef WITH_NETWORK
#include "network/bridge_driver.h" # include "network/bridge_driver.h"
#endif # endif
#ifdef WITH_NETCF # ifdef WITH_NETCF
#include "interface/netcf_driver.h" # include "interface/netcf_driver.h"
#endif # endif
#ifdef WITH_STORAGE_DIR # ifdef WITH_STORAGE_DIR
#include "storage/storage_driver.h" # include "storage/storage_driver.h"
#endif # endif
#ifdef WITH_NODE_DEVICES # ifdef WITH_NODE_DEVICES
#include "node_device/node_device_driver.h" # include "node_device/node_device_driver.h"
#endif # endif
#ifdef WITH_SECRETS # ifdef WITH_SECRETS
#include "secret/secret_driver.h" # include "secret/secret_driver.h"
#endif # endif
#endif #endif
#ifdef __sun #ifdef __sun
#include <ucred.h> # include <ucred.h>
#include <priv.h> # include <priv.h>
#ifndef PRIV_VIRT_MANAGE # ifndef PRIV_VIRT_MANAGE
#define PRIV_VIRT_MANAGE ((const char *)"virt_manage") # define PRIV_VIRT_MANAGE ((const char *)"virt_manage")
#endif # endif
#ifndef PRIV_XVM_CONTROL # ifndef PRIV_XVM_CONTROL
#define PRIV_XVM_CONTROL ((const char *)"xvm_control") # define PRIV_XVM_CONTROL ((const char *)"xvm_control")
#endif # endif
#define PU_RESETGROUPS 0x0001 /* Remove supplemental groups */ # define PU_RESETGROUPS 0x0001 /* Remove supplemental groups */
#define PU_CLEARLIMITSET 0x0008 /* L=0 */ # define PU_CLEARLIMITSET 0x0008 /* L=0 */
extern int __init_daemon_priv(int, uid_t, gid_t, ...); extern int __init_daemon_priv(int, uid_t, gid_t, ...);
#define SYSTEM_UID 60 # define SYSTEM_UID 60
static gid_t unix_sock_gid = 60; /* Not used */ static gid_t unix_sock_gid = 60; /* Not used */
static int unix_sock_rw_mask = 0666; static int unix_sock_rw_mask = 0666;
@ -877,33 +877,33 @@ static struct qemud_server *qemudInitialize(void) {
virDriverLoadModule("uml"); virDriverLoadModule("uml");
virDriverLoadModule("one"); virDriverLoadModule("one");
#else #else
#ifdef WITH_NETWORK # ifdef WITH_NETWORK
networkRegister(); networkRegister();
#endif # endif
#ifdef WITH_NETCF # ifdef WITH_NETCF
interfaceRegister(); interfaceRegister();
#endif # endif
#ifdef WITH_STORAGE_DIR # ifdef WITH_STORAGE_DIR
storageRegister(); storageRegister();
#endif # endif
#if defined(WITH_NODE_DEVICES) # if defined(WITH_NODE_DEVICES)
nodedevRegister(); nodedevRegister();
#endif # endif
#ifdef WITH_SECRETS # ifdef WITH_SECRETS
secretRegister(); secretRegister();
#endif # endif
#ifdef WITH_QEMU # ifdef WITH_QEMU
qemuRegister(); qemuRegister();
#endif # endif
#ifdef WITH_LXC # ifdef WITH_LXC
lxcRegister(); lxcRegister();
#endif # endif
#ifdef WITH_UML # ifdef WITH_UML
umlRegister(); umlRegister();
#endif # endif
#ifdef WITH_ONE # ifdef WITH_ONE
oneRegister(); oneRegister();
#endif # endif
#endif #endif
virEventRegisterImpl(virEventAddHandleImpl, virEventRegisterImpl(virEventAddHandleImpl,
@ -1247,7 +1247,7 @@ remoteCheckAccess (struct qemud_client *client)
#if HAVE_POLKIT #if HAVE_POLKIT
int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid) { int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid) {
#ifdef SO_PEERCRED # ifdef SO_PEERCRED
struct ucred cr; struct ucred cr;
unsigned int cr_len = sizeof (cr); unsigned int cr_len = sizeof (cr);
@ -1260,10 +1260,10 @@ int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid) {
*pid = cr.pid; *pid = cr.pid;
*uid = cr.uid; *uid = cr.uid;
#else # else
/* XXX Many more OS support UNIX socket credentials we could port to. See dbus ....*/ /* XXX Many more OS support UNIX socket credentials we could port to. See dbus ....*/
#error "UNIX socket credentials not supported/implemented on this platform yet..." # error "UNIX socket credentials not supported/implemented on this platform yet..."
#endif # endif
return 0; return 0;
} }
#endif #endif
@ -2858,7 +2858,7 @@ qemudSetupPrivs (void)
return 0; return 0;
} }
#else #else
#define qemudSetupPrivs() 0 # define qemudSetupPrivs() 0
#endif #endif

View File

@ -23,53 +23,53 @@
#ifndef QEMUD_INTERNAL_H__ #ifndef QEMUD_INTERNAL_H__
#define QEMUD_INTERNAL_H__ # define QEMUD_INTERNAL_H__
#include <config.h> # include <config.h>
#include <gnutls/gnutls.h> # include <gnutls/gnutls.h>
#include <gnutls/x509.h> # include <gnutls/x509.h>
#include "gnutls_1_0_compat.h" # include "gnutls_1_0_compat.h"
#if HAVE_SASL # if HAVE_SASL
#include <sasl/sasl.h> # include <sasl/sasl.h>
#endif # endif
#if HAVE_POLKIT0 # if HAVE_POLKIT0
#include <dbus/dbus.h> # include <dbus/dbus.h>
#endif # endif
#ifdef HAVE_SYS_SYSLIMITS_H # ifdef HAVE_SYS_SYSLIMITS_H
#include <sys/syslimits.h> # include <sys/syslimits.h>
#endif # endif
#include <rpc/types.h> # include <rpc/types.h>
#include <rpc/xdr.h> # include <rpc/xdr.h>
#include "remote_protocol.h" # include "remote_protocol.h"
#include "logging.h" # include "logging.h"
#include "threads.h" # include "threads.h"
#ifdef __GNUC__ # ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H # ifdef HAVE_ANSIDECL_H
#include <ansidecl.h> # include <ansidecl.h>
#endif # endif
#ifndef __GNUC_PREREQ # ifndef __GNUC_PREREQ
#if defined __GNUC__ && defined __GNUC_MINOR__ # if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \ # define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else # else
#define __GNUC_PREREQ(maj,min) 0 # define __GNUC_PREREQ(maj,min) 0
#endif # endif
#endif # endif
/** /**
* ATTRIBUTE_UNUSED: * ATTRIBUTE_UNUSED:
* *
* Macro to flag conciously unused parameters to functions * Macro to flag conciously unused parameters to functions
*/ */
#ifndef ATTRIBUTE_UNUSED # ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((__unused__)) # define ATTRIBUTE_UNUSED __attribute__((__unused__))
#endif # endif
/** /**
* ATTRIBUTE_FMT_PRINTF * ATTRIBUTE_FMT_PRINTF
@ -81,35 +81,35 @@
* printf format specifiers even on broken Win32 platforms * printf format specifiers even on broken Win32 platforms
* hence we have to force 'gnu_printf' for new GCC * hence we have to force 'gnu_printf' for new GCC
*/ */
#ifndef ATTRIBUTE_FMT_PRINTF # ifndef ATTRIBUTE_FMT_PRINTF
#if __GNUC_PREREQ (4, 4) # if __GNUC_PREREQ (4, 4)
#define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (gnu_printf, fmtpos,argpos))) # define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (gnu_printf, fmtpos,argpos)))
#else # else
#define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (printf, fmtpos,argpos))) # define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (printf, fmtpos,argpos)))
#endif # endif
#endif # endif
#ifndef ATTRIBUTE_RETURN_CHECK # ifndef ATTRIBUTE_RETURN_CHECK
#if __GNUC_PREREQ (3, 4) # if __GNUC_PREREQ (3, 4)
#define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__)) # define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))
#else # else
#define ATTRIBUTE_RETURN_CHECK # define ATTRIBUTE_RETURN_CHECK
#endif # endif
#endif # endif
#else # else
#ifndef ATTRIBUTE_UNUSED # ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED # define ATTRIBUTE_UNUSED
#endif # endif
#ifndef ATTRIBUTE_FMT_PRINTF # ifndef ATTRIBUTE_FMT_PRINTF
#define ATTRIBUTE_FMT_PRINTF(...) # define ATTRIBUTE_FMT_PRINTF(...)
#endif # endif
#ifndef ATTRIBUTE_RETURN_CHECK # ifndef ATTRIBUTE_RETURN_CHECK
#define ATTRIBUTE_RETURN_CHECK # define ATTRIBUTE_RETURN_CHECK
#endif # endif
#endif # endif
#define qemudDebug DEBUG # define qemudDebug DEBUG
/* Whether we're passing reads & writes through a sasl SSF */ /* Whether we're passing reads & writes through a sasl SSF */
enum qemud_sasl_ssf { enum qemud_sasl_ssf {
@ -186,7 +186,7 @@ struct qemud_client {
gnutls_session_t tlssession; gnutls_session_t tlssession;
int auth; int auth;
unsigned int handshake :1; /* If we're in progress for TLS handshake */ unsigned int handshake :1; /* If we're in progress for TLS handshake */
#if HAVE_SASL # if HAVE_SASL
sasl_conn_t *saslconn; sasl_conn_t *saslconn;
int saslSSF; int saslSSF;
const char *saslDecoded; const char *saslDecoded;
@ -196,7 +196,7 @@ struct qemud_client {
unsigned int saslEncodedLength; unsigned int saslEncodedLength;
unsigned int saslEncodedOffset; unsigned int saslEncodedOffset;
char *saslUsername; char *saslUsername;
#endif # endif
/* Count of meages in 'dx' or 'tx' queue /* Count of meages in 'dx' or 'tx' queue
* ie RPC calls in progress. Does not count * ie RPC calls in progress. Does not count
@ -229,7 +229,7 @@ struct qemud_client {
}; };
#define QEMUD_CLIENT_MAGIC 0x7788aaee # define QEMUD_CLIENT_MAGIC 0x7788aaee
struct qemud_socket { struct qemud_socket {
@ -273,15 +273,15 @@ struct qemud_server {
pthread_t eventThread; pthread_t eventThread;
unsigned int hasEventThread :1; unsigned int hasEventThread :1;
unsigned int quitEventThread :1; unsigned int quitEventThread :1;
#ifdef HAVE_AVAHI # ifdef HAVE_AVAHI
struct libvirtd_mdns *mdns; struct libvirtd_mdns *mdns;
#endif # endif
#if HAVE_SASL # if HAVE_SASL
char **saslUsernameWhitelist; char **saslUsernameWhitelist;
#endif # endif
#if HAVE_POLKIT0 # if HAVE_POLKIT0
DBusConnection *sysbus; DBusConnection *sysbus;
#endif # endif
}; };
void qemudLog(int priority, const char *fmt, ...) void qemudLog(int priority, const char *fmt, ...)
@ -306,8 +306,8 @@ qemudClientMessageRelease(struct qemud_client *client,
struct qemud_client_message *msg); struct qemud_client_message *msg);
#if HAVE_POLKIT # if HAVE_POLKIT
int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid); int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid);
#endif # endif
#endif #endif

View File

@ -25,7 +25,7 @@
#include "internal.h" #include "internal.h"
#ifndef __VIRTD_MDNS_H__ #ifndef __VIRTD_MDNS_H__
#define __VIRTD_MDNS_H__ # define __VIRTD_MDNS_H__
struct libvirtd_mdns; struct libvirtd_mdns;
struct libvirtd_mdns_group; struct libvirtd_mdns_group;

View File

@ -44,8 +44,8 @@
#include "virterror_internal.h" #include "virterror_internal.h"
#if HAVE_POLKIT0 #if HAVE_POLKIT0
#include <polkit/polkit.h> # include <polkit/polkit.h>
#include <polkit-dbus/polkit-dbus.h> # include <polkit-dbus/polkit-dbus.h>
#endif #endif
#include "remote.h" #include "remote.h"
@ -3516,7 +3516,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
goto authfail; goto authfail;
} }
#if HAVE_POLKIT_CONTEXT_IS_CALLER_AUTHORIZED # if HAVE_POLKIT_CONTEXT_IS_CALLER_AUTHORIZED
pkresult = polkit_context_is_caller_authorized(pkcontext, pkresult = polkit_context_is_caller_authorized(pkcontext,
pkaction, pkaction,
pkcaller, pkcaller,
@ -3528,11 +3528,11 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
polkit_error_get_error_message(pkerr)); polkit_error_get_error_message(pkerr));
goto authfail; goto authfail;
} }
#else # else
pkresult = polkit_context_can_caller_do_action(pkcontext, pkresult = polkit_context_can_caller_do_action(pkcontext,
pkaction, pkaction,
pkcaller); pkcaller);
#endif # endif
polkit_context_unref(pkcontext); polkit_context_unref(pkcontext);
polkit_caller_unref(pkcaller); polkit_caller_unref(pkcaller);
polkit_action_unref(pkaction); polkit_action_unref(pkaction);

View File

@ -22,17 +22,17 @@
*/ */
#ifndef __LIBVIRTD_REMOTE_H__ #ifndef __LIBVIRTD_REMOTE_H__
#define __LIBVIRTD_REMOTE_H__ # define __LIBVIRTD_REMOTE_H__
#include "libvirtd.h" # include "libvirtd.h"
typedef union { typedef union {
#include "remote_dispatch_args.h" # include "remote_dispatch_args.h"
} dispatch_args; } dispatch_args;
typedef union { typedef union {
#include "remote_dispatch_ret.h" # include "remote_dispatch_ret.h"
} dispatch_ret; } dispatch_ret;

View File

@ -22,9 +22,9 @@
#ifndef __LIBVIRTD_STREAM_H__ #ifndef __LIBVIRTD_STREAM_H__
#define __LIBVIRTD_STREAM_H__ # define __LIBVIRTD_STREAM_H__
#include "libvirtd.h" # include "libvirtd.h"

View File

@ -6,19 +6,19 @@
#include <signal.h> #include <signal.h>
#if HAVE_SYS_POLL_H #if HAVE_SYS_POLL_H
#include <sys/types.h> # include <sys/types.h>
#include <sys/poll.h> # include <sys/poll.h>
#include <libvirt/libvirt.h> # include <libvirt/libvirt.h>
#define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \ # define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
__func__, __LINE__) __func__, __LINE__)
#define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \ # define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
__func__, __LINE__, __VA_ARGS__) __func__, __LINE__, __VA_ARGS__)
#define STREQ(a,b) (strcmp(a,b) == 0) # define STREQ(a,b) (strcmp(a,b) == 0)
#ifndef ATTRIBUTE_UNUSED # ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((__unused__)) # define ATTRIBUTE_UNUSED __attribute__((__unused__))
#endif # endif
/* handle globals */ /* handle globals */
int h_fd = 0; int h_fd = 0;
@ -28,7 +28,7 @@ virFreeCallback h_ff = NULL;
void *h_opaque = NULL; void *h_opaque = NULL;
/* timeout globals */ /* timeout globals */
#define TIMEOUT_MS 1000 # define TIMEOUT_MS 1000
int t_active = 0; int t_active = 0;
int t_timeout = -1; int t_timeout = -1;
virEventTimeoutCallback t_cb = NULL; virEventTimeoutCallback t_cb = NULL;

View File

@ -12,13 +12,13 @@
*/ */
#ifndef __VIR_VIRERR_H__ #ifndef __VIR_VIRERR_H__
#define __VIR_VIRERR_H__ # define __VIR_VIRERR_H__
#include <libvirt/libvirt.h> # include <libvirt/libvirt.h>
#ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
#endif # endif
/** /**
* virErrorLevel: * virErrorLevel:
@ -210,8 +210,8 @@ void virConnSetErrorFunc (virConnectPtr conn,
virErrorFunc handler); virErrorFunc handler);
int virConnCopyLastError (virConnectPtr conn, int virConnCopyLastError (virConnectPtr conn,
virErrorPtr to); virErrorPtr to);
#ifdef __cplusplus # ifdef __cplusplus
} }
#endif # endif
#endif /* __VIR_VIRERR_H__ */ #endif /* __VIR_VIRERR_H__ */

View File

@ -14,30 +14,30 @@
#ifdef WITH_XEN #ifdef WITH_XEN
#include <stdlib.h> # include <stdlib.h>
#include <unistd.h> # include <unistd.h>
#include <errno.h> # include <errno.h>
#include <sys/types.h> # include <sys/types.h>
#include <sys/poll.h> # include <sys/poll.h>
#include <sys/socket.h> # include <sys/socket.h>
#include <sys/un.h> # include <sys/un.h>
#include <locale.h> # include <locale.h>
#include "internal.h" # include "internal.h"
#include "datatypes.h" # include "datatypes.h"
#include "proxy_internal.h" # include "proxy_internal.h"
#include "util.h" # include "util.h"
#include "xen_hypervisor.h" # include "xen_hypervisor.h"
#include "xend_internal.h" # include "xend_internal.h"
#include "xs_internal.h" # include "xs_internal.h"
#include "xen_driver.h" # include "xen_driver.h"
static int fdServer = -1; static int fdServer = -1;
static int debug = 0; static int debug = 0;
static int persist = 0; static int persist = 0;
static int done = 0; static int done = 0;
#define MAX_CLIENT 64 # define MAX_CLIENT 64
static int nbClients = 0; /* client 0 is the unix listen socket */ static int nbClients = 0; /* client 0 is the unix listen socket */
static struct pollfd pollInfos[MAX_CLIENT + 1]; static struct pollfd pollInfos[MAX_CLIENT + 1];

View File

@ -11,14 +11,14 @@
#include "libvirt/virterror.h" #include "libvirt/virterror.h"
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef ATTRIBUTE_UNUSED # ifdef ATTRIBUTE_UNUSED
#undef ATTRIBUTE_UNUSED # undef ATTRIBUTE_UNUSED
#endif # endif
#ifndef ATTRIBUTE_UNUSED # ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif /* ATTRIBUTE_UNUSED */ # endif /* ATTRIBUTE_UNUSED */
#else #else
#define ATTRIBUTE_UNUSED # define ATTRIBUTE_UNUSED
#endif #endif
#define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \ #define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \

View File

@ -22,14 +22,14 @@
*/ */
#ifndef __VIR_CAPABILITIES_H #ifndef __VIR_CAPABILITIES_H
#define __VIR_CAPABILITIES_H # define __VIR_CAPABILITIES_H
#include "internal.h" # include "internal.h"
#include "util.h" # include "util.h"
#include "buf.h" # include "buf.h"
#include "cpu_conf.h" # include "cpu_conf.h"
#include <libxml/xpath.h> # include <libxml/xpath.h>
typedef struct _virCapsGuestFeature virCapsGuestFeature; typedef struct _virCapsGuestFeature virCapsGuestFeature;
typedef virCapsGuestFeature *virCapsGuestFeaturePtr; typedef virCapsGuestFeature *virCapsGuestFeaturePtr;

View File

@ -22,13 +22,13 @@
*/ */
#ifndef __VIR_CPU_CONF_H__ #ifndef __VIR_CPU_CONF_H__
#define __VIR_CPU_CONF_H__ # define __VIR_CPU_CONF_H__
#include "util.h" # include "util.h"
#include "buf.h" # include "buf.h"
#ifndef PROXY # ifndef PROXY
#include "xml.h" # include "xml.h"
#endif # endif
enum virCPUType { enum virCPUType {
VIR_CPU_TYPE_HOST, VIR_CPU_TYPE_HOST,
@ -83,12 +83,12 @@ struct _virCPUDef {
void void
virCPUDefFree(virCPUDefPtr def); virCPUDefFree(virCPUDefPtr def);
#ifndef PROXY # ifndef PROXY
virCPUDefPtr virCPUDefPtr
virCPUDefParseXML(const xmlNodePtr node, virCPUDefParseXML(const xmlNodePtr node,
xmlXPathContextPtr ctxt, xmlXPathContextPtr ctxt,
enum virCPUType mode); enum virCPUType mode);
#endif # endif
enum virCPUFormatFlags { enum virCPUFormatFlags {
VIR_CPU_FORMAT_EMBEDED = (1 << 0) /* embed into existing <cpu/> element VIR_CPU_FORMAT_EMBEDED = (1 << 0) /* embed into existing <cpu/> element

View File

@ -22,20 +22,20 @@
*/ */
#ifndef __DOMAIN_CONF_H #ifndef __DOMAIN_CONF_H
#define __DOMAIN_CONF_H # define __DOMAIN_CONF_H
#include <libxml/parser.h> # include <libxml/parser.h>
#include <libxml/tree.h> # include <libxml/tree.h>
#include <libxml/xpath.h> # include <libxml/xpath.h>
#include "internal.h" # include "internal.h"
#include "capabilities.h" # include "capabilities.h"
#include "storage_encryption_conf.h" # include "storage_encryption_conf.h"
#include "cpu_conf.h" # include "cpu_conf.h"
#include "util.h" # include "util.h"
#include "threads.h" # include "threads.h"
#include "hash.h" # include "hash.h"
#include "network.h" # include "network.h"
/* Private component of virDomainXMLFlags */ /* Private component of virDomainXMLFlags */
typedef enum { typedef enum {
@ -566,7 +566,7 @@ struct _virDomainDeviceDef {
}; };
#define VIR_DOMAIN_MAX_BOOT_DEVS 4 # define VIR_DOMAIN_MAX_BOOT_DEVS 4
/* 3 possible boot devices */ /* 3 possible boot devices */
enum virDomainBootOrder { enum virDomainBootOrder {
@ -656,7 +656,7 @@ struct _virDomainClockDef {
} data; } data;
}; };
#define VIR_DOMAIN_CPUMASK_LEN 1024 # define VIR_DOMAIN_CPUMASK_LEN 1024
/* Guest VM main configuration */ /* Guest VM main configuration */
typedef struct _virDomainDef virDomainDef; typedef struct _virDomainDef virDomainDef;
@ -816,7 +816,7 @@ virDomainObjPtr virDomainAssignDef(virCapsPtr caps,
void virDomainRemoveInactive(virDomainObjListPtr doms, void virDomainRemoveInactive(virDomainObjListPtr doms,
virDomainObjPtr dom); virDomainObjPtr dom);
#ifndef PROXY # ifndef PROXY
virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps, virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
const virDomainDefPtr def, const virDomainDefPtr def,
const char *xmlStr, const char *xmlStr,
@ -840,7 +840,7 @@ virDomainObjPtr virDomainObjParseNode(virCapsPtr caps,
int virDomainDefAddImplicitControllers(virDomainDefPtr def); int virDomainDefAddImplicitControllers(virDomainDefPtr def);
#endif # endif
char *virDomainDefFormat(virDomainDefPtr def, char *virDomainDefFormat(virDomainDefPtr def,
int flags); int flags);

View File

@ -23,9 +23,9 @@
#include "internal.h" #include "internal.h"
#ifndef __DOMAIN_EVENT_H__ #ifndef __DOMAIN_EVENT_H__
#define __DOMAIN_EVENT_H__ # define __DOMAIN_EVENT_H__
#include "domain_conf.h" # include "domain_conf.h"
struct _virDomainEventCallback { struct _virDomainEventCallback {
virConnectPtr conn; virConnectPtr conn;

View File

@ -22,15 +22,15 @@
*/ */
#ifndef __INTERFACE_CONF_H__ #ifndef __INTERFACE_CONF_H__
#define __INTERFACE_CONF_H__ # define __INTERFACE_CONF_H__
#include <libxml/parser.h> # include <libxml/parser.h>
#include <libxml/tree.h> # include <libxml/tree.h>
#include <libxml/xpath.h> # include <libxml/xpath.h>
#include "internal.h" # include "internal.h"
#include "util.h" # include "util.h"
#include "threads.h" # include "threads.h"
/* There is currently 3 types of interfaces */ /* There is currently 3 types of interfaces */

View File

@ -22,14 +22,14 @@
*/ */
#ifndef __NETWORK_CONF_H__ #ifndef __NETWORK_CONF_H__
#define __NETWORK_CONF_H__ # define __NETWORK_CONF_H__
#include <libxml/parser.h> # include <libxml/parser.h>
#include <libxml/tree.h> # include <libxml/tree.h>
#include <libxml/xpath.h> # include <libxml/xpath.h>
#include "internal.h" # include "internal.h"
#include "threads.h" # include "threads.h"
/* 2 possible types of forwarding */ /* 2 possible types of forwarding */
enum virNetworkForwardType { enum virNetworkForwardType {

View File

@ -23,16 +23,16 @@
*/ */
#ifndef __VIR_NODE_DEVICE_CONF_H__ #ifndef __VIR_NODE_DEVICE_CONF_H__
#define __VIR_NODE_DEVICE_CONF_H__ # define __VIR_NODE_DEVICE_CONF_H__
#include "internal.h" # include "internal.h"
#include "util.h" # include "util.h"
#include "threads.h" # include "threads.h"
#include <libxml/tree.h> # include <libxml/tree.h>
#define CREATE_DEVICE 1 # define CREATE_DEVICE 1
#define EXISTING_DEVICE 0 # define EXISTING_DEVICE 0
enum virNodeDevCapType { enum virNodeDevCapType {
/* Keep in sync with VIR_ENUM_IMPL in node_device_conf.c */ /* Keep in sync with VIR_ENUM_IMPL in node_device_conf.c */
@ -218,7 +218,7 @@ struct _virDeviceMonitorState {
void *privateData; /* driver-specific private data */ void *privateData; /* driver-specific private data */
}; };
#define virNodeDeviceReportError(code, ...) \ # define virNodeDeviceReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_NODEDEV, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_NODEDEV, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -21,12 +21,12 @@
*/ */
#ifndef __VIR_SECRET_CONF_H__ #ifndef __VIR_SECRET_CONF_H__
#define __VIR_SECRET_CONF_H__ # define __VIR_SECRET_CONF_H__
#include "internal.h" # include "internal.h"
#include "util.h" # include "util.h"
#define virSecretReportError(code, ...) \ # define virSecretReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_SECRET, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_SECRET, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -22,14 +22,14 @@
*/ */
#ifndef __VIR_STORAGE_CONF_H__ #ifndef __VIR_STORAGE_CONF_H__
#define __VIR_STORAGE_CONF_H__ # define __VIR_STORAGE_CONF_H__
#include "internal.h" # include "internal.h"
#include "util.h" # include "util.h"
#include "storage_encryption_conf.h" # include "storage_encryption_conf.h"
#include "threads.h" # include "threads.h"
#include <libxml/tree.h> # include <libxml/tree.h>
/* Shared structs */ /* Shared structs */
@ -318,7 +318,7 @@ static inline int virStoragePoolObjIsActive(virStoragePoolObjPtr pool) {
return pool->active; return pool->active;
} }
#define virStorageReportError(code, ...) \ # define virStorageReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_STORAGE, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_STORAGE, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -21,14 +21,14 @@
*/ */
#ifndef __VIR_STORAGE_ENCRYPTION_H__ #ifndef __VIR_STORAGE_ENCRYPTION_H__
#define __VIR_STORAGE_ENCRYPTION_H__ # define __VIR_STORAGE_ENCRYPTION_H__
#include "internal.h" # include "internal.h"
#include "buf.h" # include "buf.h"
#include "util.h" # include "util.h"
#include <stdbool.h> # include <stdbool.h>
#include <libxml/tree.h> # include <libxml/tree.h>
enum virStorageEncryptionSecretType { enum virStorageEncryptionSecretType {
VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE = 0, VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE = 0,

View File

@ -22,15 +22,15 @@
*/ */
#ifndef __VIR_CPU_H__ #ifndef __VIR_CPU_H__
#define __VIR_CPU_H__ # define __VIR_CPU_H__
#include "virterror_internal.h" # include "virterror_internal.h"
#include "datatypes.h" # include "datatypes.h"
#include "conf/cpu_conf.h" # include "conf/cpu_conf.h"
#include "cpu_x86_data.h" # include "cpu_x86_data.h"
#define virCPUReportError(code, ...) \ # define virCPUReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_CPU, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_CPU, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -23,9 +23,9 @@
*/ */
#ifndef __VIR_CPU_GENERIC_H__ #ifndef __VIR_CPU_GENERIC_H__
#define __VIR_CPU_GENERIC_H__ # define __VIR_CPU_GENERIC_H__
#include "cpu.h" # include "cpu.h"
extern struct cpuArchDriver cpuDriverGeneric; extern struct cpuArchDriver cpuDriverGeneric;

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_CPU_MAP_H__ #ifndef __VIR_CPU_MAP_H__
#define __VIR_CPU_MAP_H__ # define __VIR_CPU_MAP_H__
#include "xml.h" # include "xml.h"
typedef int typedef int

View File

@ -1146,14 +1146,14 @@ error:
static inline void static inline void
cpuidCall(struct cpuX86cpuid *cpuid) cpuidCall(struct cpuX86cpuid *cpuid)
{ {
#if __x86_64__ # if __x86_64__
asm("cpuid" asm("cpuid"
: "=a" (cpuid->eax), : "=a" (cpuid->eax),
"=b" (cpuid->ebx), "=b" (cpuid->ebx),
"=c" (cpuid->ecx), "=c" (cpuid->ecx),
"=d" (cpuid->edx) "=d" (cpuid->edx)
: "a" (cpuid->function)); : "a" (cpuid->function));
#else # else
/* we need to avoid direct use of ebx for CPUID output as it is used /* we need to avoid direct use of ebx for CPUID output as it is used
* for global offset table on i386 with -fPIC * for global offset table on i386 with -fPIC
*/ */
@ -1167,7 +1167,7 @@ cpuidCall(struct cpuX86cpuid *cpuid)
"=d" (cpuid->edx) "=d" (cpuid->edx)
: "a" (cpuid->function) : "a" (cpuid->function)
: "cc"); : "cc");
#endif # endif
} }

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_CPU_X86_H__ #ifndef __VIR_CPU_X86_H__
#define __VIR_CPU_X86_H__ # define __VIR_CPU_X86_H__
#include "cpu.h" # include "cpu.h"
extern struct cpuArchDriver cpuDriverX86; extern struct cpuArchDriver cpuDriverX86;

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_CPU_X86_DATA_H__ #ifndef __VIR_CPU_X86_DATA_H__
#define __VIR_CPU_X86_DATA_H__ # define __VIR_CPU_X86_DATA_H__
#include <stdint.h> # include <stdint.h>
struct cpuX86cpuid { struct cpuX86cpuid {
uint32_t function; uint32_t function;
@ -34,8 +34,8 @@ struct cpuX86cpuid {
uint32_t edx; uint32_t edx;
}; };
#define CPUX86_BASIC 0x0 # define CPUX86_BASIC 0x0
#define CPUX86_EXTENDED 0x80000000 # define CPUX86_EXTENDED 0x80000000
struct cpuX86Data { struct cpuX86Data {
int basic_len; int basic_len;

View File

@ -20,13 +20,13 @@
*/ */
#ifndef __VIRT_DATATYPES_H_ #ifndef __VIRT_DATATYPES_H_
#define __VIRT_DATATYPES_H_ # define __VIRT_DATATYPES_H_
#include "internal.h" # include "internal.h"
#include "hash.h" # include "hash.h"
#include "driver.h" # include "driver.h"
#include "threads.h" # include "threads.h"
/** /**
* VIR_CONNECT_MAGIC: * VIR_CONNECT_MAGIC:
@ -34,8 +34,8 @@
* magic value used to protect the API when pointers to connection structures * magic value used to protect the API when pointers to connection structures
* are passed down by the uers. * are passed down by the uers.
*/ */
#define VIR_CONNECT_MAGIC 0x4F23DEAD # define VIR_CONNECT_MAGIC 0x4F23DEAD
#define VIR_IS_CONNECT(obj) ((obj) && (obj)->magic==VIR_CONNECT_MAGIC) # define VIR_IS_CONNECT(obj) ((obj) && (obj)->magic==VIR_CONNECT_MAGIC)
/** /**
@ -44,9 +44,9 @@
* magic value used to protect the API when pointers to domain structures * magic value used to protect the API when pointers to domain structures
* are passed down by the users. * are passed down by the users.
*/ */
#define VIR_DOMAIN_MAGIC 0xDEAD4321 # define VIR_DOMAIN_MAGIC 0xDEAD4321
#define VIR_IS_DOMAIN(obj) ((obj) && (obj)->magic==VIR_DOMAIN_MAGIC) # define VIR_IS_DOMAIN(obj) ((obj) && (obj)->magic==VIR_DOMAIN_MAGIC)
#define VIR_IS_CONNECTED_DOMAIN(obj) (VIR_IS_DOMAIN(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_DOMAIN(obj) (VIR_IS_DOMAIN(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**
* VIR_NETWORK_MAGIC: * VIR_NETWORK_MAGIC:
@ -54,9 +54,9 @@
* magic value used to protect the API when pointers to network structures * magic value used to protect the API when pointers to network structures
* are passed down by the users. * are passed down by the users.
*/ */
#define VIR_NETWORK_MAGIC 0xDEAD1234 # define VIR_NETWORK_MAGIC 0xDEAD1234
#define VIR_IS_NETWORK(obj) ((obj) && (obj)->magic==VIR_NETWORK_MAGIC) # define VIR_IS_NETWORK(obj) ((obj) && (obj)->magic==VIR_NETWORK_MAGIC)
#define VIR_IS_CONNECTED_NETWORK(obj) (VIR_IS_NETWORK(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_NETWORK(obj) (VIR_IS_NETWORK(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**
* VIR_INTERFACE_MAGIC: * VIR_INTERFACE_MAGIC:
@ -64,9 +64,9 @@
* magic value used to protect the API when pointers to interface structures * magic value used to protect the API when pointers to interface structures
* are passed down by the users. * are passed down by the users.
*/ */
#define VIR_INTERFACE_MAGIC 0xDEAD5309 # define VIR_INTERFACE_MAGIC 0xDEAD5309
#define VIR_IS_INTERFACE(obj) ((obj) && (obj)->magic==VIR_INTERFACE_MAGIC) # define VIR_IS_INTERFACE(obj) ((obj) && (obj)->magic==VIR_INTERFACE_MAGIC)
#define VIR_IS_CONNECTED_INTERFACE(obj) (VIR_IS_INTERFACE(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_INTERFACE(obj) (VIR_IS_INTERFACE(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**
* VIR_STORAGE_POOL_MAGIC: * VIR_STORAGE_POOL_MAGIC:
@ -74,9 +74,9 @@
* magic value used to protect the API when pointers to storage pool structures * magic value used to protect the API when pointers to storage pool structures
* are passed down by the users. * are passed down by the users.
*/ */
#define VIR_STORAGE_POOL_MAGIC 0xDEAD5678 # define VIR_STORAGE_POOL_MAGIC 0xDEAD5678
#define VIR_IS_STORAGE_POOL(obj) ((obj) && (obj)->magic==VIR_STORAGE_POOL_MAGIC) # define VIR_IS_STORAGE_POOL(obj) ((obj) && (obj)->magic==VIR_STORAGE_POOL_MAGIC)
#define VIR_IS_CONNECTED_STORAGE_POOL(obj) (VIR_IS_STORAGE_POOL(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_STORAGE_POOL(obj) (VIR_IS_STORAGE_POOL(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**
* VIR_STORAGE_VOL_MAGIC: * VIR_STORAGE_VOL_MAGIC:
@ -84,9 +84,9 @@
* magic value used to protect the API when pointers to storage vol structures * magic value used to protect the API when pointers to storage vol structures
* are passed down by the users. * are passed down by the users.
*/ */
#define VIR_STORAGE_VOL_MAGIC 0xDEAD8765 # define VIR_STORAGE_VOL_MAGIC 0xDEAD8765
#define VIR_IS_STORAGE_VOL(obj) ((obj) && (obj)->magic==VIR_STORAGE_VOL_MAGIC) # define VIR_IS_STORAGE_VOL(obj) ((obj) && (obj)->magic==VIR_STORAGE_VOL_MAGIC)
#define VIR_IS_CONNECTED_STORAGE_VOL(obj) (VIR_IS_STORAGE_VOL(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_STORAGE_VOL(obj) (VIR_IS_STORAGE_VOL(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**
* VIR_NODE_DEVICE_MAGIC: * VIR_NODE_DEVICE_MAGIC:
@ -94,9 +94,9 @@
* magic value used to protect the API when pointers to storage vol structures * magic value used to protect the API when pointers to storage vol structures
* are passed down by the users. * are passed down by the users.
*/ */
#define VIR_NODE_DEVICE_MAGIC 0xDEAD5679 # define VIR_NODE_DEVICE_MAGIC 0xDEAD5679
#define VIR_IS_NODE_DEVICE(obj) ((obj) && (obj)->magic==VIR_NODE_DEVICE_MAGIC) # define VIR_IS_NODE_DEVICE(obj) ((obj) && (obj)->magic==VIR_NODE_DEVICE_MAGIC)
#define VIR_IS_CONNECTED_NODE_DEVICE(obj) (VIR_IS_NODE_DEVICE(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_NODE_DEVICE(obj) (VIR_IS_NODE_DEVICE(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**
* VIR_SECRET_MAGIC: * VIR_SECRET_MAGIC:
@ -104,9 +104,9 @@
* magic value used to protect the API when pointers to secret structures are * magic value used to protect the API when pointers to secret structures are
* passed down by the users. * passed down by the users.
*/ */
#define VIR_SECRET_MAGIC 0x5678DEAD # define VIR_SECRET_MAGIC 0x5678DEAD
#define VIR_IS_SECRET(obj) ((obj) && (obj)->magic==VIR_SECRET_MAGIC) # define VIR_IS_SECRET(obj) ((obj) && (obj)->magic==VIR_SECRET_MAGIC)
#define VIR_IS_CONNECTED_SECRET(obj) (VIR_IS_SECRET(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_SECRET(obj) (VIR_IS_SECRET(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**
@ -115,9 +115,9 @@
* magic value used to protect the API when pointers to stream structures * magic value used to protect the API when pointers to stream structures
* are passed down by the users. * are passed down by the users.
*/ */
#define VIR_STREAM_MAGIC 0x1DEAD666 # define VIR_STREAM_MAGIC 0x1DEAD666
#define VIR_IS_STREAM(obj) ((obj) && (obj)->magic==VIR_STREAM_MAGIC) # define VIR_IS_STREAM(obj) ((obj) && (obj)->magic==VIR_STREAM_MAGIC)
#define VIR_IS_CONNECTED_STREAM(obj) (VIR_IS_STREAM(obj) && VIR_IS_CONNECT((obj)->conn)) # define VIR_IS_CONNECTED_STREAM(obj) (VIR_IS_STREAM(obj) && VIR_IS_CONNECT((obj)->conn))
/** /**

View File

@ -35,7 +35,7 @@
/* XXX re-implment this for other OS, or use libtools helper lib ? */ /* XXX re-implment this for other OS, or use libtools helper lib ? */
#include <dlfcn.h> # include <dlfcn.h>
void * void *
virDriverLoadModule(const char *name) virDriverLoadModule(const char *name)

View File

@ -4,14 +4,14 @@
*/ */
#ifndef __VIR_DRIVER_H__ #ifndef __VIR_DRIVER_H__
#define __VIR_DRIVER_H__ # define __VIR_DRIVER_H__
#include "config.h" # include "config.h"
#include <stdbool.h> # include <stdbool.h>
#include <libxml/uri.h> # include <libxml/uri.h>
#include "internal.h" # include "internal.h"
/* /*
* List of registered drivers numbers * List of registered drivers numbers
*/ */
@ -55,7 +55,7 @@ typedef enum {
* 0 Feature is not supported. * 0 Feature is not supported.
* -1 Error. * -1 Error.
*/ */
#define VIR_DRV_SUPPORTS_FEATURE(drv,conn,feature) \ # define VIR_DRV_SUPPORTS_FEATURE(drv,conn,feature) \
((drv)->supports_feature ? (drv)->supports_feature((conn),(feature)) : 0) ((drv)->supports_feature ? (drv)->supports_feature((conn),(feature)) : 0)
typedef virDrvOpenStatus typedef virDrvOpenStatus
@ -797,7 +797,7 @@ struct _virStorageDriver {
virDrvStoragePoolIsPersistent poolIsPersistent; virDrvStoragePoolIsPersistent poolIsPersistent;
}; };
#ifdef WITH_LIBVIRTD # ifdef WITH_LIBVIRTD
typedef int (*virDrvStateInitialize) (int privileged); typedef int (*virDrvStateInitialize) (int privileged);
typedef int (*virDrvStateCleanup) (void); typedef int (*virDrvStateCleanup) (void);
typedef int (*virDrvStateReload) (void); typedef int (*virDrvStateReload) (void);
@ -813,7 +813,7 @@ struct _virStateDriver {
virDrvStateReload reload; virDrvStateReload reload;
virDrvStateActive active; virDrvStateActive active;
}; };
#endif # endif
typedef struct _virDeviceMonitor virDeviceMonitor; typedef struct _virDeviceMonitor virDeviceMonitor;
@ -871,10 +871,10 @@ struct _virDeviceMonitor {
}; };
/* bits 16 and above of virDomainXMLFlags are for internal use */ /* bits 16 and above of virDomainXMLFlags are for internal use */
#define VIR_DOMAIN_XML_FLAGS_MASK 0xffff # define VIR_DOMAIN_XML_FLAGS_MASK 0xffff
/* Bits 16 and above of virSecretGetValue flags are for internal use */ /* Bits 16 and above of virSecretGetValue flags are for internal use */
#define VIR_SECRET_GET_VALUE_FLAGS_MASK 0xffff # define VIR_SECRET_GET_VALUE_FLAGS_MASK 0xffff
enum { enum {
/* This getValue call is inside libvirt, override the "private" flag. /* This getValue call is inside libvirt, override the "private" flag.
@ -993,9 +993,9 @@ int virRegisterInterfaceDriver(virInterfaceDriverPtr);
int virRegisterStorageDriver(virStorageDriverPtr); int virRegisterStorageDriver(virStorageDriverPtr);
int virRegisterDeviceMonitor(virDeviceMonitorPtr); int virRegisterDeviceMonitor(virDeviceMonitorPtr);
int virRegisterSecretDriver(virSecretDriverPtr); int virRegisterSecretDriver(virSecretDriverPtr);
#ifdef WITH_LIBVIRTD # ifdef WITH_LIBVIRTD
int virRegisterStateDriver(virStateDriverPtr); int virRegisterStateDriver(virStateDriverPtr);
#endif # endif
void *virDriverLoadModule(const char *name); void *virDriverLoadModule(const char *name);
#endif /* __VIR_DRIVER_H__ */ #endif /* __VIR_DRIVER_H__ */

View File

@ -22,7 +22,7 @@
*/ */
#ifndef __ESX_DEVICE_MONITOR_H__ #ifndef __ESX_DEVICE_MONITOR_H__
#define __ESX_DEVICE_MONITOR_H__ # define __ESX_DEVICE_MONITOR_H__
int esxDeviceRegister(void); int esxDeviceRegister(void);

View File

@ -99,8 +99,8 @@ esxSupportsLongMode(esxPrivate *priv)
for (hostCpuIdInfo = hostCpuIdInfoList; hostCpuIdInfo != NULL; for (hostCpuIdInfo = hostCpuIdInfoList; hostCpuIdInfo != NULL;
hostCpuIdInfo = hostCpuIdInfo->_next) { hostCpuIdInfo = hostCpuIdInfo->_next) {
if (hostCpuIdInfo->level->value == -2147483647) { /* 0x80000001 */ if (hostCpuIdInfo->level->value == -2147483647) { /* 0x80000001 */
#define _SKIP4 "%*c%*c%*c%*c" #define _SKIP4 "%*c%*c%*c%*c"
#define _SKIP12 _SKIP4":"_SKIP4":"_SKIP4 #define _SKIP12 _SKIP4":"_SKIP4":"_SKIP4
/* Expected format: "--X-:----:----:----:----:----:----:----" */ /* Expected format: "--X-:----:----:----:----:----:----:----" */
if (sscanf(hostCpuIdInfo->edx, if (sscanf(hostCpuIdInfo->edx,
@ -114,8 +114,8 @@ esxSupportsLongMode(esxPrivate *priv)
goto failure; goto failure;
} }
#undef _SKIP4 #undef _SKIP4
#undef _SKIP12 #undef _SKIP12
if (edxLongModeBit == '1') { if (edxLongModeBit == '1') {
priv->supportsLongMode = esxVI_Boolean_True; priv->supportsLongMode = esxVI_Boolean_True;

View File

@ -22,7 +22,7 @@
*/ */
#ifndef __ESX_DRIVER_H__ #ifndef __ESX_DRIVER_H__
#define __ESX_DRIVER_H__ # define __ESX_DRIVER_H__
int esxRegister(void); int esxRegister(void);

View File

@ -22,7 +22,7 @@
*/ */
#ifndef __ESX_INTERFACE_DRIVER_H__ #ifndef __ESX_INTERFACE_DRIVER_H__
#define __ESX_INTERFACE_DRIVER_H__ # define __ESX_INTERFACE_DRIVER_H__
int esxInterfaceRegister(void); int esxInterfaceRegister(void);

View File

@ -22,7 +22,7 @@
*/ */
#ifndef __ESX_NETWORK_DRIVER_H__ #ifndef __ESX_NETWORK_DRIVER_H__
#define __ESX_NETWORK_DRIVER_H__ # define __ESX_NETWORK_DRIVER_H__
int esxNetworkRegister(void); int esxNetworkRegister(void);

View File

@ -21,11 +21,11 @@
*/ */
#ifndef __ESX_PRIVATE_H__ #ifndef __ESX_PRIVATE_H__
#define __ESX_PRIVATE_H__ # define __ESX_PRIVATE_H__
#include "internal.h" # include "internal.h"
#include "capabilities.h" # include "capabilities.h"
#include "esx_vi.h" # include "esx_vi.h"
typedef struct _esxPrivate { typedef struct _esxPrivate {
esxVI_Context *host; esxVI_Context *host;

View File

@ -21,7 +21,7 @@
*/ */
#ifndef __ESX_SECRET_DRIVER_H__ #ifndef __ESX_SECRET_DRIVER_H__
#define __ESX_SECRET_DRIVER_H__ # define __ESX_SECRET_DRIVER_H__
int esxSecretRegister(void); int esxSecretRegister(void);

View File

@ -22,7 +22,7 @@
*/ */
#ifndef __ESX_STORAGE_DRIVER_H__ #ifndef __ESX_STORAGE_DRIVER_H__
#define __ESX_STORAGE_DRIVER_H__ # define __ESX_STORAGE_DRIVER_H__
int esxStorageRegister(void); int esxStorageRegister(void);

View File

@ -21,12 +21,12 @@
*/ */
#ifndef __ESX_UTIL_H__ #ifndef __ESX_UTIL_H__
#define __ESX_UTIL_H__ # define __ESX_UTIL_H__
#include <libxml/uri.h> # include <libxml/uri.h>
#include "internal.h" # include "internal.h"
#include "conf.h" # include "conf.h"
char *esxUtil_RequestUsername(virConnectAuthPtr auth, char *esxUtil_RequestUsername(virConnectAuthPtr auth,
const char *defaultUsername, const char *defaultUsername,

View File

@ -21,15 +21,15 @@
*/ */
#ifndef __ESX_VI_H__ #ifndef __ESX_VI_H__
#define __ESX_VI_H__ # define __ESX_VI_H__
#include <libxml/tree.h> # include <libxml/tree.h>
#include <libxml/xpath.h> # include <libxml/xpath.h>
#include <curl/curl.h> # include <curl/curl.h>
#include "internal.h" # include "internal.h"
#include "datatypes.h" # include "datatypes.h"
#include "esx_vi_types.h" # include "esx_vi_types.h"
typedef enum _esxVI_APIVersion esxVI_APIVersion; typedef enum _esxVI_APIVersion esxVI_APIVersion;
typedef enum _esxVI_ProductVersion esxVI_ProductVersion; typedef enum _esxVI_ProductVersion esxVI_ProductVersion;

View File

@ -21,10 +21,10 @@
*/ */
#ifndef __ESX_VI_METHODS_H__ #ifndef __ESX_VI_METHODS_H__
#define __ESX_VI_METHODS_H__ # define __ESX_VI_METHODS_H__
#include "esx_vi.h" # include "esx_vi.h"
#include "esx_vi_types.h" # include "esx_vi_types.h"

View File

@ -628,7 +628,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
} }
} }
#define _DESERIALIZE_NUMBER(_type, _xsdType, _name, _min, _max) \ #define _DESERIALIZE_NUMBER(_type, _xsdType, _name, _min, _max) \
do { \ do { \
if (virStrToLong_ll((*anyType)->value, NULL, 10, &number) < 0) { \ if (virStrToLong_ll((*anyType)->value, NULL, 10, &number) < 0) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
@ -672,7 +672,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
_DESERIALIZE_NUMBER(Long, "xsd:long", int64, INT64_MIN, INT64_MAX); _DESERIALIZE_NUMBER(Long, "xsd:long", int64, INT64_MIN, INT64_MAX);
} }
#undef _DESERIALIZE_NUMBER #undef _DESERIALIZE_NUMBER
return 0; return 0;

View File

@ -21,9 +21,9 @@
*/ */
#ifndef __ESX_VI_TYPES_H__ #ifndef __ESX_VI_TYPES_H__
#define __ESX_VI_TYPES_H__ # define __ESX_VI_TYPES_H__
#include "buf.h" # include "buf.h"

View File

@ -21,12 +21,12 @@
*/ */
#ifndef __ESX_VMX_H__ #ifndef __ESX_VMX_H__
#define __ESX_VMX_H__ # define __ESX_VMX_H__
#include "internal.h" # include "internal.h"
#include "conf.h" # include "conf.h"
#include "domain_conf.h" # include "domain_conf.h"
#include "esx_vi.h" # include "esx_vi.h"
int int
esxVMX_SCSIDiskNameToControllerAndID(const char *name, int *controller, int *id); esxVMX_SCSIDiskNameToControllerAndID(const char *name, int *controller, int *id);

View File

@ -22,16 +22,16 @@
#ifndef LIBVIRT_GNUTLS_1_0_COMPAT_H__ #ifndef LIBVIRT_GNUTLS_1_0_COMPAT_H__
#include <config.h> # include <config.h>
#ifdef GNUTLS_1_0_COMPAT # ifdef GNUTLS_1_0_COMPAT
#define gnutls_session_t gnutls_session # define gnutls_session_t gnutls_session
#define gnutls_x509_crt_t gnutls_x509_crt # define gnutls_x509_crt_t gnutls_x509_crt
#define gnutls_dh_params_t gnutls_dh_params # define gnutls_dh_params_t gnutls_dh_params
#define gnutls_transport_ptr_t gnutls_transport_ptr # define gnutls_transport_ptr_t gnutls_transport_ptr
#define gnutls_datum_t gnutls_datum # define gnutls_datum_t gnutls_datum
#define gnutls_certificate_credentials_t gnutls_certificate_credentials # define gnutls_certificate_credentials_t gnutls_certificate_credentials
#define gnutls_cipher_algorithm_t gnutls_cipher_algorithm # define gnutls_cipher_algorithm_t gnutls_cipher_algorithm
#endif # endif
#endif /* LIBVIRT_GNUTLS_1_0_COMPAT_H__ */ #endif /* LIBVIRT_GNUTLS_1_0_COMPAT_H__ */

View File

@ -22,7 +22,7 @@
#ifndef __VIR_INTERFACE__DRIVER_H #ifndef __VIR_INTERFACE__DRIVER_H
#define __VIR_INTERFACE__DRIVER_H # define __VIR_INTERFACE__DRIVER_H
int interfaceRegister(void); int interfaceRegister(void);

View File

@ -3,28 +3,28 @@
*/ */
#ifndef __VIR_INTERNAL_H__ #ifndef __VIR_INTERNAL_H__
#define __VIR_INTERNAL_H__ # define __VIR_INTERNAL_H__
#include <errno.h> # include <errno.h>
#include <limits.h> # include <limits.h>
#include <verify.h> # include <verify.h>
#ifdef HAVE_SYS_SYSLIMITS_H # ifdef HAVE_SYS_SYSLIMITS_H
#include <sys/syslimits.h> # include <sys/syslimits.h>
#endif # endif
/* The library itself is allowed to use deprecated functions / /* The library itself is allowed to use deprecated functions /
* variables, so effectively undefine the deprecated attribute * variables, so effectively undefine the deprecated attribute
* which would otherwise be defined in libvirt.h. * which would otherwise be defined in libvirt.h.
*/ */
#define VIR_DEPRECATED /*empty*/ # define VIR_DEPRECATED /*empty*/
#include "gettext.h" # include "gettext.h"
#include "libvirt/libvirt.h" # include "libvirt/libvirt.h"
#include "libvirt/virterror.h" # include "libvirt/virterror.h"
#include "libvirt_internal.h" # include "libvirt_internal.h"
/* On architectures which lack these limits, define them (ie. Cygwin). /* On architectures which lack these limits, define them (ie. Cygwin).
* Note that the libvirt code should be robust enough to handle the * Note that the libvirt code should be robust enough to handle the
@ -32,78 +32,78 @@
* length correctly in second argument to gethostname and by always * length correctly in second argument to gethostname and by always
* using strncpy instead of strcpy). * using strncpy instead of strcpy).
*/ */
#ifndef HOST_NAME_MAX # ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 256 # define HOST_NAME_MAX 256
#endif # endif
#ifndef IF_NAMESIZE # ifndef IF_NAMESIZE
#define IF_NAMESIZE 16 # define IF_NAMESIZE 16
#endif # endif
#ifndef INET_ADDRSTRLEN # ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16 # define INET_ADDRSTRLEN 16
#endif # endif
#define _(str) dgettext(GETTEXT_PACKAGE, (str)) # define _(str) dgettext(GETTEXT_PACKAGE, (str))
#define N_(str) str # define N_(str) str
/* String equality tests, suggested by Jim Meyering. */ /* String equality tests, suggested by Jim Meyering. */
#define STREQ(a,b) (strcmp(a,b) == 0) # define STREQ(a,b) (strcmp(a,b) == 0)
#define STRCASEEQ(a,b) (strcasecmp(a,b) == 0) # define STRCASEEQ(a,b) (strcasecmp(a,b) == 0)
#define STRNEQ(a,b) (strcmp(a,b) != 0) # define STRNEQ(a,b) (strcmp(a,b) != 0)
#define STRCASENEQ(a,b) (strcasecmp(a,b) != 0) # define STRCASENEQ(a,b) (strcasecmp(a,b) != 0)
#define STREQLEN(a,b,n) (strncmp(a,b,n) == 0) # define STREQLEN(a,b,n) (strncmp(a,b,n) == 0)
#define STRCASEEQLEN(a,b,n) (strncasecmp(a,b,n) == 0) # define STRCASEEQLEN(a,b,n) (strncasecmp(a,b,n) == 0)
#define STRNEQLEN(a,b,n) (strncmp(a,b,n) != 0) # define STRNEQLEN(a,b,n) (strncmp(a,b,n) != 0)
#define STRCASENEQLEN(a,b,n) (strncasecmp(a,b,n) != 0) # define STRCASENEQLEN(a,b,n) (strncasecmp(a,b,n) != 0)
#define STRPREFIX(a,b) (strncmp(a,b,strlen(b)) == 0) # define STRPREFIX(a,b) (strncmp(a,b,strlen(b)) == 0)
#define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0) # define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0)
#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) # define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
/* C99 uses __func__. __FUNCTION__ is legacy. */ /* C99 uses __func__. __FUNCTION__ is legacy. */
#ifndef __GNUC__ # ifndef __GNUC__
#define __FUNCTION__ __func__ # define __FUNCTION__ __func__
#endif # endif
#ifdef __GNUC__ # ifdef __GNUC__
#ifndef __GNUC_PREREQ # ifndef __GNUC_PREREQ
#if defined __GNUC__ && defined __GNUC_MINOR__ # if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \ # define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else # else
#define __GNUC_PREREQ(maj,min) 0 # define __GNUC_PREREQ(maj,min) 0
#endif # endif
/* Work around broken limits.h on debian etch */ /* Work around broken limits.h on debian etch */
#if defined _GCC_LIMITS_H_ && ! defined ULLONG_MAX # if defined _GCC_LIMITS_H_ && ! defined ULLONG_MAX
#define ULLONG_MAX ULONG_LONG_MAX # define ULLONG_MAX ULONG_LONG_MAX
#endif # endif
#endif /* __GNUC__ */ # endif /* __GNUC__ */
/** /**
* ATTRIBUTE_UNUSED: * ATTRIBUTE_UNUSED:
* *
* Macro to flag conciously unused parameters to functions * Macro to flag conciously unused parameters to functions
*/ */
#ifndef ATTRIBUTE_UNUSED # ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((__unused__)) # define ATTRIBUTE_UNUSED __attribute__((__unused__))
#endif # endif
/** /**
* ATTRIBUTE_SENTINEL: * ATTRIBUTE_SENTINEL:
* *
* Macro to check for NULL-terminated varargs lists * Macro to check for NULL-terminated varargs lists
*/ */
#ifndef ATTRIBUTE_SENTINEL # ifndef ATTRIBUTE_SENTINEL
#if __GNUC_PREREQ (4, 0) # if __GNUC_PREREQ (4, 0)
#define ATTRIBUTE_SENTINEL __attribute__((__sentinel__)) # define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
#else # else
#define ATTRIBUTE_SENTINEL # define ATTRIBUTE_SENTINEL
#endif # endif
#endif # endif
/** /**
* ATTRIBUTE_FMT_PRINTF * ATTRIBUTE_FMT_PRINTF
@ -115,46 +115,46 @@
* printf format specifiers even on broken Win32 platforms * printf format specifiers even on broken Win32 platforms
* hence we have to force 'gnu_printf' for new GCC * hence we have to force 'gnu_printf' for new GCC
*/ */
#ifndef ATTRIBUTE_FMT_PRINTF # ifndef ATTRIBUTE_FMT_PRINTF
#if __GNUC_PREREQ (4, 4) # if __GNUC_PREREQ (4, 4)
#define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (gnu_printf, fmtpos,argpos))) # define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (gnu_printf, fmtpos,argpos)))
#else # else
#define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (printf, fmtpos,argpos))) # define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (printf, fmtpos,argpos)))
#endif # endif
#endif # endif
#ifndef ATTRIBUTE_RETURN_CHECK # ifndef ATTRIBUTE_RETURN_CHECK
#if __GNUC_PREREQ (3, 4) # if __GNUC_PREREQ (3, 4)
#define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__)) # define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))
#else # else
#define ATTRIBUTE_RETURN_CHECK # define ATTRIBUTE_RETURN_CHECK
#endif # endif
#endif # endif
# ifndef ATTRIBUTE_NONNULL
# if __GNUC_PREREQ (3, 3)
# define ATTRIBUTE_NONNULL(m) __attribute__((__nonnull__(m)))
# else
# define ATTRIBUTE_NONNULL(m)
# endif
# endif
#ifndef ATTRIBUTE_NONNULL
# if __GNUC_PREREQ (3, 3)
# define ATTRIBUTE_NONNULL(m) __attribute__((__nonnull__(m)))
# else # else
# define ATTRIBUTE_NONNULL(m) # ifndef ATTRIBUTE_UNUSED
# endif # define ATTRIBUTE_UNUSED
#endif # endif
# ifndef ATTRIBUTE_FMT_PRINTF
#else # define ATTRIBUTE_FMT_PRINTF(...)
#ifndef ATTRIBUTE_UNUSED # endif
#define ATTRIBUTE_UNUSED # ifndef ATTRIBUTE_RETURN_CHECK
#endif # define ATTRIBUTE_RETURN_CHECK
#ifndef ATTRIBUTE_FMT_PRINTF # endif
#define ATTRIBUTE_FMT_PRINTF(...) # endif /* __GNUC__ */
#endif
#ifndef ATTRIBUTE_RETURN_CHECK
#define ATTRIBUTE_RETURN_CHECK
#endif
#endif /* __GNUC__ */
/* /*
* Use this when passing possibly-NULL strings to printf-a-likes. * Use this when passing possibly-NULL strings to printf-a-likes.
*/ */
#define NULLSTR(s) \ # define NULLSTR(s) \
((void)verify_true(sizeof *(s) == sizeof (char)), \ ((void)verify_true(sizeof *(s) == sizeof (char)), \
(s) ? (s) : "(null)") (s) ? (s) : "(null)")
@ -163,7 +163,7 @@
* *
* macro to flag unimplemented blocks * macro to flag unimplemented blocks
*/ */
#define TODO \ # define TODO \
fprintf(stderr, "Unimplemented block at %s:%d\n", \ fprintf(stderr, "Unimplemented block at %s:%d\n", \
__FILE__, __LINE__); __FILE__, __LINE__);

View File

@ -19,7 +19,7 @@
#include <unistd.h> #include <unistd.h>
#include <assert.h> #include <assert.h>
#ifdef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> # include <sys/wait.h>
#endif #endif
#include <time.h> #include <time.h>
#include <gcrypt.h> #include <gcrypt.h>
@ -30,7 +30,7 @@
#include "getpass.h" #include "getpass.h"
#ifdef HAVE_WINSOCK2_H #ifdef HAVE_WINSOCK2_H
#include <winsock2.h> # include <winsock2.h>
#endif #endif
#include "virterror_internal.h" #include "virterror_internal.h"
@ -43,27 +43,27 @@
#include "memory.h" #include "memory.h"
#ifndef WITH_DRIVER_MODULES #ifndef WITH_DRIVER_MODULES
#ifdef WITH_TEST # ifdef WITH_TEST
#include "test/test_driver.h" # include "test/test_driver.h"
#endif # endif
#ifdef WITH_XEN # ifdef WITH_XEN
#include "xen/xen_driver.h" # include "xen/xen_driver.h"
#endif # endif
#ifdef WITH_REMOTE # ifdef WITH_REMOTE
#include "remote/remote_driver.h" # include "remote/remote_driver.h"
#endif # endif
#ifdef WITH_OPENVZ # ifdef WITH_OPENVZ
#include "openvz/openvz_driver.h" # include "openvz/openvz_driver.h"
#endif # endif
#ifdef WITH_PHYP # ifdef WITH_PHYP
#include "phyp/phyp_driver.h" # include "phyp/phyp_driver.h"
#endif # endif
#ifdef WITH_VBOX # ifdef WITH_VBOX
#include "vbox/vbox_driver.h" # include "vbox/vbox_driver.h"
#endif # endif
#ifdef WITH_ESX # ifdef WITH_ESX
#include "esx/esx_driver.h" # include "esx/esx_driver.h"
#endif # endif
#endif #endif
#define VIR_FROM_THIS VIR_FROM_NONE #define VIR_FROM_THIS VIR_FROM_NONE
@ -359,27 +359,27 @@ virInitialize(void)
virDriverLoadModule("esx"); virDriverLoadModule("esx");
virDriverLoadModule("remote"); virDriverLoadModule("remote");
#else #else
#ifdef WITH_TEST # ifdef WITH_TEST
if (testRegister() == -1) return -1; if (testRegister() == -1) return -1;
#endif # endif
#ifdef WITH_XEN # ifdef WITH_XEN
if (xenRegister () == -1) return -1; if (xenRegister () == -1) return -1;
#endif # endif
#ifdef WITH_OPENVZ # ifdef WITH_OPENVZ
if (openvzRegister() == -1) return -1; if (openvzRegister() == -1) return -1;
#endif # endif
#ifdef WITH_PHYP # ifdef WITH_PHYP
if (phypRegister() == -1) return -1; if (phypRegister() == -1) return -1;
#endif # endif
#ifdef WITH_VBOX # ifdef WITH_VBOX
if (vboxRegister() == -1) return -1; if (vboxRegister() == -1) return -1;
#endif # endif
#ifdef WITH_ESX # ifdef WITH_ESX
if (esxRegister() == -1) return -1; if (esxRegister() == -1) return -1;
#endif # endif
#ifdef WITH_REMOTE # ifdef WITH_REMOTE
if (remoteRegister () == -1) return -1; if (remoteRegister () == -1) return -1;
#endif # endif
#endif #endif
return(0); return(0);
@ -991,50 +991,50 @@ virGetVersion(unsigned long *libVer, const char *type,
#else #else
*typeVer = 0; *typeVer = 0;
#if WITH_XEN # if WITH_XEN
if (STRCASEEQ(type, "Xen")) if (STRCASEEQ(type, "Xen"))
*typeVer = xenUnifiedVersion(); *typeVer = xenUnifiedVersion();
#endif # endif
#if WITH_TEST # if WITH_TEST
if (STRCASEEQ(type, "Test")) if (STRCASEEQ(type, "Test"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_QEMU # if WITH_QEMU
if (STRCASEEQ(type, "QEMU")) if (STRCASEEQ(type, "QEMU"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_LXC # if WITH_LXC
if (STRCASEEQ(type, "LXC")) if (STRCASEEQ(type, "LXC"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_PHYP # if WITH_PHYP
if (STRCASEEQ(type, "phyp")) if (STRCASEEQ(type, "phyp"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_OPENVZ # if WITH_OPENVZ
if (STRCASEEQ(type, "OpenVZ")) if (STRCASEEQ(type, "OpenVZ"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_VBOX # if WITH_VBOX
if (STRCASEEQ(type, "VBox")) if (STRCASEEQ(type, "VBox"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_UML # if WITH_UML
if (STRCASEEQ(type, "UML")) if (STRCASEEQ(type, "UML"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_ONE # if WITH_ONE
if (STRCASEEQ(type, "ONE")) if (STRCASEEQ(type, "ONE"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_ESX # if WITH_ESX
if (STRCASEEQ(type, "ESX")) if (STRCASEEQ(type, "ESX"))
*typeVer = LIBVIR_VERSION_NUMBER; *typeVer = LIBVIR_VERSION_NUMBER;
#endif # endif
#if WITH_REMOTE # if WITH_REMOTE
if (STRCASEEQ(type, "Remote")) if (STRCASEEQ(type, "Remote"))
*typeVer = remoteVersion(); *typeVer = remoteVersion();
#endif # endif
if (*typeVer == 0) { if (*typeVer == 0) {
virLibConnError(NULL, VIR_ERR_NO_SUPPORT, type); virLibConnError(NULL, VIR_ERR_NO_SUPPORT, type);
goto error; goto error;

View File

@ -23,16 +23,16 @@
*/ */
#ifndef __LIBVIRT_H_ #ifndef __LIBVIRT_H_
#define __LIBVIRT_H_ # define __LIBVIRT_H_
#include "internal.h" # include "internal.h"
#ifdef WITH_LIBVIRTD # ifdef WITH_LIBVIRTD
int virStateInitialize(int privileged); int virStateInitialize(int privileged);
int virStateCleanup(void); int virStateCleanup(void);
int virStateReload(void); int virStateReload(void);
int virStateActive(void); int virStateActive(void);
#endif # endif
/* Feature detection. This is a libvirt-private interface for determining /* Feature detection. This is a libvirt-private interface for determining
* what features are supported by the driver. * what features are supported by the driver.

View File

@ -23,21 +23,21 @@
*/ */
#ifndef LXC_CONF_H #ifndef LXC_CONF_H
#define LXC_CONF_H # define LXC_CONF_H
#include <config.h> # include <config.h>
#include "internal.h" # include "internal.h"
#include "domain_conf.h" # include "domain_conf.h"
#include "domain_event.h" # include "domain_event.h"
#include "capabilities.h" # include "capabilities.h"
#include "threads.h" # include "threads.h"
#include "cgroup.h" # include "cgroup.h"
#define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc" # define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc"
#define LXC_STATE_DIR LOCAL_STATE_DIR "/run/libvirt/lxc" # define LXC_STATE_DIR LOCAL_STATE_DIR "/run/libvirt/lxc"
#define LXC_LOG_DIR LOCAL_STATE_DIR "/log/libvirt/lxc" # define LXC_LOG_DIR LOCAL_STATE_DIR "/log/libvirt/lxc"
#define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart" # define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
typedef struct __lxc_driver lxc_driver_t; typedef struct __lxc_driver lxc_driver_t;
struct __lxc_driver { struct __lxc_driver {
@ -64,7 +64,7 @@ struct __lxc_driver {
int lxcLoadDriverConfig(lxc_driver_t *driver); int lxcLoadDriverConfig(lxc_driver_t *driver);
virCapsPtr lxcCapsInit(void); virCapsPtr lxcCapsInit(void);
#define lxcError(code, ...) \ # define lxcError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_LXC, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_LXC, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -43,7 +43,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#if HAVE_CAPNG #if HAVE_CAPNG
#include <cap-ng.h> # include <cap-ng.h>
#endif #endif
#include "virterror_internal.h" #include "virterror_internal.h"
@ -61,19 +61,19 @@
*/ */
#ifndef CLONE_NEWPID #ifndef CLONE_NEWPID
#define CLONE_NEWPID 0x20000000 # define CLONE_NEWPID 0x20000000
#endif #endif
#ifndef CLONE_NEWUTS #ifndef CLONE_NEWUTS
#define CLONE_NEWUTS 0x04000000 # define CLONE_NEWUTS 0x04000000
#endif #endif
#ifndef CLONE_NEWUSER #ifndef CLONE_NEWUSER
#define CLONE_NEWUSER 0x10000000 # define CLONE_NEWUSER 0x10000000
#endif #endif
#ifndef CLONE_NEWIPC #ifndef CLONE_NEWIPC
#define CLONE_NEWIPC 0x08000000 # define CLONE_NEWIPC 0x08000000
#endif #endif
#ifndef CLONE_NEWNET #ifndef CLONE_NEWNET
#define CLONE_NEWNET 0x40000000 /* New network namespace */ # define CLONE_NEWNET 0x40000000 /* New network namespace */
#endif #endif
/* messages between parent and container */ /* messages between parent and container */
@ -289,19 +289,19 @@ static int lxcContainerChildMountSort(const void *a, const void *b)
} }
#ifndef MS_REC #ifndef MS_REC
#define MS_REC 16384 # define MS_REC 16384
#endif #endif
#ifndef MNT_DETACH #ifndef MNT_DETACH
#define MNT_DETACH 0x00000002 # define MNT_DETACH 0x00000002
#endif #endif
#ifndef MS_PRIVATE #ifndef MS_PRIVATE
#define MS_PRIVATE (1<<18) # define MS_PRIVATE (1<<18)
#endif #endif
#ifndef MS_SLAVE #ifndef MS_SLAVE
#define MS_SLAVE (1<<19) # define MS_SLAVE (1<<19)
#endif #endif
static int lxcContainerPivotRoot(virDomainFSDefPtr root) static int lxcContainerPivotRoot(virDomainFSDefPtr root)

View File

@ -22,28 +22,28 @@
*/ */
#ifndef LXC_CONTAINER_H #ifndef LXC_CONTAINER_H
#define LXC_CONTAINER_H # define LXC_CONTAINER_H
#include "lxc_conf.h" # include "lxc_conf.h"
enum { enum {
LXC_CONTAINER_FEATURE_NET = (1 << 0), LXC_CONTAINER_FEATURE_NET = (1 << 0),
LXC_CONTAINER_FEATURE_USER = (1 << 1), LXC_CONTAINER_FEATURE_USER = (1 << 1),
}; };
#define LXC_DEV_MAJ_MEMORY 1 # define LXC_DEV_MAJ_MEMORY 1
#define LXC_DEV_MIN_NULL 3 # define LXC_DEV_MIN_NULL 3
#define LXC_DEV_MIN_ZERO 5 # define LXC_DEV_MIN_ZERO 5
#define LXC_DEV_MIN_FULL 7 # define LXC_DEV_MIN_FULL 7
#define LXC_DEV_MIN_RANDOM 8 # define LXC_DEV_MIN_RANDOM 8
#define LXC_DEV_MIN_URANDOM 9 # define LXC_DEV_MIN_URANDOM 9
#define LXC_DEV_MAJ_TTY 5 # define LXC_DEV_MAJ_TTY 5
#define LXC_DEV_MIN_TTY 0 # define LXC_DEV_MIN_TTY 0
#define LXC_DEV_MIN_CONSOLE 1 # define LXC_DEV_MIN_CONSOLE 1
#define LXC_DEV_MIN_PTMX 2 # define LXC_DEV_MIN_PTMX 2
#define LXC_DEV_MAJ_PTY 136 # define LXC_DEV_MAJ_PTY 136
int lxcContainerSendContinue(int control); int lxcContainerSendContinue(int control);

View File

@ -36,7 +36,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#if HAVE_CAPNG #if HAVE_CAPNG
#include <cap-ng.h> # include <cap-ng.h>
#endif #endif
#include "virterror_internal.h" #include "virterror_internal.h"
@ -485,11 +485,11 @@ static int lxcControllerCleanupInterfaces(unsigned int nveths,
} }
#ifndef MS_REC #ifndef MS_REC
#define MS_REC 16384 # define MS_REC 16384
#endif #endif
#ifndef MS_SLAVE #ifndef MS_SLAVE
#define MS_SLAVE (1<<19) # define MS_SLAVE (1<<19)
#endif #endif
static int static int

View File

@ -22,9 +22,9 @@
*/ */
#ifndef LXC_DRIVER_H #ifndef LXC_DRIVER_H
#define LXC_DRIVER_H # define LXC_DRIVER_H
#include <config.h> # include <config.h>
/* Function declarations */ /* Function declarations */
int lxcRegister(void); int lxcRegister(void);

View File

@ -10,9 +10,9 @@
*/ */
#ifndef VETH_H #ifndef VETH_H
#define VETH_H # define VETH_H
#include <config.h> # include <config.h>
/* Function declarations */ /* Function declarations */
int vethCreate(char* veth1, int veth1MaxLen, char* veth2, int vethCreate(char* veth1, int veth1MaxLen, char* veth2,

View File

@ -23,11 +23,11 @@
#ifndef __VIR_NETWORK__DRIVER_H #ifndef __VIR_NETWORK__DRIVER_H
#define __VIR_NETWORK__DRIVER_H # define __VIR_NETWORK__DRIVER_H
#include <config.h> # include <config.h>
#include "internal.h" # include "internal.h"
int networkRegister(void); int networkRegister(void);

View File

@ -662,11 +662,11 @@ int nodedevRegister(void) {
return udevNodeRegister(); return udevNodeRegister();
return 0; return 0;
#else #else
#ifdef HAVE_HAL # ifdef HAVE_HAL
return halNodeRegister(); return halNodeRegister();
#endif # endif
#ifdef HAVE_UDEV # ifdef HAVE_UDEV
return udevNodeRegister(); return udevNodeRegister();
#endif # endif
#endif #endif
} }

View File

@ -22,33 +22,33 @@
*/ */
#ifndef __VIR_NODE_DEVICE_H__ #ifndef __VIR_NODE_DEVICE_H__
#define __VIR_NODE_DEVICE_H__ # define __VIR_NODE_DEVICE_H__
#include "internal.h" # include "internal.h"
#include "driver.h" # include "driver.h"
#include "node_device_conf.h" # include "node_device_conf.h"
#define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host" # define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host"
#define LINUX_SYSFS_SCSI_HOST_POSTFIX "device" # define LINUX_SYSFS_SCSI_HOST_POSTFIX "device"
#define LINUX_SYSFS_FC_HOST_PREFIX "/sys/class/fc_host/" # define LINUX_SYSFS_FC_HOST_PREFIX "/sys/class/fc_host/"
#define VPORT_CREATE 0 # define VPORT_CREATE 0
#define VPORT_DELETE 1 # define VPORT_DELETE 1
#define LINUX_SYSFS_VPORT_CREATE_POSTFIX "/vport_create" # define LINUX_SYSFS_VPORT_CREATE_POSTFIX "/vport_create"
#define LINUX_SYSFS_VPORT_DELETE_POSTFIX "/vport_delete" # define LINUX_SYSFS_VPORT_DELETE_POSTFIX "/vport_delete"
#define SRIOV_FOUND 0 # define SRIOV_FOUND 0
#define SRIOV_NOT_FOUND 1 # define SRIOV_NOT_FOUND 1
#define SRIOV_ERROR -1 # define SRIOV_ERROR -1
#define LINUX_NEW_DEVICE_WAIT_TIME 60 # define LINUX_NEW_DEVICE_WAIT_TIME 60
#ifdef HAVE_HAL # ifdef HAVE_HAL
int halNodeRegister(void); int halNodeRegister(void);
#endif # endif
#ifdef HAVE_UDEV # ifdef HAVE_UDEV
int udevNodeRegister(void); int udevNodeRegister(void);
#endif # endif
void nodeDeviceLock(virDeviceMonitorStatePtr driver); void nodeDeviceLock(virDeviceMonitorStatePtr driver);
void nodeDeviceUnlock(virDeviceMonitorStatePtr driver); void nodeDeviceUnlock(virDeviceMonitorStatePtr driver);
@ -57,33 +57,33 @@ void registerCommonNodeFuncs(virDeviceMonitorPtr mon);
int nodedevRegister(void); int nodedevRegister(void);
#ifdef __linux__ # ifdef __linux__
#define check_fc_host(d) check_fc_host_linux(d) # define check_fc_host(d) check_fc_host_linux(d)
int check_fc_host_linux(union _virNodeDevCapData *d); int check_fc_host_linux(union _virNodeDevCapData *d);
#define check_vport_capable(d) check_vport_capable_linux(d) # define check_vport_capable(d) check_vport_capable_linux(d)
int check_vport_capable_linux(union _virNodeDevCapData *d); int check_vport_capable_linux(union _virNodeDevCapData *d);
#define get_physical_function(s,d) get_physical_function_linux(s,d) # define get_physical_function(s,d) get_physical_function_linux(s,d)
int get_physical_function_linux(const char *sysfs_path, int get_physical_function_linux(const char *sysfs_path,
union _virNodeDevCapData *d); union _virNodeDevCapData *d);
#define get_virtual_functions(s,d) get_virtual_functions_linux(s,d) # define get_virtual_functions(s,d) get_virtual_functions_linux(s,d)
int get_virtual_functions_linux(const char *sysfs_path, int get_virtual_functions_linux(const char *sysfs_path,
union _virNodeDevCapData *d); union _virNodeDevCapData *d);
#define read_wwn(host, file, wwn) read_wwn_linux(host, file, wwn) # define read_wwn(host, file, wwn) read_wwn_linux(host, file, wwn)
int read_wwn_linux(int host, const char *file, char **wwn); int read_wwn_linux(int host, const char *file, char **wwn);
#else /* __linux__ */ # else /* __linux__ */
#define check_fc_host(d) # define check_fc_host(d)
#define check_vport_capable(d) # define check_vport_capable(d)
#define get_physical_function(sysfs_path, d) # define get_physical_function(sysfs_path, d)
#define get_virtual_functions(sysfs_path, d) # define get_virtual_functions(sysfs_path, d)
#define read_wwn(host, file, wwn) # define read_wwn(host, file, wwn)
#endif /* __linux__ */ # endif /* __linux__ */
#endif /* __VIR_NODE_DEVICE_H__ */ #endif /* __VIR_NODE_DEVICE_H__ */

View File

@ -20,6 +20,6 @@
*/ */
#ifndef __VIR_NODE_DEVICE_HAL_H__ #ifndef __VIR_NODE_DEVICE_HAL_H__
#define __VIR_NODE_DEVICE_HAL_H__ # define __VIR_NODE_DEVICE_HAL_H__
#endif /* __VIR_NODE_DEVICE_HAL_H__ */ #endif /* __VIR_NODE_DEVICE_HAL_H__ */

View File

@ -36,7 +36,7 @@
#endif #endif
#ifdef HAVE_SYS_UTSNAME_H #ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h> # include <sys/utsname.h>
#endif #endif
#include "c-ctype.h" #include "c-ctype.h"
@ -56,8 +56,8 @@
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)
#ifdef __linux__ #ifdef __linux__
#define CPUINFO_PATH "/proc/cpuinfo" # define CPUINFO_PATH "/proc/cpuinfo"
#define CPU_SYS_PATH "/sys/devices/system/cpu" # define CPU_SYS_PATH "/sys/devices/system/cpu"
/* NB, this is not static as we need to call it from the testsuite */ /* NB, this is not static as we need to call it from the testsuite */
int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo,

View File

@ -22,10 +22,10 @@
*/ */
#ifndef __VIR_NODEINFO_H__ #ifndef __VIR_NODEINFO_H__
#define __VIR_NODEINFO_H__ # define __VIR_NODEINFO_H__
#include "libvirt/libvirt.h" # include "libvirt/libvirt.h"
#include "capabilities.h" # include "capabilities.h"
int nodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo); int nodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo);
int nodeCapsInitNUMA(virCapsPtr caps); int nodeCapsInitNUMA(virCapsPtr caps);

View File

@ -17,10 +17,10 @@
*/ */
#ifndef ONE_CLIENT_H_ #ifndef ONE_CLIENT_H_
#define ONE_CLIENT_H_ # define ONE_CLIENT_H_
#include <xmlrpc-c/base.h> # include <xmlrpc-c/base.h>
#include <xmlrpc-c/client.h> # include <xmlrpc-c/client.h>
struct _oneClient { struct _oneClient {
xmlrpc_env env; xmlrpc_env env;

View File

@ -21,15 +21,15 @@
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
#ifndef ONE_CONF_H #ifndef ONE_CONF_H
#define ONE_CONF_H # define ONE_CONF_H
#include <config.h> # include <config.h>
#include "internal.h" # include "internal.h"
#include "domain_conf.h" # include "domain_conf.h"
#include "capabilities.h" # include "capabilities.h"
#include "threads.h" # include "threads.h"
#include "one_client.h" # include "one_client.h"
struct one_driver{ struct one_driver{
virMutex lock; virMutex lock;
@ -47,7 +47,7 @@ int oneSubmitVM(virConnectPtr conn ,one_driver_t* driver, virDomainObjPtr vm);
char* xmlOneTemplate(virDomainDefPtr def); char* xmlOneTemplate(virDomainDefPtr def);
#define oneError(conn, dom, code, ...) \ # define oneError(conn, dom, code, ...) \
virReportErrorHelper(conn, VIR_FROM_ONE, code, __FILE__, \ virReportErrorHelper(conn, VIR_FROM_ONE, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -20,10 +20,10 @@
#ifndef ONE_DRIVER_H #ifndef ONE_DRIVER_H
#define ONE_DRIVER_H # define ONE_DRIVER_H
#include <config.h> # include <config.h>
#include "one_client.h" # include "one_client.h"
int oneRegister(void); int oneRegister(void);

View File

@ -27,25 +27,25 @@
*/ */
#ifndef OPENVZ_CONF_H #ifndef OPENVZ_CONF_H
#define OPENVZ_CONF_H # define OPENVZ_CONF_H
#include "internal.h" # include "internal.h"
#include "domain_conf.h" # include "domain_conf.h"
#include "threads.h" # include "threads.h"
enum { OPENVZ_WARN, OPENVZ_ERR }; enum { OPENVZ_WARN, OPENVZ_ERR };
#define openvzError(conn, code, ...) \ # define openvzError(conn, code, ...) \
virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__, \ virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)
/* OpenVZ commands - Replace with wrapper scripts later? */ /* OpenVZ commands - Replace with wrapper scripts later? */
#define VZLIST "/usr/sbin/vzlist" # define VZLIST "/usr/sbin/vzlist"
#define VZCTL "/usr/sbin/vzctl" # define VZCTL "/usr/sbin/vzctl"
#define VZ_CONF_FILE "/etc/vz/vz.conf" # define VZ_CONF_FILE "/etc/vz/vz.conf"
#define VZCTL_BRIDGE_MIN_VERSION ((3 * 1000 * 1000) + (0 * 1000) + 22 + 1) # define VZCTL_BRIDGE_MIN_VERSION ((3 * 1000 * 1000) + (0 * 1000) + 22 + 1)
struct openvz_driver { struct openvz_driver {
virMutex lock; virMutex lock;

View File

@ -27,9 +27,9 @@
#ifndef OPENVZ_DRIVER_H #ifndef OPENVZ_DRIVER_H
#define OPENVZ_DRIVER_H # define OPENVZ_DRIVER_H
#include "internal.h" # include "internal.h"
int openvzRegister(void); int openvzRegister(void);

View File

@ -21,7 +21,7 @@
*/ */
#ifndef __QEMUD_BRIDGE_FILTER_H__ #ifndef __QEMUD_BRIDGE_FILTER_H__
#define __QEMUD_BRIDGE_FILTER_H__ # define __QEMUD_BRIDGE_FILTER_H__
int networkAllowMacOnPort(struct qemud_driver *driver, int networkAllowMacOnPort(struct qemud_driver *driver,

View File

@ -22,27 +22,27 @@
*/ */
#ifndef __QEMUD_CONF_H #ifndef __QEMUD_CONF_H
#define __QEMUD_CONF_H # define __QEMUD_CONF_H
#include <config.h> # include <config.h>
#include "ebtables.h" # include "ebtables.h"
#include "internal.h" # include "internal.h"
#include "bridge.h" # include "bridge.h"
#include "capabilities.h" # include "capabilities.h"
#include "network_conf.h" # include "network_conf.h"
#include "domain_conf.h" # include "domain_conf.h"
#include "domain_event.h" # include "domain_event.h"
#include "threads.h" # include "threads.h"
#include "security/security_driver.h" # include "security/security_driver.h"
#include "cgroup.h" # include "cgroup.h"
#include "pci.h" # include "pci.h"
#include "cpu_conf.h" # include "cpu_conf.h"
#include "driver.h" # include "driver.h"
#define qemudDebug(fmt, ...) do {} while(0) # define qemudDebug(fmt, ...) do {} while(0)
#define QEMUD_CPUMASK_LEN CPU_SETSIZE # define QEMUD_CPUMASK_LEN CPU_SETSIZE
/* Internal flags to keep track of qemu command line capabilities */ /* Internal flags to keep track of qemu command line capabilities */
enum qemud_cmd_flags { enum qemud_cmd_flags {
@ -152,16 +152,16 @@ typedef struct _qemuDomainPCIAddressSet qemuDomainPCIAddressSet;
typedef qemuDomainPCIAddressSet *qemuDomainPCIAddressSetPtr; typedef qemuDomainPCIAddressSet *qemuDomainPCIAddressSetPtr;
/* Port numbers used for KVM migration. */ /* Port numbers used for KVM migration. */
#define QEMUD_MIGRATION_FIRST_PORT 49152 # define QEMUD_MIGRATION_FIRST_PORT 49152
#define QEMUD_MIGRATION_NUM_PORTS 64 # define QEMUD_MIGRATION_NUM_PORTS 64
/* Config type for XML import/export conversions */ /* Config type for XML import/export conversions */
#define QEMU_CONFIG_FORMAT_ARGV "qemu-argv" # define QEMU_CONFIG_FORMAT_ARGV "qemu-argv"
#define QEMU_DRIVE_HOST_PREFIX "drive-" # define QEMU_DRIVE_HOST_PREFIX "drive-"
#define QEMU_VIRTIO_SERIAL_PREFIX "virtio-serial" # define QEMU_VIRTIO_SERIAL_PREFIX "virtio-serial"
#define qemuReportError(code, ...) \ # define qemuReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_QEMU, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_QEMU, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -48,10 +48,10 @@
#include <sys/un.h> #include <sys/un.h>
#ifdef __linux__ #ifdef __linux__
#include <sys/vfs.h> # include <sys/vfs.h>
#ifndef NFS_SUPER_MAGIC # ifndef NFS_SUPER_MAGIC
#define NFS_SUPER_MAGIC 0x6969 # define NFS_SUPER_MAGIC 0x6969
#endif /* NFS_SUPER_MAGIC */ # endif /* NFS_SUPER_MAGIC */
#endif /* __linux__ */ #endif /* __linux__ */
#include "virterror_internal.h" #include "virterror_internal.h"

View File

@ -23,29 +23,29 @@
#ifndef QEMUD_DRIVER_H #ifndef QEMUD_DRIVER_H
#define QEMUD_DRIVER_H # define QEMUD_DRIVER_H
#include <config.h> # include <config.h>
#include "internal.h" # include "internal.h"
#if HAVE_LINUX_KVM_H # if HAVE_LINUX_KVM_H
#include <linux/kvm.h> # include <linux/kvm.h>
#endif # endif
/* device for kvm ioctls */ /* device for kvm ioctls */
#define KVM_DEVICE "/dev/kvm" # define KVM_DEVICE "/dev/kvm"
/* add definitions missing in older linux/kvm.h */ /* add definitions missing in older linux/kvm.h */
#ifndef KVMIO # ifndef KVMIO
# define KVMIO 0xAE # define KVMIO 0xAE
#endif # endif
#ifndef KVM_CHECK_EXTENSION # ifndef KVM_CHECK_EXTENSION
# define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) # define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03)
#endif # endif
#ifndef KVM_CAP_NR_VCPUS # ifndef KVM_CAP_NR_VCPUS
# define KVM_CAP_NR_VCPUS 9 /* returns max vcpus per vm */ # define KVM_CAP_NR_VCPUS 9 /* returns max vcpus per vm */
#endif # endif
int qemuRegister(void); int qemuRegister(void);

View File

@ -166,7 +166,7 @@ char *qemuMonitorEscapeShell(const char *in)
#if QEMU_DEBUG_RAW_IO #if QEMU_DEBUG_RAW_IO
#include <c-ctype.h> # include <c-ctype.h>
static char * qemuMonitorEscapeNonPrintable(const char *text) static char * qemuMonitorEscapeNonPrintable(const char *text)
{ {
int i; int i;

View File

@ -23,12 +23,12 @@
#ifndef QEMU_MONITOR_H #ifndef QEMU_MONITOR_H
#define QEMU_MONITOR_H # define QEMU_MONITOR_H
#include "internal.h" # include "internal.h"
#include "domain_conf.h" # include "domain_conf.h"
#include "hash.h" # include "hash.h"
typedef struct _qemuMonitor qemuMonitor; typedef struct _qemuMonitor qemuMonitor;
typedef qemuMonitor *qemuMonitorPtr; typedef qemuMonitor *qemuMonitorPtr;

View File

@ -23,11 +23,11 @@
#ifndef QEMU_MONITOR_JSON_H #ifndef QEMU_MONITOR_JSON_H
#define QEMU_MONITOR_JSON_H # define QEMU_MONITOR_JSON_H
#include "internal.h" # include "internal.h"
#include "qemu_monitor.h" # include "qemu_monitor.h"
int qemuMonitorJSONIOProcess(qemuMonitorPtr mon, int qemuMonitorJSONIOProcess(qemuMonitorPtr mon,
const char *data, const char *data,

View File

@ -23,12 +23,12 @@
#ifndef QEMU_MONITOR_TEXT_H #ifndef QEMU_MONITOR_TEXT_H
#define QEMU_MONITOR_TEXT_H # define QEMU_MONITOR_TEXT_H
#include "internal.h" # include "internal.h"
#include "qemu_monitor.h" # include "qemu_monitor.h"
#include "hash.h" # include "hash.h"
int qemuMonitorTextIOProcess(qemuMonitorPtr mon, int qemuMonitorTextIOProcess(qemuMonitorPtr mon,
const char *data, const char *data,

View File

@ -13,7 +13,7 @@
#include "qemu_conf.h" #include "qemu_conf.h"
#ifndef __QEMU_SECURITY_DAC #ifndef __QEMU_SECURITY_DAC
#define __QEMU_SECURITY_DAC # define __QEMU_SECURITY_DAC
extern virSecurityDriver qemuDACSecurityDriver; extern virSecurityDriver qemuDACSecurityDriver;

View File

@ -13,7 +13,7 @@
#include "qemu_conf.h" #include "qemu_conf.h"
#ifndef __QEMU_SECURITY_STACKED #ifndef __QEMU_SECURITY_STACKED
#define __QEMU_SECURITY_STACKED # define __QEMU_SECURITY_STACKED
extern virSecurityDriver qemuStackedSecurityDriver; extern virSecurityDriver qemuStackedSecurityDriver;

View File

@ -45,15 +45,15 @@
#endif #endif
#ifdef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> # include <sys/wait.h>
#endif #endif
#ifdef HAVE_PWD_H #ifdef HAVE_PWD_H
#include <pwd.h> # include <pwd.h>
#endif #endif
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
#include <paths.h> # include <paths.h>
#endif #endif
#include <rpc/types.h> #include <rpc/types.h>
@ -62,7 +62,7 @@
#include <gnutls/x509.h> #include <gnutls/x509.h>
#include "gnutls_1_0_compat.h" #include "gnutls_1_0_compat.h"
#if HAVE_SASL #if HAVE_SASL
#include <sasl/sasl.h> # include <sasl/sasl.h>
#endif #endif
#include <libxml/uri.h> #include <libxml/uri.h>
@ -92,7 +92,7 @@
#define VIR_FROM_THIS VIR_FROM_REMOTE #define VIR_FROM_THIS VIR_FROM_REMOTE
#ifdef WIN32 #ifdef WIN32
#define pipe(fds) _pipe(fds,4096, _O_BINARY) # define pipe(fds) _pipe(fds,4096, _O_BINARY)
#endif #endif
@ -679,9 +679,9 @@ doRemoteOpen (virConnectPtr conn,
} }
} }
#ifndef UNIX_PATH_MAX # ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX(addr) (sizeof (addr).sun_path) # define UNIX_PATH_MAX(addr) (sizeof (addr).sun_path)
#endif # endif
struct sockaddr_un addr; struct sockaddr_un addr;
int trials = 0; int trials = 0;
@ -6710,7 +6710,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
#if HAVE_POLKIT #if HAVE_POLKIT
#if HAVE_POLKIT1 # if HAVE_POLKIT1
static int static int
remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open, remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
virConnectAuthPtr auth ATTRIBUTE_UNUSED) virConnectAuthPtr auth ATTRIBUTE_UNUSED)
@ -6728,7 +6728,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
DEBUG0("PolicyKit-1 authentication complete"); DEBUG0("PolicyKit-1 authentication complete");
return 0; return 0;
} }
#elif HAVE_POLKIT0 # elif HAVE_POLKIT0
/* Perform the PolicyKit authentication process /* Perform the PolicyKit authentication process
*/ */
static int static int
@ -6780,7 +6780,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
DEBUG0("PolicyKit-0 authentication complete"); DEBUG0("PolicyKit-0 authentication complete");
return 0; return 0;
} }
#endif /* HAVE_POLKIT0 */ # endif /* HAVE_POLKIT0 */
#endif /* HAVE_POLKIT */ #endif /* HAVE_POLKIT */
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/

View File

@ -22,29 +22,29 @@
*/ */
#ifndef __VIR_REMOTE_INTERNAL_H__ #ifndef __VIR_REMOTE_INTERNAL_H__
#define __VIR_REMOTE_INTERNAL_H__ # define __VIR_REMOTE_INTERNAL_H__
#include "libvirt/virterror.h" # include "libvirt/virterror.h"
int remoteRegister (void); int remoteRegister (void);
unsigned long remoteVersion(void); unsigned long remoteVersion(void);
#define LIBVIRTD_LISTEN_ADDR NULL # define LIBVIRTD_LISTEN_ADDR NULL
#define LIBVIRTD_TLS_PORT "16514" # define LIBVIRTD_TLS_PORT "16514"
#define LIBVIRTD_TCP_PORT "16509" # define LIBVIRTD_TCP_PORT "16509"
#define LIBVIRTD_PRIV_UNIX_SOCKET LOCAL_STATE_DIR "/run/libvirt/libvirt-sock" # define LIBVIRTD_PRIV_UNIX_SOCKET LOCAL_STATE_DIR "/run/libvirt/libvirt-sock"
#define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCAL_STATE_DIR "/run/libvirt/libvirt-sock-ro" # define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCAL_STATE_DIR "/run/libvirt/libvirt-sock-ro"
#define LIBVIRTD_USER_UNIX_SOCKET "/.libvirt/libvirt-sock" # define LIBVIRTD_USER_UNIX_SOCKET "/.libvirt/libvirt-sock"
#define LIBVIRTD_CONFIGURATION_FILE SYSCONF_DIR "/libvirtd.conf" # define LIBVIRTD_CONFIGURATION_FILE SYSCONF_DIR "/libvirtd.conf"
/* Defaults for PKI directory. */ /* Defaults for PKI directory. */
#define LIBVIRT_PKI_DIR SYSCONF_DIR "/pki" # define LIBVIRT_PKI_DIR SYSCONF_DIR "/pki"
#define LIBVIRT_CACERT LIBVIRT_PKI_DIR "/CA/cacert.pem" # define LIBVIRT_CACERT LIBVIRT_PKI_DIR "/CA/cacert.pem"
#define LIBVIRT_CLIENTKEY LIBVIRT_PKI_DIR "/libvirt/private/clientkey.pem" # define LIBVIRT_CLIENTKEY LIBVIRT_PKI_DIR "/libvirt/private/clientkey.pem"
#define LIBVIRT_CLIENTCERT LIBVIRT_PKI_DIR "/libvirt/clientcert.pem" # define LIBVIRT_CLIENTCERT LIBVIRT_PKI_DIR "/libvirt/clientcert.pem"
#define LIBVIRT_SERVERKEY LIBVIRT_PKI_DIR "/libvirt/private/serverkey.pem" # define LIBVIRT_SERVERKEY LIBVIRT_PKI_DIR "/libvirt/private/serverkey.pem"
#define LIBVIRT_SERVERCERT LIBVIRT_PKI_DIR "/libvirt/servercert.pem" # define LIBVIRT_SERVERCERT LIBVIRT_PKI_DIR "/libvirt/servercert.pem"
#endif /* __VIR_REMOTE_INTERNAL_H__ */ #endif /* __VIR_REMOTE_INTERNAL_H__ */

View File

@ -4,51 +4,51 @@
*/ */
#ifndef _RP_H_RPCGEN #ifndef _RP_H_RPCGEN
#define _RP_H_RPCGEN # define _RP_H_RPCGEN
#include <rpc/rpc.h> # include <rpc/rpc.h>
#ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
#endif # endif
#include "internal.h" # include "internal.h"
#include <arpa/inet.h> # include <arpa/inet.h>
#define REMOTE_MESSAGE_MAX 262144 # define REMOTE_MESSAGE_MAX 262144
#define REMOTE_MESSAGE_HEADER_MAX 24 # define REMOTE_MESSAGE_HEADER_MAX 24
#define REMOTE_MESSAGE_PAYLOAD_MAX 262120 # define REMOTE_MESSAGE_PAYLOAD_MAX 262120
#define REMOTE_STRING_MAX 65536 # define REMOTE_STRING_MAX 65536
typedef char *remote_nonnull_string; typedef char *remote_nonnull_string;
typedef remote_nonnull_string *remote_string; typedef remote_nonnull_string *remote_string;
#define REMOTE_DOMAIN_ID_LIST_MAX 16384 # define REMOTE_DOMAIN_ID_LIST_MAX 16384
#define REMOTE_DOMAIN_NAME_LIST_MAX 1024 # define REMOTE_DOMAIN_NAME_LIST_MAX 1024
#define REMOTE_CPUMAP_MAX 256 # define REMOTE_CPUMAP_MAX 256
#define REMOTE_VCPUINFO_MAX 2048 # define REMOTE_VCPUINFO_MAX 2048
#define REMOTE_CPUMAPS_MAX 16384 # define REMOTE_CPUMAPS_MAX 16384
#define REMOTE_MIGRATE_COOKIE_MAX 256 # define REMOTE_MIGRATE_COOKIE_MAX 256
#define REMOTE_NETWORK_NAME_LIST_MAX 256 # define REMOTE_NETWORK_NAME_LIST_MAX 256
#define REMOTE_INTERFACE_NAME_LIST_MAX 256 # define REMOTE_INTERFACE_NAME_LIST_MAX 256
#define REMOTE_DEFINED_INTERFACE_NAME_LIST_MAX 256 # define REMOTE_DEFINED_INTERFACE_NAME_LIST_MAX 256
#define REMOTE_STORAGE_POOL_NAME_LIST_MAX 256 # define REMOTE_STORAGE_POOL_NAME_LIST_MAX 256
#define REMOTE_STORAGE_VOL_NAME_LIST_MAX 1024 # define REMOTE_STORAGE_VOL_NAME_LIST_MAX 1024
#define REMOTE_NODE_DEVICE_NAME_LIST_MAX 16384 # define REMOTE_NODE_DEVICE_NAME_LIST_MAX 16384
#define REMOTE_NODE_DEVICE_CAPS_LIST_MAX 16384 # define REMOTE_NODE_DEVICE_CAPS_LIST_MAX 16384
#define REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX 16 # define REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX 16
#define REMOTE_NODE_MAX_CELLS 1024 # define REMOTE_NODE_MAX_CELLS 1024
#define REMOTE_AUTH_SASL_DATA_MAX 65536 # define REMOTE_AUTH_SASL_DATA_MAX 65536
#define REMOTE_AUTH_TYPE_LIST_MAX 20 # define REMOTE_AUTH_TYPE_LIST_MAX 20
#define REMOTE_DOMAIN_MEMORY_STATS_MAX 1024 # define REMOTE_DOMAIN_MEMORY_STATS_MAX 1024
#define REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX 65536 # define REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX 65536
#define REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX 65536 # define REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX 65536
#define REMOTE_SECURITY_MODEL_MAX VIR_SECURITY_MODEL_BUFLEN # define REMOTE_SECURITY_MODEL_MAX VIR_SECURITY_MODEL_BUFLEN
#define REMOTE_SECURITY_LABEL_MAX VIR_SECURITY_LABEL_BUFLEN # define REMOTE_SECURITY_LABEL_MAX VIR_SECURITY_LABEL_BUFLEN
#define REMOTE_SECURITY_DOI_MAX VIR_SECURITY_DOI_BUFLEN # define REMOTE_SECURITY_DOI_MAX VIR_SECURITY_DOI_BUFLEN
#define REMOTE_SECRET_VALUE_MAX 65536 # define REMOTE_SECRET_VALUE_MAX 65536
#define REMOTE_SECRET_UUID_LIST_MAX 16384 # define REMOTE_SECRET_UUID_LIST_MAX 16384
#define REMOTE_CPU_BASELINE_MAX 256 # define REMOTE_CPU_BASELINE_MAX 256
typedef char remote_uuid[VIR_UUID_BUFLEN]; typedef char remote_uuid[VIR_UUID_BUFLEN];
@ -1704,8 +1704,8 @@ struct remote_domain_abort_job_args {
remote_nonnull_domain dom; remote_nonnull_domain dom;
}; };
typedef struct remote_domain_abort_job_args remote_domain_abort_job_args; typedef struct remote_domain_abort_job_args remote_domain_abort_job_args;
#define REMOTE_PROGRAM 0x20008086 # define REMOTE_PROGRAM 0x20008086
#define REMOTE_PROTOCOL_VERSION 1 # define REMOTE_PROTOCOL_VERSION 1
enum remote_procedure { enum remote_procedure {
REMOTE_PROC_OPEN = 1, REMOTE_PROC_OPEN = 1,
@ -1889,7 +1889,7 @@ enum remote_message_status {
REMOTE_CONTINUE = 2, REMOTE_CONTINUE = 2,
}; };
typedef enum remote_message_status remote_message_status; typedef enum remote_message_status remote_message_status;
#define REMOTE_MESSAGE_HEADER_XDR_LEN 4 # define REMOTE_MESSAGE_HEADER_XDR_LEN 4
struct remote_message_header { struct remote_message_header {
u_int prog; u_int prog;
@ -1903,7 +1903,7 @@ typedef struct remote_message_header remote_message_header;
/* the xdr functions */ /* the xdr functions */
#if defined(__STDC__) || defined(__cplusplus) # if defined(__STDC__) || defined(__cplusplus)
extern bool_t xdr_remote_nonnull_string (XDR *, remote_nonnull_string*); extern bool_t xdr_remote_nonnull_string (XDR *, remote_nonnull_string*);
extern bool_t xdr_remote_string (XDR *, remote_string*); extern bool_t xdr_remote_string (XDR *, remote_string*);
extern bool_t xdr_remote_uuid (XDR *, remote_uuid); extern bool_t xdr_remote_uuid (XDR *, remote_uuid);
@ -2186,7 +2186,7 @@ extern bool_t xdr_remote_message_type (XDR *, remote_message_type*);
extern bool_t xdr_remote_message_status (XDR *, remote_message_status*); extern bool_t xdr_remote_message_status (XDR *, remote_message_status*);
extern bool_t xdr_remote_message_header (XDR *, remote_message_header*); extern bool_t xdr_remote_message_header (XDR *, remote_message_header*);
#else /* K&R C */ # else /* K&R C */
extern bool_t xdr_remote_nonnull_string (); extern bool_t xdr_remote_nonnull_string ();
extern bool_t xdr_remote_string (); extern bool_t xdr_remote_string ();
extern bool_t xdr_remote_uuid (); extern bool_t xdr_remote_uuid ();
@ -2469,10 +2469,10 @@ extern bool_t xdr_remote_message_type ();
extern bool_t xdr_remote_message_status (); extern bool_t xdr_remote_message_status ();
extern bool_t xdr_remote_message_header (); extern bool_t xdr_remote_message_header ();
#endif /* K&R C */ # endif /* K&R C */
#ifdef __cplusplus # ifdef __cplusplus
} }
#endif # endif
#endif /* !_RP_H_RPCGEN */ #endif /* !_RP_H_RPCGEN */

View File

@ -21,7 +21,7 @@
*/ */
#ifndef __VIR_SECRET_DRIVER_H__ #ifndef __VIR_SECRET_DRIVER_H__
#define __VIR_SECRET_DRIVER_H__ # define __VIR_SECRET_DRIVER_H__
int secretRegister(void); int secretRegister(void);

View File

@ -12,12 +12,12 @@
* *
*/ */
#ifndef __VIR_SECURITY_APPARMOR_H__ #ifndef __VIR_SECURITY_APPARMOR_H__
#define __VIR_SECURITY_APPARMOR_H__ # define __VIR_SECURITY_APPARMOR_H__
extern virSecurityDriver virAppArmorSecurityDriver; extern virSecurityDriver virAppArmorSecurityDriver;
#define AA_PREFIX "libvirt-" # define AA_PREFIX "libvirt-"
#define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid */ # define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid */
#define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check */ # define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check */
#endif /* __VIR_SECURITY_APPARMOR_H__ */ #endif /* __VIR_SECURITY_APPARMOR_H__ */

View File

@ -17,11 +17,11 @@
#include "security_driver.h" #include "security_driver.h"
#ifdef WITH_SECDRIVER_SELINUX #ifdef WITH_SECDRIVER_SELINUX
#include "security_selinux.h" # include "security_selinux.h"
#endif #endif
#ifdef WITH_SECDRIVER_APPARMOR #ifdef WITH_SECDRIVER_APPARMOR
#include "security_apparmor.h" # include "security_apparmor.h"
#endif #endif
static virSecurityDriverPtr security_drivers[] = { static virSecurityDriverPtr security_drivers[] = {

View File

@ -11,10 +11,10 @@
* *
*/ */
#ifndef __VIR_SECURITY_H__ #ifndef __VIR_SECURITY_H__
#define __VIR_SECURITY_H__ # define __VIR_SECURITY_H__
#include "internal.h" # include "internal.h"
#include "domain_conf.h" # include "domain_conf.h"
/* /*
* Return values for security driver probing: the driver will determine * Return values for security driver probing: the driver will determine
@ -88,7 +88,7 @@ int virSecurityDriverStartup(virSecurityDriverPtr *drv,
int int
virSecurityDriverVerify(virDomainDefPtr def); virSecurityDriverVerify(virDomainDefPtr def);
#define virSecurityReportError(code, ...) \ # define virSecurityReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_SECURITY, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_SECURITY, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -11,7 +11,7 @@
* *
*/ */
#ifndef __VIR_SECURITY_SELINUX_H__ #ifndef __VIR_SECURITY_SELINUX_H__
#define __VIR_SECURITY_SELINUX_H__ # define __VIR_SECURITY_SELINUX_H__
extern virSecurityDriver virSELinuxSecurityDriver; extern virSecurityDriver virSELinuxSecurityDriver;

View File

@ -26,11 +26,11 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#if HAVE_REGEX_H #if HAVE_REGEX_H
#include <regex.h> # include <regex.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#if HAVE_SYS_WAIT_H #if HAVE_SYS_WAIT_H
#include <sys/wait.h> # include <sys/wait.h>
#endif #endif
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -40,7 +40,7 @@
#include <dirent.h> #include <dirent.h>
#if HAVE_SELINUX #if HAVE_SELINUX
#include <selinux/selinux.h> # include <selinux/selinux.h>
#endif #endif
#include "datatypes.h" #include "datatypes.h"
@ -55,26 +55,26 @@
#include "logging.h" #include "logging.h"
#if WITH_STORAGE_LVM #if WITH_STORAGE_LVM
#include "storage_backend_logical.h" # include "storage_backend_logical.h"
#endif #endif
#if WITH_STORAGE_ISCSI #if WITH_STORAGE_ISCSI
#include "storage_backend_iscsi.h" # include "storage_backend_iscsi.h"
#endif #endif
#if WITH_STORAGE_SCSI #if WITH_STORAGE_SCSI
#include "storage_backend_scsi.h" # include "storage_backend_scsi.h"
#endif #endif
#if WITH_STORAGE_MPATH #if WITH_STORAGE_MPATH
#include "storage_backend_mpath.h" # include "storage_backend_mpath.h"
#endif #endif
#if WITH_STORAGE_DISK #if WITH_STORAGE_DISK
#include "storage_backend_disk.h" # include "storage_backend_disk.h"
#endif #endif
#if WITH_STORAGE_DIR #if WITH_STORAGE_DIR
#include "storage_backend_fs.h" # include "storage_backend_fs.h"
#endif #endif
#ifndef DEV_BSIZE #ifndef DEV_BSIZE
#define DEV_BSIZE 512 # define DEV_BSIZE 512
#endif #endif
#define VIR_FROM_THIS VIR_FROM_STORAGE #define VIR_FROM_THIS VIR_FROM_STORAGE

View File

@ -22,11 +22,11 @@
*/ */
#ifndef __VIR_STORAGE_BACKEND_H__ #ifndef __VIR_STORAGE_BACKEND_H__
#define __VIR_STORAGE_BACKEND_H__ # define __VIR_STORAGE_BACKEND_H__
#include <stdint.h> # include <stdint.h>
#include "internal.h" # include "internal.h"
#include "storage_conf.h" # include "storage_conf.h"
typedef char * (*virStorageBackendFindPoolSources)(virConnectPtr conn, const char *srcSpec, unsigned int flags); typedef char * (*virStorageBackendFindPoolSources)(virConnectPtr conn, const char *srcSpec, unsigned int flags);
typedef int (*virStorageBackendStartPool)(virConnectPtr conn, virStoragePoolObjPtr pool); typedef int (*virStorageBackendStartPool)(virConnectPtr conn, virStoragePoolObjPtr pool);

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_STORAGE_BACKEND_DISK_H__ #ifndef __VIR_STORAGE_BACKEND_DISK_H__
#define __VIR_STORAGE_BACKEND_DISK_H__ # define __VIR_STORAGE_BACKEND_DISK_H__
#include "storage_backend.h" # include "storage_backend.h"
extern virStorageBackend virStorageBackendDisk; extern virStorageBackend virStorageBackendDisk;

View File

@ -125,7 +125,7 @@ virStorageBackendProbeTarget(virStorageVolTargetPtr target,
#if WITH_STORAGE_FS #if WITH_STORAGE_FS
#include <mntent.h> # include <mntent.h>
struct _virNetfsDiscoverState { struct _virNetfsDiscoverState {
const char *host; const char *host;

View File

@ -22,14 +22,14 @@
*/ */
#ifndef __VIR_STORAGE_BACKEND_FS_H__ #ifndef __VIR_STORAGE_BACKEND_FS_H__
#define __VIR_STORAGE_BACKEND_FS_H__ # define __VIR_STORAGE_BACKEND_FS_H__
#include "storage_backend.h" # include "storage_backend.h"
#if WITH_STORAGE_FS # if WITH_STORAGE_FS
extern virStorageBackend virStorageBackendFileSystem; extern virStorageBackend virStorageBackendFileSystem;
extern virStorageBackend virStorageBackendNetFileSystem; extern virStorageBackend virStorageBackendNetFileSystem;
#endif # endif
extern virStorageBackend virStorageBackendDirectory; extern virStorageBackend virStorageBackendDirectory;
#endif /* __VIR_STORAGE_BACKEND_FS_H__ */ #endif /* __VIR_STORAGE_BACKEND_FS_H__ */

View File

@ -22,14 +22,14 @@
*/ */
#ifndef __VIR_STORAGE_BACKEND_ISCSI_H__ #ifndef __VIR_STORAGE_BACKEND_ISCSI_H__
#define __VIR_STORAGE_BACKEND_ISCSI_H__ # define __VIR_STORAGE_BACKEND_ISCSI_H__
#include "storage_backend.h" # include "storage_backend.h"
extern virStorageBackend virStorageBackendISCSI; extern virStorageBackend virStorageBackendISCSI;
#define IQN_FOUND 1 # define IQN_FOUND 1
#define IQN_MISSING 0 # define IQN_MISSING 0
#define IQN_ERROR -1 # define IQN_ERROR -1
#endif /* __VIR_STORAGE_BACKEND_ISCSI_H__ */ #endif /* __VIR_STORAGE_BACKEND_ISCSI_H__ */

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_STORAGE_BACKEND_LOGICAL_H__ #ifndef __VIR_STORAGE_BACKEND_LOGICAL_H__
#define __VIR_STORAGE_BACKEND_LOGICAL_H__ # define __VIR_STORAGE_BACKEND_LOGICAL_H__
#include "storage_backend.h" # include "storage_backend.h"
extern virStorageBackend virStorageBackendLogical; extern virStorageBackend virStorageBackendLogical;

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_STORAGE_BACKEND_MPATH_H__ #ifndef __VIR_STORAGE_BACKEND_MPATH_H__
#define __VIR_STORAGE_BACKEND_MPATH_H__ # define __VIR_STORAGE_BACKEND_MPATH_H__
#include "storage_backend.h" # include "storage_backend.h"
extern virStorageBackend virStorageBackendMpath; extern virStorageBackend virStorageBackendMpath;

View File

@ -22,13 +22,13 @@
*/ */
#ifndef __VIR_STORAGE_BACKEND_SCSI_H__ #ifndef __VIR_STORAGE_BACKEND_SCSI_H__
#define __VIR_STORAGE_BACKEND_SCSI_H__ # define __VIR_STORAGE_BACKEND_SCSI_H__
#include "storage_backend.h" # include "storage_backend.h"
#define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host" # define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host"
#define LINUX_SYSFS_SCSI_HOST_POSTFIX "device" # define LINUX_SYSFS_SCSI_HOST_POSTFIX "device"
#define LINUX_SYSFS_SCSI_HOST_SCAN_STRING "- - -" # define LINUX_SYSFS_SCSI_HOST_SCAN_STRING "- - -"
extern virStorageBackend virStorageBackendSCSI; extern virStorageBackend virStorageBackendSCSI;

View File

@ -27,7 +27,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#if HAVE_PWD_H #if HAVE_PWD_H
#include <pwd.h> # include <pwd.h>
#endif #endif
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_STORAGE_DRIVER_H__ #ifndef __VIR_STORAGE_DRIVER_H__
#define __VIR_STORAGE_DRIVER_H__ # define __VIR_STORAGE_DRIVER_H__
#include "storage_conf.h" # include "storage_conf.h"
int storageRegister(void); int storageRegister(void);

View File

@ -22,9 +22,9 @@
*/ */
#ifndef __VIR_TEST_INTERNAL_H__ #ifndef __VIR_TEST_INTERNAL_H__
#define __VIR_TEST_INTERNAL_H__ # define __VIR_TEST_INTERNAL_H__
#include "internal.h" # include "internal.h"
int testRegister(void); int testRegister(void);

View File

@ -22,21 +22,21 @@
*/ */
#ifndef __UML_CONF_H #ifndef __UML_CONF_H
#define __UML_CONF_H # define __UML_CONF_H
#include "internal.h" # include "internal.h"
#include "bridge.h" # include "bridge.h"
#include "capabilities.h" # include "capabilities.h"
#include "network_conf.h" # include "network_conf.h"
#include "domain_conf.h" # include "domain_conf.h"
#include "virterror_internal.h" # include "virterror_internal.h"
#include "threads.h" # include "threads.h"
#define umlDebug(fmt, ...) do {} while(0) # define umlDebug(fmt, ...) do {} while(0)
#define UML_CPUMASK_LEN CPU_SETSIZE # define UML_CPUMASK_LEN CPU_SETSIZE
#define UML_MAX_CHAR_DEVICE 16 # define UML_MAX_CHAR_DEVICE 16
/* Main driver state */ /* Main driver state */
struct uml_driver { struct uml_driver {
@ -62,7 +62,7 @@ struct uml_driver {
}; };
#define umlReportError(conn, dom, net, code, ...) \ # define umlReportError(conn, dom, net, code, ...) \
virReportErrorHelper(conn, VIR_FROM_UML, code, __FILE__, \ virReportErrorHelper(conn, VIR_FROM_UML, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)

View File

@ -23,9 +23,9 @@
#ifndef UML_DRIVER_H #ifndef UML_DRIVER_H
#define UML_DRIVER_H # define UML_DRIVER_H
#include "internal.h" # include "internal.h"
int umlRegister(void); int umlRegister(void);

View File

@ -23,34 +23,34 @@
#if defined(WITH_BRIDGE) #if defined(WITH_BRIDGE)
#include "bridge.h" # include "bridge.h"
#include <stdlib.h> # include <stdlib.h>
#include <stdio.h> # include <stdio.h>
#include <string.h> # include <string.h>
#include <unistd.h> # include <unistd.h>
#include <fcntl.h> # include <fcntl.h>
#include <errno.h> # include <errno.h>
#include <arpa/inet.h> # include <arpa/inet.h>
#include <sys/types.h> # include <sys/types.h>
#include <sys/socket.h> # include <sys/socket.h>
#include <sys/ioctl.h> # include <sys/ioctl.h>
#include <paths.h> # include <paths.h>
#include <sys/wait.h> # include <sys/wait.h>
#include <linux/param.h> /* HZ */ # include <linux/param.h> /* HZ */
#include <linux/sockios.h> /* SIOCBRADDBR etc. */ # include <linux/sockios.h> /* SIOCBRADDBR etc. */
#include <linux/if_bridge.h> /* SYSFS_BRIDGE_ATTR */ # include <linux/if_bridge.h> /* SYSFS_BRIDGE_ATTR */
#include <linux/if_tun.h> /* IFF_TUN, IFF_NO_PI */ # include <linux/if_tun.h> /* IFF_TUN, IFF_NO_PI */
#include <net/if_arp.h> /* ARPHRD_ETHER */ # include <net/if_arp.h> /* ARPHRD_ETHER */
#include "internal.h" # include "internal.h"
#include "memory.h" # include "memory.h"
#include "util.h" # include "util.h"
#include "logging.h" # include "logging.h"
#define JIFFIES_TO_MS(j) (((j)*1000)/HZ) # define JIFFIES_TO_MS(j) (((j)*1000)/HZ)
#define MS_TO_JIFFIES(ms) (((ms)*HZ)/1000) # define MS_TO_JIFFIES(ms) (((ms)*HZ)/1000)
struct _brControl { struct _brControl {
int fd; int fd;
@ -122,7 +122,7 @@ brShutdown(brControl *ctl)
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
*/ */
#ifdef SIOCBRADDBR # ifdef SIOCBRADDBR
int int
brAddBridge(brControl *ctl, brAddBridge(brControl *ctl,
const char *name) const char *name)
@ -135,15 +135,15 @@ brAddBridge(brControl *ctl,
return errno; return errno;
} }
#else # else
int brAddBridge (brControl *ctl ATTRIBUTE_UNUSED, int brAddBridge (brControl *ctl ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED) const char *name ATTRIBUTE_UNUSED)
{ {
return EINVAL; return EINVAL;
} }
#endif # endif
#ifdef SIOCBRDELBR # ifdef SIOCBRDELBR
int int
brHasBridge(brControl *ctl, brHasBridge(brControl *ctl,
const char *name) const char *name)
@ -167,14 +167,14 @@ brHasBridge(brControl *ctl,
return 0; return 0;
} }
#else # else
int int
brHasBridge(brControl *ctl ATTRIBUTE_UNUSED, brHasBridge(brControl *ctl ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED) const char *name ATTRIBUTE_UNUSED)
{ {
return EINVAL; return EINVAL;
} }
#endif # endif
/** /**
* brDeleteBridge: * brDeleteBridge:
@ -185,7 +185,7 @@ brHasBridge(brControl *ctl ATTRIBUTE_UNUSED,
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
*/ */
#ifdef SIOCBRDELBR # ifdef SIOCBRDELBR
int int
brDeleteBridge(brControl *ctl, brDeleteBridge(brControl *ctl,
const char *name) const char *name)
@ -195,16 +195,16 @@ brDeleteBridge(brControl *ctl,
return ioctl(ctl->fd, SIOCBRDELBR, name) == 0 ? 0 : errno; return ioctl(ctl->fd, SIOCBRDELBR, name) == 0 ? 0 : errno;
} }
#else # else
int int
brDeleteBridge(brControl *ctl ATTRIBUTE_UNUSED, brDeleteBridge(brControl *ctl ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED) const char *name ATTRIBUTE_UNUSED)
{ {
return EINVAL; return EINVAL;
} }
#endif # endif
#if defined(SIOCBRADDIF) && defined(SIOCBRDELIF) # if defined(SIOCBRADDIF) && defined(SIOCBRDELIF)
static int static int
brAddDelInterface(brControl *ctl, brAddDelInterface(brControl *ctl,
int cmd, int cmd,
@ -226,7 +226,7 @@ brAddDelInterface(brControl *ctl,
return ioctl(ctl->fd, cmd, &ifr) == 0 ? 0 : errno; return ioctl(ctl->fd, cmd, &ifr) == 0 ? 0 : errno;
} }
#endif # endif
/** /**
* brAddInterface: * brAddInterface:
@ -238,7 +238,7 @@ brAddDelInterface(brControl *ctl,
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
*/ */
#ifdef SIOCBRADDIF # ifdef SIOCBRADDIF
int int
brAddInterface(brControl *ctl, brAddInterface(brControl *ctl,
const char *bridge, const char *bridge,
@ -246,7 +246,7 @@ brAddInterface(brControl *ctl,
{ {
return brAddDelInterface(ctl, SIOCBRADDIF, bridge, iface); return brAddDelInterface(ctl, SIOCBRADDIF, bridge, iface);
} }
#else # else
int int
brAddInterface(brControl *ctl ATTRIBUTE_UNUSED, brAddInterface(brControl *ctl ATTRIBUTE_UNUSED,
const char *bridge ATTRIBUTE_UNUSED, const char *bridge ATTRIBUTE_UNUSED,
@ -254,7 +254,7 @@ brAddInterface(brControl *ctl ATTRIBUTE_UNUSED,
{ {
return EINVAL; return EINVAL;
} }
#endif # endif
/** /**
* brDeleteInterface: * brDeleteInterface:
@ -266,7 +266,7 @@ brAddInterface(brControl *ctl ATTRIBUTE_UNUSED,
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
*/ */
#ifdef SIOCBRDELIF # ifdef SIOCBRDELIF
int int
brDeleteInterface(brControl *ctl, brDeleteInterface(brControl *ctl,
const char *bridge, const char *bridge,
@ -274,7 +274,7 @@ brDeleteInterface(brControl *ctl,
{ {
return brAddDelInterface(ctl, SIOCBRDELIF, bridge, iface); return brAddDelInterface(ctl, SIOCBRDELIF, bridge, iface);
} }
#else # else
int int
brDeleteInterface(brControl *ctl ATTRIBUTE_UNUSED, brDeleteInterface(brControl *ctl ATTRIBUTE_UNUSED,
const char *bridge ATTRIBUTE_UNUSED, const char *bridge ATTRIBUTE_UNUSED,
@ -282,7 +282,7 @@ brDeleteInterface(brControl *ctl ATTRIBUTE_UNUSED,
{ {
return EINVAL; return EINVAL;
} }
#endif # endif
/** /**
* ifGetMtu * ifGetMtu
@ -385,11 +385,11 @@ static int brSetInterfaceMtu(brControl *ctl,
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
*/ */
#ifdef IFF_VNET_HDR # ifdef IFF_VNET_HDR
static int static int
brProbeVnetHdr(int tapfd) brProbeVnetHdr(int tapfd)
{ {
#if defined(IFF_VNET_HDR) && defined(TUNGETFEATURES) && defined(TUNGETIFF) # if defined(IFF_VNET_HDR) && defined(TUNGETFEATURES) && defined(TUNGETIFF)
unsigned int features; unsigned int features;
struct ifreq dummy; struct ifreq dummy;
@ -417,13 +417,13 @@ brProbeVnetHdr(int tapfd)
VIR_INFO0(_("Enabling IFF_VNET_HDR")); VIR_INFO0(_("Enabling IFF_VNET_HDR"));
return 1; return 1;
#else # else
(void) tapfd; (void) tapfd;
VIR_INFO0(_("Not enabling IFF_VNET_HDR; disabled at build time")); VIR_INFO0(_("Not enabling IFF_VNET_HDR; disabled at build time"));
return 0; return 0;
#endif # endif
} }
#endif # endif
/** /**
* brAddTap: * brAddTap:
@ -463,12 +463,12 @@ brAddTap(brControl *ctl,
ifr.ifr_flags = IFF_TAP|IFF_NO_PI; ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
#ifdef IFF_VNET_HDR # ifdef IFF_VNET_HDR
if (vnet_hdr && brProbeVnetHdr(fd)) if (vnet_hdr && brProbeVnetHdr(fd))
ifr.ifr_flags |= IFF_VNET_HDR; ifr.ifr_flags |= IFF_VNET_HDR;
#else # else
(void) vnet_hdr; (void) vnet_hdr;
#endif # endif
if (virStrcpyStatic(ifr.ifr_name, *ifname) == NULL) { if (virStrcpyStatic(ifr.ifr_name, *ifname) == NULL) {
errno = EINVAL; errno = EINVAL;

Some files were not shown because too many files have changed in this diff Show More