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
|
|
|
*
|
2012-01-20 18:43:28 +00:00
|
|
|
* Copyright (C) 2006-2012 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
|
2012-07-21 10:06:23 +00:00
|
|
|
* License along with this library; If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2007-02-14 01:40:09 +00:00
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-01-20 18:43:28 +00:00
|
|
|
#ifndef LIBVIRTD_H__
|
|
|
|
# define LIBVIRTD_H__
|
|
|
|
|
|
|
|
# define VIR_ENUM_SENTINELS
|
2010-03-09 18:22:22 +00:00
|
|
|
|
|
|
|
# include <config.h>
|
|
|
|
|
|
|
|
# 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"
|
2011-07-05 15:30:09 +00:00
|
|
|
# if HAVE_SASL
|
|
|
|
# include "virnetsaslcontext.h"
|
|
|
|
# endif
|
2011-05-16 17:13:11 +00:00
|
|
|
# include "virnetserverprogram.h"
|
2010-03-09 18:22:22 +00:00
|
|
|
|
2011-05-16 17:13:11 +00:00
|
|
|
typedef struct daemonClientStream daemonClientStream;
|
|
|
|
typedef daemonClientStream *daemonClientStreamPtr;
|
|
|
|
typedef struct daemonClientPrivate daemonClientPrivate;
|
|
|
|
typedef daemonClientPrivate *daemonClientPrivatePtr;
|
2009-07-10 12:06:36 +00:00
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
/* Stores the per-client connection state */
|
2011-05-16 17:13:11 +00:00
|
|
|
struct daemonClientPrivate {
|
|
|
|
/* Hold while accessing any data except conn */
|
2009-01-15 19:56:05 +00:00
|
|
|
virMutex lock;
|
2008-12-04 22:16:40 +00:00
|
|
|
|
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
|
|
|
|
2011-07-05 15:30:09 +00:00
|
|
|
# if HAVE_SASL
|
2011-05-16 17:13:11 +00:00
|
|
|
virNetSASLSessionPtr sasl;
|
2011-07-05 15:30:09 +00:00
|
|
|
# endif
|
2009-07-10 12:06:36 +00:00
|
|
|
|
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;
|
2007-02-14 01:40:09 +00:00
|
|
|
|
2011-05-16 17:13:11 +00:00
|
|
|
daemonClientStreamPtr streams;
|
2011-08-24 13:33:34 +00:00
|
|
|
bool keepalive_supported;
|
2007-02-14 01:40:09 +00:00
|
|
|
};
|
|
|
|
|
2011-07-05 15:30:09 +00:00
|
|
|
# if HAVE_SASL
|
2011-05-16 17:13:11 +00:00
|
|
|
extern virNetSASLContextPtr saslCtxt;
|
2011-07-05 15:30:09 +00:00
|
|
|
# endif
|
2011-05-16 17:13:11 +00:00
|
|
|
extern virNetServerProgramPtr remoteProgram;
|
|
|
|
extern virNetServerProgramPtr qemuProgram;
|
2009-01-20 19:27:11 +00:00
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
#endif
|