2007-02-14 01:40:09 +00:00
|
|
|
/*
|
2009-09-16 11:37:26 +00:00
|
|
|
* libvirtd.h: daemon data structure definitions
|
2007-02-14 01:40:09 +00:00
|
|
|
*
|
2011-02-16 23:37:57 +00:00
|
|
|
* Copyright (C) 2006-2011 Red Hat, Inc.
|
2007-02-14 01:40:09 +00:00
|
|
|
* Copyright (C) 2006 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef QEMUD_INTERNAL_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define QEMUD_INTERNAL_H__
|
|
|
|
|
|
|
|
# include <config.h>
|
|
|
|
|
|
|
|
# include <gnutls/gnutls.h>
|
|
|
|
# include <gnutls/x509.h>
|
|
|
|
# include "gnutls_1_0_compat.h"
|
|
|
|
# if HAVE_SASL
|
|
|
|
# include <sasl/sasl.h>
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# if HAVE_POLKIT0
|
|
|
|
# include <dbus/dbus.h>
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# ifdef HAVE_SYS_SYSLIMITS_H
|
|
|
|
# include <sys/syslimits.h>
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# include <rpc/types.h>
|
|
|
|
# include <rpc/xdr.h>
|
|
|
|
# include "remote_protocol.h"
|
2010-04-17 02:09:25 +00:00
|
|
|
# include "qemu_protocol.h"
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "logging.h"
|
|
|
|
# include "threads.h"
|
2010-10-21 14:45:12 +00:00
|
|
|
# include "network.h"
|
2010-03-09 18:22:22 +00:00
|
|
|
|
Add dtrace static probes in libvirtd
Adds initial support for dtrace static probes in libvirtd
daemon, assuming use of systemtap dtrace compat shim on
Linux. The probes are inserted for network client connect,
disconnect, TLS handshake states and authentication protocol
states.
This can be tested by running the xample program and then
attempting to connect with any libvirt client (virsh,
virt-manager, etc).
# stap examples/systemtap/client.stp
Client fd=44 connected readonly=0
Client fd=44 auth polkit deny pid:24997,uid:500
Client fd=44 disconnected
Client fd=46 connected readonly=1
Client fd=46 auth sasl allow test
Client fd=46 disconnected
The libvirtd.stp file should also really not be required,
since it is duplicated info that is already available in
the main probes.d definition file. A script to autogenerate
the .stp file is needed, either in libvirtd tree, or better
as part of systemtap itself.
* Makefile.am: Add examples/systemtap subdir
* autobuild.sh: Disable dtrace for mingw32
* configure.ac: Add check for dtrace
* daemon/.gitignore: Ignore generated dtrace probe file
* daemon/Makefile.am: Build dtrace probe header & object
files
* daemon/libvirtd.stp: SystemTAP convenience probeset
* daemon/libvirtd.c: Add connect/disconnect & TLS probes
* daemon/remote.c: Add SASL and PolicyKit auth probes
* daemon/probes.d: Master probe definition
* daemon/libvirtd.h: Add convenience macro for probes
so that compilation is a no-op when dtrace is not available
* examples/systemtap/Makefile.am, examples/systemtap/client.stp
Example systemtap script using dtrace probe markers
* libvirt.spec.in: Enable dtrace on F13/RHEL6
* mingw32-libvirt.spec.in: Force disable dtrace
2010-09-14 16:30:32 +00:00
|
|
|
# if WITH_DTRACE
|
|
|
|
# ifndef LIBVIRTD_PROBES_H
|
|
|
|
# define LIBVIRTD_PROBES_H
|
|
|
|
# include "probes.h"
|
|
|
|
# endif /* LIBVIRTD_PROBES_H */
|
|
|
|
# define PROBE(NAME, FMT, ...) \
|
|
|
|
VIR_DEBUG_INT("trace." __FILE__ , __func__, __LINE__, \
|
|
|
|
#NAME ": " FMT, __VA_ARGS__); \
|
|
|
|
if (LIBVIRTD_ ## NAME ## _ENABLED()) { \
|
|
|
|
LIBVIRTD_ ## NAME(__VA_ARGS__); \
|
|
|
|
}
|
|
|
|
# else
|
2010-10-21 14:45:12 +00:00
|
|
|
# define PROBE(NAME, FMT, ...) \
|
|
|
|
VIR_DEBUG_INT("trace." __FILE__, __func__, __LINE__, \
|
Add dtrace static probes in libvirtd
Adds initial support for dtrace static probes in libvirtd
daemon, assuming use of systemtap dtrace compat shim on
Linux. The probes are inserted for network client connect,
disconnect, TLS handshake states and authentication protocol
states.
This can be tested by running the xample program and then
attempting to connect with any libvirt client (virsh,
virt-manager, etc).
# stap examples/systemtap/client.stp
Client fd=44 connected readonly=0
Client fd=44 auth polkit deny pid:24997,uid:500
Client fd=44 disconnected
Client fd=46 connected readonly=1
Client fd=46 auth sasl allow test
Client fd=46 disconnected
The libvirtd.stp file should also really not be required,
since it is duplicated info that is already available in
the main probes.d definition file. A script to autogenerate
the .stp file is needed, either in libvirtd tree, or better
as part of systemtap itself.
* Makefile.am: Add examples/systemtap subdir
* autobuild.sh: Disable dtrace for mingw32
* configure.ac: Add check for dtrace
* daemon/.gitignore: Ignore generated dtrace probe file
* daemon/Makefile.am: Build dtrace probe header & object
files
* daemon/libvirtd.stp: SystemTAP convenience probeset
* daemon/libvirtd.c: Add connect/disconnect & TLS probes
* daemon/remote.c: Add SASL and PolicyKit auth probes
* daemon/probes.d: Master probe definition
* daemon/libvirtd.h: Add convenience macro for probes
so that compilation is a no-op when dtrace is not available
* examples/systemtap/Makefile.am, examples/systemtap/client.stp
Example systemtap script using dtrace probe markers
* libvirt.spec.in: Enable dtrace on F13/RHEL6
* mingw32-libvirt.spec.in: Force disable dtrace
2010-09-14 16:30:32 +00:00
|
|
|
#NAME ": " FMT, __VA_ARGS__);
|
|
|
|
# endif
|
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# ifdef __GNUC__
|
|
|
|
# ifdef HAVE_ANSIDECL_H
|
|
|
|
# include <ansidecl.h>
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# ifndef __GNUC_PREREQ
|
|
|
|
# if defined __GNUC__ && defined __GNUC_MINOR__
|
|
|
|
# define __GNUC_PREREQ(maj, min) \
|
Fix misc Win32 compile warnings
GCC >= 4.4 assumes the 'printf' attribute refers to the native
runtime libraries format specifiers. Thanks to gnulib, libvirt
has GNU format specifiers everywhere. This means we need to
use 'gnu_printf' with GCC >= 4.4 to get correct compiler
checking of printf format specifiers.
* HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
* autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
driver on mingw32 builds
* qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
src/logging.h, src/security.h, src/sexpr.h, src/util.h,
src/virterror_internal.h, src/xend_internal.c: Change
over to ATTRIBUTE_FMT_PRINTF.
* src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
since they don't compile
* src/threads-win32.c: Add missing return value check
2009-07-23 15:07:32 +00:00
|
|
|
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
2010-03-09 18:22:22 +00:00
|
|
|
# else
|
|
|
|
# define __GNUC_PREREQ(maj,min) 0
|
|
|
|
# endif
|
|
|
|
# endif
|
Fix misc Win32 compile warnings
GCC >= 4.4 assumes the 'printf' attribute refers to the native
runtime libraries format specifiers. Thanks to gnulib, libvirt
has GNU format specifiers everywhere. This means we need to
use 'gnu_printf' with GCC >= 4.4 to get correct compiler
checking of printf format specifiers.
* HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
* autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
driver on mingw32 builds
* qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
src/logging.h, src/security.h, src/sexpr.h, src/util.h,
src/virterror_internal.h, src/xend_internal.c: Change
over to ATTRIBUTE_FMT_PRINTF.
* src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
since they don't compile
* src/threads-win32.c: Add missing return value check
2009-07-23 15:07:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ATTRIBUTE_UNUSED:
|
|
|
|
*
|
|
|
|
* Macro to flag conciously unused parameters to functions
|
|
|
|
*/
|
2010-03-09 18:22:22 +00:00
|
|
|
# ifndef ATTRIBUTE_UNUSED
|
|
|
|
# define ATTRIBUTE_UNUSED __attribute__((__unused__))
|
|
|
|
# endif
|
Fix misc Win32 compile warnings
GCC >= 4.4 assumes the 'printf' attribute refers to the native
runtime libraries format specifiers. Thanks to gnulib, libvirt
has GNU format specifiers everywhere. This means we need to
use 'gnu_printf' with GCC >= 4.4 to get correct compiler
checking of printf format specifiers.
* HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
* autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
driver on mingw32 builds
* qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
src/logging.h, src/security.h, src/sexpr.h, src/util.h,
src/virterror_internal.h, src/xend_internal.c: Change
over to ATTRIBUTE_FMT_PRINTF.
* src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
since they don't compile
* src/threads-win32.c: Add missing return value check
2009-07-23 15:07:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ATTRIBUTE_FMT_PRINTF
|
|
|
|
*
|
|
|
|
* Macro used to check printf like functions, if compiling
|
|
|
|
* with gcc.
|
|
|
|
*
|
|
|
|
* We use gnulib which guarentees we always have GNU style
|
|
|
|
* printf format specifiers even on broken Win32 platforms
|
|
|
|
* hence we have to force 'gnu_printf' for new GCC
|
|
|
|
*/
|
2010-03-09 18:22:22 +00:00
|
|
|
# ifndef ATTRIBUTE_FMT_PRINTF
|
|
|
|
# if __GNUC_PREREQ (4, 4)
|
|
|
|
# define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (gnu_printf, fmtpos,argpos)))
|
|
|
|
# else
|
|
|
|
# define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (printf, fmtpos,argpos)))
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# ifndef ATTRIBUTE_RETURN_CHECK
|
|
|
|
# if __GNUC_PREREQ (3, 4)
|
|
|
|
# define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))
|
|
|
|
# else
|
|
|
|
# define ATTRIBUTE_RETURN_CHECK
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# else
|
|
|
|
# ifndef ATTRIBUTE_UNUSED
|
|
|
|
# define ATTRIBUTE_UNUSED
|
|
|
|
# endif
|
|
|
|
# ifndef ATTRIBUTE_FMT_PRINTF
|
|
|
|
# define ATTRIBUTE_FMT_PRINTF(...)
|
|
|
|
# endif
|
|
|
|
# ifndef ATTRIBUTE_RETURN_CHECK
|
|
|
|
# define ATTRIBUTE_RETURN_CHECK
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
|
2007-12-05 15:27:08 +00:00
|
|
|
/* Whether we're passing reads & writes through a sasl SSF */
|
|
|
|
enum qemud_sasl_ssf {
|
|
|
|
QEMUD_SASL_SSF_NONE = 0,
|
|
|
|
QEMUD_SASL_SSF_READ = 1,
|
|
|
|
QEMUD_SASL_SSF_WRITE = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum qemud_sock_type {
|
|
|
|
QEMUD_SOCK_TYPE_UNIX = 0,
|
|
|
|
QEMUD_SOCK_TYPE_TCP = 1,
|
|
|
|
QEMUD_SOCK_TYPE_TLS = 2,
|
2007-06-11 12:04:54 +00:00
|
|
|
};
|
|
|
|
|
2009-01-20 19:25:15 +00:00
|
|
|
struct qemud_client_message {
|
|
|
|
char buffer [REMOTE_MESSAGE_MAX + REMOTE_MESSAGE_HEADER_XDR_LEN];
|
|
|
|
unsigned int bufferLength;
|
|
|
|
unsigned int bufferOffset;
|
|
|
|
|
2009-07-10 12:06:36 +00:00
|
|
|
unsigned int async : 1;
|
2009-08-24 19:57:16 +00:00
|
|
|
unsigned int streamTX : 1;
|
2009-01-20 19:25:15 +00:00
|
|
|
|
2009-07-10 11:26:00 +00:00
|
|
|
remote_message_header hdr;
|
|
|
|
|
2009-01-20 19:25:15 +00:00
|
|
|
struct qemud_client_message *next;
|
|
|
|
};
|
|
|
|
|
2009-07-10 12:06:36 +00:00
|
|
|
struct qemud_client;
|
|
|
|
|
2009-07-10 11:58:22 +00:00
|
|
|
/* Allow for filtering of incoming messages to a custom
|
|
|
|
* dispatch processing queue, instead of client->dx.
|
|
|
|
*/
|
2009-07-10 12:06:36 +00:00
|
|
|
typedef int (*qemud_client_filter_func)(struct qemud_client *client,
|
|
|
|
struct qemud_client_message *msg, void *opaque);
|
2009-07-10 11:58:22 +00:00
|
|
|
struct qemud_client_filter {
|
|
|
|
qemud_client_filter_func query;
|
|
|
|
void *opaque;
|
|
|
|
|
|
|
|
struct qemud_client_filter *next;
|
|
|
|
};
|
|
|
|
|
2009-07-10 12:06:36 +00:00
|
|
|
struct qemud_client_stream {
|
|
|
|
virStreamPtr st;
|
|
|
|
int procedure;
|
|
|
|
int serial;
|
|
|
|
|
|
|
|
unsigned int recvEOF : 1;
|
|
|
|
unsigned int closed : 1;
|
|
|
|
|
|
|
|
struct qemud_client_filter filter;
|
|
|
|
|
|
|
|
struct qemud_client_message *rx;
|
|
|
|
int tx;
|
|
|
|
|
|
|
|
struct qemud_client_stream *next;
|
|
|
|
};
|
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
/* Stores the per-client connection state */
|
|
|
|
struct qemud_client {
|
2009-01-15 19:56:05 +00:00
|
|
|
virMutex lock;
|
2008-12-04 22:16:40 +00:00
|
|
|
|
2007-06-11 12:04:54 +00:00
|
|
|
int magic;
|
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
int fd;
|
2008-11-19 16:19:36 +00:00
|
|
|
int watch;
|
2010-01-19 12:07:32 +00:00
|
|
|
unsigned int readonly :1;
|
|
|
|
unsigned int closing :1;
|
Remote driver & daemon impl of new event API
This wires up the remote driver to handle the new events APIs.
The public API allows an application to request a callback filters
events to a specific domain object, and register multiple callbacks
for the same event type. On the wire there are two strategies for
this
- Register multiple callbacks with the remote daemon, each
with filtering as needed
- Register only one callback per event type, with no filtering
Both approaches have potential inefficiency. In the first scheme,
the same event gets sent over the wire many times if multiple
callbacks are registered. With the second scheme, unneccessary
events get sent over the wire if a per-domain filter is set on
the client. The second scheme is far easier to implement though,
so this patch takes that approach.
* daemon/dispatch.h: Don't export remoteRelayDomainEvent since it
is no longer needed for unregistering callbacks, instead the
unique callback ID is used
* daemon/libvirtd.c, daemon/libvirtd.h: Track and unregister
callbacks based on callback ID, instead of function pointer
* daemon/remote.c: Switch over to using virConnectDomainEventRegisterAny
instead of legacy virConnectDomainEventRegister function. Refactor
remoteDispatchDomainEventSend() to cope with arbitrary event types
* src/driver.h, src/driver.c: Move verify() call into source file
instead of header, to avoid polluting the global namespace with
the verify function name
* src/remote/remote_driver.c: Implement new APIs for event
registration. Refactor processCallDispatchMessage() to cope
with arbitrary incoming event types. Merge remoteDomainQueueEvent()
into processCallDispatchMessage() to avoid duplication of code.
Rename remoteDomainReadEvent() to remoteDomainReadEventLifecycle()
* src/remote/remote_protocol.x: Define wire format for the new
virConnectDomainEventRegisterAny and virConnectDomainEventDeregisterAny
functions
2010-03-18 14:56:56 +00:00
|
|
|
int domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LAST];
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2010-10-21 14:45:12 +00:00
|
|
|
virSocketAddr addr;
|
|
|
|
const char *addrstr;
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2007-12-05 15:27:08 +00:00
|
|
|
int type; /* qemud_sock_type */
|
|
|
|
gnutls_session_t tlssession;
|
2007-12-05 15:24:15 +00:00
|
|
|
int auth;
|
2010-01-19 12:07:32 +00:00
|
|
|
unsigned int handshake :1; /* If we're in progress for TLS handshake */
|
2010-03-09 18:22:22 +00:00
|
|
|
# if HAVE_SASL
|
2007-12-05 15:24:15 +00:00
|
|
|
sasl_conn_t *saslconn;
|
2007-12-05 15:27:08 +00:00
|
|
|
int saslSSF;
|
|
|
|
const char *saslDecoded;
|
|
|
|
unsigned int saslDecodedLength;
|
|
|
|
unsigned int saslDecodedOffset;
|
|
|
|
const char *saslEncoded;
|
|
|
|
unsigned int saslEncodedLength;
|
|
|
|
unsigned int saslEncodedOffset;
|
2007-12-05 15:34:05 +00:00
|
|
|
char *saslUsername;
|
2011-04-03 09:21:20 +00:00
|
|
|
char saslTemporary[8192]; /* temorary holds data to be decoded */
|
2010-03-09 18:22:22 +00:00
|
|
|
# endif
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2009-01-20 19:25:15 +00:00
|
|
|
/* Count of meages in 'dx' or 'tx' queue
|
|
|
|
* ie RPC calls in progress. Does not count
|
|
|
|
* async events which are not used for
|
|
|
|
* throttling calculations */
|
|
|
|
int nrequests;
|
|
|
|
/* Zero or one messages being received. Zero if
|
|
|
|
* nrequests >= max_clients and throttling */
|
|
|
|
struct qemud_client_message *rx;
|
|
|
|
/* Zero or many messages waiting for a worker
|
|
|
|
* to process them */
|
|
|
|
struct qemud_client_message *dx;
|
|
|
|
/* Zero or many messages waiting for transmit
|
|
|
|
* back to client, including async events */
|
|
|
|
struct qemud_client_message *tx;
|
2009-07-10 11:58:22 +00:00
|
|
|
/* Filters to capture messages that would otherwise
|
|
|
|
* end up on the 'dx' queue */
|
|
|
|
struct qemud_client_filter *filters;
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2009-07-10 12:06:36 +00:00
|
|
|
/* Data streams */
|
|
|
|
struct qemud_client_stream *streams;
|
|
|
|
|
|
|
|
|
2007-06-11 12:04:54 +00:00
|
|
|
/* This is only valid if a remote open call has been made on this
|
|
|
|
* connection, otherwise it will be NULL. Also if remote close is
|
|
|
|
* called, it will be set back to NULL if that succeeds.
|
|
|
|
*/
|
|
|
|
virConnectPtr conn;
|
2008-12-04 22:16:40 +00:00
|
|
|
int refs;
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
};
|
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# define QEMUD_CLIENT_MAGIC 0x7788aaee
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
|
|
|
|
struct qemud_socket {
|
2010-06-03 13:36:34 +00:00
|
|
|
char *path;
|
2010-10-21 14:45:12 +00:00
|
|
|
|
|
|
|
virSocketAddr addr;
|
|
|
|
const char *addrstr;
|
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
int fd;
|
2008-11-19 16:19:36 +00:00
|
|
|
int watch;
|
2007-02-14 01:40:09 +00:00
|
|
|
int readonly;
|
2007-12-05 15:27:08 +00:00
|
|
|
int type; /* qemud_sock_type */
|
2007-12-05 15:24:15 +00:00
|
|
|
int auth;
|
2010-10-21 14:45:12 +00:00
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
struct qemud_socket *next;
|
|
|
|
};
|
|
|
|
|
2009-01-20 19:27:11 +00:00
|
|
|
struct qemud_worker {
|
|
|
|
pthread_t thread;
|
2010-01-19 12:07:32 +00:00
|
|
|
unsigned int hasThread :1;
|
|
|
|
unsigned int processingCall :1;
|
|
|
|
unsigned int quitRequest :1;
|
2009-01-20 19:27:11 +00:00
|
|
|
|
|
|
|
/* back-pointer to our server */
|
|
|
|
struct qemud_server *server;
|
|
|
|
};
|
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
/* Main server state */
|
|
|
|
struct qemud_server {
|
2009-01-15 19:56:05 +00:00
|
|
|
virMutex lock;
|
|
|
|
virCond job;
|
2008-12-04 22:16:40 +00:00
|
|
|
|
2009-06-12 13:20:13 +00:00
|
|
|
int privileged;
|
|
|
|
|
2010-08-13 22:19:54 +00:00
|
|
|
size_t nworkers;
|
|
|
|
size_t nactiveworkers;
|
2009-01-20 19:27:11 +00:00
|
|
|
struct qemud_worker *workers;
|
2010-08-13 22:19:54 +00:00
|
|
|
size_t nsockets;
|
2007-02-14 01:40:09 +00:00
|
|
|
struct qemud_socket *sockets;
|
2010-08-13 22:19:54 +00:00
|
|
|
size_t nclients;
|
|
|
|
size_t nclients_max;
|
2008-12-04 22:09:35 +00:00
|
|
|
struct qemud_client **clients;
|
2008-12-04 22:16:40 +00:00
|
|
|
|
2007-02-16 18:28:17 +00:00
|
|
|
int sigread;
|
2009-10-16 10:48:50 +00:00
|
|
|
int sigwrite;
|
2009-02-09 17:52:38 +00:00
|
|
|
char *logDir;
|
2009-10-16 15:34:37 +00:00
|
|
|
pthread_t eventThread;
|
|
|
|
unsigned int hasEventThread :1;
|
|
|
|
unsigned int quitEventThread :1;
|
2010-03-09 18:22:22 +00:00
|
|
|
# ifdef HAVE_AVAHI
|
2007-09-19 01:56:55 +00:00
|
|
|
struct libvirtd_mdns *mdns;
|
2010-03-09 18:22:22 +00:00
|
|
|
# endif
|
|
|
|
# if HAVE_SASL
|
2007-12-05 15:34:05 +00:00
|
|
|
char **saslUsernameWhitelist;
|
2010-03-09 18:22:22 +00:00
|
|
|
# endif
|
|
|
|
# if HAVE_POLKIT0
|
2007-12-05 18:21:27 +00:00
|
|
|
DBusConnection *sysbus;
|
2010-03-09 18:22:22 +00:00
|
|
|
# endif
|
2007-02-14 01:40:09 +00:00
|
|
|
};
|
|
|
|
|
2007-03-16 15:03:21 +00:00
|
|
|
void qemudLog(int priority, const char *fmt, ...)
|
Fix misc Win32 compile warnings
GCC >= 4.4 assumes the 'printf' attribute refers to the native
runtime libraries format specifiers. Thanks to gnulib, libvirt
has GNU format specifiers everywhere. This means we need to
use 'gnu_printf' with GCC >= 4.4 to get correct compiler
checking of printf format specifiers.
* HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
* autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
driver on mingw32 builds
* qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
src/logging.h, src/security.h, src/sexpr.h, src/util.h,
src/virterror_internal.h, src/xend_internal.c: Change
over to ATTRIBUTE_FMT_PRINTF.
* src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
since they don't compile
* src/threads-win32.c: Add missing return value check
2009-07-23 15:07:32 +00:00
|
|
|
ATTRIBUTE_FMT_PRINTF(2,3);
|
2007-02-16 18:30:55 +00:00
|
|
|
|
2007-02-14 15:58:06 +00:00
|
|
|
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2009-01-20 19:25:15 +00:00
|
|
|
int qemudRegisterClientEvent(struct qemud_server *server,
|
2009-07-10 11:48:50 +00:00
|
|
|
struct qemud_client *client);
|
|
|
|
void qemudUpdateClientEvent(struct qemud_client *client);
|
2008-10-23 13:18:18 +00:00
|
|
|
|
2009-01-20 19:25:15 +00:00
|
|
|
void qemudDispatchClientFailure(struct qemud_client *client);
|
|
|
|
|
|
|
|
void
|
|
|
|
qemudClientMessageQueuePush(struct qemud_client_message **queue,
|
|
|
|
struct qemud_client_message *msg);
|
2009-07-10 11:20:03 +00:00
|
|
|
struct qemud_client_message *
|
|
|
|
qemudClientMessageQueueServe(struct qemud_client_message **queue);
|
2007-02-23 08:39:49 +00:00
|
|
|
|
2009-07-10 12:06:36 +00:00
|
|
|
void
|
|
|
|
qemudClientMessageRelease(struct qemud_client *client,
|
|
|
|
struct qemud_client_message *msg);
|
2008-10-23 13:18:18 +00:00
|
|
|
|
2009-01-20 19:25:15 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# if HAVE_POLKIT
|
2009-01-20 19:25:15 +00:00
|
|
|
int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid);
|
2010-03-09 18:22:22 +00:00
|
|
|
# endif
|
2009-01-20 19:25:15 +00:00
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
#endif
|