Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 56 lines (50 sloc) 1.767 kb
c685a07 Initial version
OpenVZ team authored
1 /*
0154b00 @kolyshkin Massive VE -> container rename
kolyshkin authored
2 * Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
c685a07 Initial version
OpenVZ team authored
3 *
7682708 Changed license agreement from QPL to GPL
Igor Sukhih authored
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
c685a07 Initial version
OpenVZ team authored
8 *
7682708 Changed license agreement from QPL to GPL
Igor Sukhih authored
9 * This program 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
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
c685a07 Initial version
OpenVZ team authored
17 */
18 #ifndef _CPU_H_
19 #define _CPU_H_
20
5aa2d07 @kolyshkin A bunch of whitespace fixes
kolyshkin authored
21 #define MAXCPUUNITS 500000
22 #define MINCPUUNITS 8
c685a07 Initial version
OpenVZ team authored
23
9038767 Add cpu bindings (cpumask option)
Vladimir Davydov authored
24 #define CPUMASK_NBITS 1024
25 typedef struct {
26 unsigned long bits[CPUMASK_NBITS / (8 * sizeof(unsigned long))];
27 } cpumask_t;
28 #define cpumask_bits(maskp) ((maskp)->bits)
29
c685a07 Initial version
OpenVZ team authored
30 /** Data structure for cpu parameters.
31 */
32 typedef struct {
0154b00 @kolyshkin Massive VE -> container rename
kolyshkin authored
33 unsigned long *limit; /**< CPU usage for the CT, in per cent. */
c685a07 Initial version
OpenVZ team authored
34 unsigned long *weight;
0154b00 @kolyshkin Massive VE -> container rename
kolyshkin authored
35 unsigned long *units; /**< CPU weight for the CT, in units. */
36 unsigned long *vcpus; /**< number of CPUs available in the running CT */
9038767 Add cpu bindings (cpumask option)
Vladimir Davydov authored
37 cpumask_t *mask; /**< CT's CPU affinity mask */
c685a07 Initial version
OpenVZ team authored
38 } cpu_param;
39
0154b00 @kolyshkin Massive VE -> container rename
kolyshkin authored
40 /** Apply cpu parameters on running CT.
c685a07 Initial version
OpenVZ team authored
41 *
0154b00 @kolyshkin Massive VE -> container rename
kolyshkin authored
42 * @param h CT handler.
e0961ad @kolyshkin include/*: cosmetic CT id -> CT ID
kolyshkin authored
43 * @param veid CT ID.
c685a07 Initial version
OpenVZ team authored
44 * @param cpu cpu parameters.
45 * @return 0 on success.
46 */
47 int vps_set_cpu(vps_handler *h, envid_t veid, cpu_param *cpu);
48
49 /** Apply cpu parameters on Host system.
50 *
51 * @param cpu cpu parameters.
52 * @return 0 on success.
53 */
54 int hn_set_cpu(cpu_param *cpu);
55 #endif
Something went wrong with that request. Please try again.