libvirtd.h 2.8 KB
Newer Older
D
Daniel P. Berrange 已提交
1
/*
D
Daniel P. Berrange 已提交
2
 * libvirtd.h: daemon data structure definitions
D
Daniel P. Berrange 已提交
3
 *
4
 * Copyright (C) 2006-2015 Red Hat, Inc.
D
Daniel P. Berrange 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17
 * 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
18
 * License along with this library.  If not, see
O
Osier Yang 已提交
19
 * <http://www.gnu.org/licenses/>.
D
Daniel P. Berrange 已提交
20 21 22 23 24
 *
 * Author: Daniel P. Berrange <berrange@redhat.com>
 */


25 26 27 28
#ifndef LIBVIRTD_H__
# define LIBVIRTD_H__

# define VIR_ENUM_SENTINELS
29 30 31 32

# include <rpc/types.h>
# include <rpc/xdr.h>
# include "remote_protocol.h"
33
# include "admin_protocol.h"
34
# include "lxc_protocol.h"
C
Chris Lalancette 已提交
35
# include "qemu_protocol.h"
36
# include "virthread.h"
37

38
# if WITH_SASL
39 40
#  include "virnetsaslcontext.h"
# endif
41
# include "virnetserverprogram.h"
42

43 44 45 46
typedef struct daemonClientStream daemonClientStream;
typedef daemonClientStream *daemonClientStreamPtr;
typedef struct daemonClientPrivate daemonClientPrivate;
typedef daemonClientPrivate *daemonClientPrivatePtr;
47 48
typedef struct daemonAdmClientPrivate daemonAdmClientPrivate;
typedef daemonAdmClientPrivate *daemonAdmClientPrivatePtr;
49 50
typedef struct daemonClientEventCallback daemonClientEventCallback;
typedef daemonClientEventCallback *daemonClientEventCallbackPtr;
51

D
Daniel P. Berrange 已提交
52
/* Stores the per-client connection state */
53 54
struct daemonClientPrivate {
    /* Hold while accessing any data except conn */
55
    virMutex lock;
56

57 58
    daemonClientEventCallbackPtr *domainEventCallbacks;
    size_t ndomainEventCallbacks;
59 60
    daemonClientEventCallbackPtr *networkEventCallbacks;
    size_t nnetworkEventCallbacks;
61 62
    daemonClientEventCallbackPtr *qemuEventCallbacks;
    size_t nqemuEventCallbacks;
63

64
# if WITH_SASL
65
    virNetSASLSessionPtr sasl;
66
# endif
67

68 69 70 71 72
    /* 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;
D
Daniel P. Berrange 已提交
73

74
    daemonClientStreamPtr streams;
75
    bool keepalive_supported;
D
Daniel P. Berrange 已提交
76 77
};

78 79 80 81 82 83 84 85
/* Separate private data for admin connection */
struct daemonAdmClientPrivate {
    /* Just a placeholder, not that there is anything to be locked */
    virMutex lock;

    virNetDaemonPtr dmn;
};

86
# if WITH_SASL
87
extern virNetSASLContextPtr saslCtxt;
88
# endif
89 90
extern virNetServerProgramPtr remoteProgram;
extern virNetServerProgramPtr qemuProgram;
91

D
Daniel P. Berrange 已提交
92
#endif