~ubuntu-branches/ubuntu/raring/libvirt/raring

« back to all changes in this revision

Viewing changes to .pc/apparmor-allow-hugepages/src/security/security_driver.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2012-12-05 16:43:04 UTC
  • mfrom: (223.1.4 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121205164304-i4heapilb4ogcgzl
Tags: 1.0.0-0ubuntu4
* debian/patches/apparmor-allow-hugepages: update apparmor policies to
  allow use of hugepages.  (LP: #646468)
* debian/patches/vnc-socket.patch: If a vnc socket is in use, add it's
  path to the apparmor policy.  (LP: #1069534)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2008, 2010 Red Hat, Inc.
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Lesser General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2.1 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Lesser General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public
 
15
 * License along with this library.  If not, see
 
16
 * <http://www.gnu.org/licenses/>.
 
17
 *
 
18
 * Authors:
 
19
 *     James Morris <jmorris@namei.org>
 
20
 *
 
21
 */
 
22
#ifndef __VIR_SECURITY_H__
 
23
# define __VIR_SECURITY_H__
 
24
 
 
25
# include "internal.h"
 
26
# include "domain_conf.h"
 
27
 
 
28
# include "security_manager.h"
 
29
 
 
30
/*
 
31
 * Return values for security driver probing: the driver will determine
 
32
 * whether it should be enabled or disabled.
 
33
 */
 
34
typedef enum {
 
35
    SECURITY_DRIVER_ENABLE      = 0,
 
36
    SECURITY_DRIVER_ERROR       = -1,
 
37
    SECURITY_DRIVER_DISABLE     = -2,
 
38
} virSecurityDriverStatus;
 
39
 
 
40
typedef struct _virSecurityDriver virSecurityDriver;
 
41
typedef virSecurityDriver *virSecurityDriverPtr;
 
42
 
 
43
typedef virSecurityDriverStatus (*virSecurityDriverProbe) (const char *virtDriver);
 
44
typedef int (*virSecurityDriverOpen) (virSecurityManagerPtr mgr);
 
45
typedef int (*virSecurityDriverClose) (virSecurityManagerPtr mgr);
 
46
 
 
47
typedef const char *(*virSecurityDriverGetModel) (virSecurityManagerPtr mgr);
 
48
typedef const char *(*virSecurityDriverGetDOI) (virSecurityManagerPtr mgr);
 
49
 
 
50
typedef int (*virSecurityDomainRestoreImageLabel) (virSecurityManagerPtr mgr,
 
51
                                                   virDomainDefPtr def,
 
52
                                                   virDomainDiskDefPtr disk);
 
53
typedef int (*virSecurityDomainSetDaemonSocketLabel)(virSecurityManagerPtr mgr,
 
54
                                                     virDomainDefPtr vm);
 
55
typedef int (*virSecurityDomainSetSocketLabel) (virSecurityManagerPtr mgr,
 
56
                                                virDomainDefPtr def);
 
57
typedef int (*virSecurityDomainClearSocketLabel)(virSecurityManagerPtr mgr,
 
58
                                                virDomainDefPtr def);
 
59
typedef int (*virSecurityDomainSetImageLabel) (virSecurityManagerPtr mgr,
 
60
                                               virDomainDefPtr def,
 
61
                                               virDomainDiskDefPtr disk);
 
62
typedef int (*virSecurityDomainRestoreHostdevLabel) (virSecurityManagerPtr mgr,
 
63
                                                     virDomainDefPtr def,
 
64
                                                     virDomainHostdevDefPtr dev);
 
65
typedef int (*virSecurityDomainSetHostdevLabel) (virSecurityManagerPtr mgr,
 
66
                                                 virDomainDefPtr def,
 
67
                                                 virDomainHostdevDefPtr dev);
 
68
typedef int (*virSecurityDomainSetSavedStateLabel) (virSecurityManagerPtr mgr,
 
69
                                                    virDomainDefPtr def,
 
70
                                                    const char *savefile);
 
71
typedef int (*virSecurityDomainRestoreSavedStateLabel) (virSecurityManagerPtr mgr,
 
72
                                                        virDomainDefPtr def,
 
73
                                                        const char *savefile);
 
74
typedef int (*virSecurityDomainGenLabel) (virSecurityManagerPtr mgr,
 
75
                                          virDomainDefPtr sec);
 
76
typedef int (*virSecurityDomainReserveLabel) (virSecurityManagerPtr mgr,
 
77
                                              virDomainDefPtr sec,
 
78
                                              pid_t pid);
 
79
typedef int (*virSecurityDomainReleaseLabel) (virSecurityManagerPtr mgr,
 
80
                                              virDomainDefPtr sec);
 
81
typedef int (*virSecurityDomainSetAllLabel) (virSecurityManagerPtr mgr,
 
82
                                             virDomainDefPtr sec,
 
83
                                             const char *stdin_path);
 
84
typedef int (*virSecurityDomainRestoreAllLabel) (virSecurityManagerPtr mgr,
 
85
                                                 virDomainDefPtr def,
 
86
                                                 int migrated);
 
87
typedef int (*virSecurityDomainGetProcessLabel) (virSecurityManagerPtr mgr,
 
88
                                                 virDomainDefPtr def,
 
89
                                                 pid_t pid,
 
90
                                                 virSecurityLabelPtr sec);
 
91
typedef int (*virSecurityDomainSetProcessLabel) (virSecurityManagerPtr mgr,
 
92
                                                 virDomainDefPtr def);
 
93
typedef int (*virSecurityDomainSecurityVerify) (virSecurityManagerPtr mgr,
 
94
                                                virDomainDefPtr def);
 
95
typedef int (*virSecurityDomainSetImageFDLabel) (virSecurityManagerPtr mgr,
 
96
                                                 virDomainDefPtr def,
 
97
                                                 int fd);
 
98
typedef int (*virSecurityDomainSetTapFDLabel) (virSecurityManagerPtr mgr,
 
99
                                               virDomainDefPtr def,
 
100
                                               int fd);
 
101
typedef char *(*virSecurityDomainGetMountOptions) (virSecurityManagerPtr mgr,
 
102
                                                         virDomainDefPtr def);
 
103
 
 
104
struct _virSecurityDriver {
 
105
    size_t privateDataLen;
 
106
    const char *name;
 
107
    virSecurityDriverProbe probe;
 
108
    virSecurityDriverOpen open;
 
109
    virSecurityDriverClose close;
 
110
 
 
111
    virSecurityDriverGetModel getModel;
 
112
    virSecurityDriverGetDOI getDOI;
 
113
 
 
114
    virSecurityDomainSecurityVerify domainSecurityVerify;
 
115
 
 
116
    virSecurityDomainSetImageLabel domainSetSecurityImageLabel;
 
117
    virSecurityDomainRestoreImageLabel domainRestoreSecurityImageLabel;
 
118
 
 
119
    virSecurityDomainSetDaemonSocketLabel domainSetSecurityDaemonSocketLabel;
 
120
    virSecurityDomainSetSocketLabel domainSetSecuritySocketLabel;
 
121
    virSecurityDomainClearSocketLabel domainClearSecuritySocketLabel;
 
122
 
 
123
    virSecurityDomainGenLabel domainGenSecurityLabel;
 
124
    virSecurityDomainReserveLabel domainReserveSecurityLabel;
 
125
    virSecurityDomainReleaseLabel domainReleaseSecurityLabel;
 
126
 
 
127
    virSecurityDomainGetProcessLabel domainGetSecurityProcessLabel;
 
128
    virSecurityDomainSetProcessLabel domainSetSecurityProcessLabel;
 
129
 
 
130
    virSecurityDomainSetAllLabel domainSetSecurityAllLabel;
 
131
    virSecurityDomainRestoreAllLabel domainRestoreSecurityAllLabel;
 
132
 
 
133
    virSecurityDomainSetHostdevLabel domainSetSecurityHostdevLabel;
 
134
    virSecurityDomainRestoreHostdevLabel domainRestoreSecurityHostdevLabel;
 
135
 
 
136
    virSecurityDomainSetSavedStateLabel domainSetSavedStateLabel;
 
137
    virSecurityDomainRestoreSavedStateLabel domainRestoreSavedStateLabel;
 
138
 
 
139
    virSecurityDomainSetImageFDLabel domainSetSecurityImageFDLabel;
 
140
    virSecurityDomainSetTapFDLabel domainSetSecurityTapFDLabel;
 
141
 
 
142
    virSecurityDomainGetMountOptions domainGetSecurityMountOptions;
 
143
};
 
144
 
 
145
virSecurityDriverPtr virSecurityDriverLookup(const char *name,
 
146
                                             const char *virtDriver);
 
147
 
 
148
#endif /* __VIR_SECURITY_H__ */