lxc_container.h 2.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 * Copyright IBM Corp. 2008
 *
 * lxc_container.h: header file for fcns run inside container
 *
 * Authors:
 *  David L. Leskovec <dlesko at linux.vnet.ibm.com>
 *
 * 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
20
 * License along with this library.  If not, see
O
Osier Yang 已提交
21
 * <http://www.gnu.org/licenses/>.
22 23 24
 */

#ifndef LXC_CONTAINER_H
25
# define LXC_CONTAINER_H
26

27
# include "lxc_conf.h"
28
# include "security/security_manager.h"
29

30 31
enum {
    LXC_CONTAINER_FEATURE_NET = (1 << 0),
32
    LXC_CONTAINER_FEATURE_USER = (1 << 1),
33 34
};

35 36 37 38 39 40
# define LXC_DEV_MAJ_MEMORY  1
# define LXC_DEV_MIN_NULL    3
# define LXC_DEV_MIN_ZERO    5
# define LXC_DEV_MIN_FULL    7
# define LXC_DEV_MIN_RANDOM  8
# define LXC_DEV_MIN_URANDOM 9
D
Dan Smith 已提交
41

42 43 44 45
# define LXC_DEV_MAJ_TTY     5
# define LXC_DEV_MIN_TTY     0
# define LXC_DEV_MIN_CONSOLE 1
# define LXC_DEV_MIN_PTMX    2
D
Dan Smith 已提交
46

47
# define LXC_DEV_MAJ_PTY     136
48

G
Gao feng 已提交
49 50 51
# define LXC_DEV_MAJ_FUSE    10
# define LXC_DEV_MIN_FUSE    229

52
int lxcContainerSendContinue(int control);
53
int lxcContainerWaitForContinue(int control);
54

55
int lxcContainerStart(virDomainDefPtr def,
56
                      virSecurityManagerPtr securityDriver,
57
                      size_t nveths,
58
                      char **veths,
59 60
                      size_t npassFDs,
                      int *passFDs,
61
                      int control,
62
                      int handshakefd,
63 64
                      size_t nttyPaths,
                      char **ttyPaths);
65

66
int lxcContainerAvailable(int features);
67

68 69
int lxcContainerSetupHostdevCapsMakePath(const char *dev);

70
virArch lxcContainerGetAlt32bitArch(virArch arch);
71

72 73
int lxcContainerChown(virDomainDefPtr def, const char *path);

74 75
bool lxcIsBasicMountLocation(const char *path);

76
#endif /* LXC_CONTAINER_H */