3 // Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; version 2 of the License.
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.
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.
27 vc_isSupported(vcFeatureSet feature)
29 int ver = vc_get_version();
30 vc_vci_t conf = vc_get_vci();
31 if (ver==-1) return false;
32 if (conf==(vc_vci_t)-1) conf = 0;
35 case vcFEATURE_COMPAT : return true;
36 case vcFEATURE_VSHELPER0 : return ver >= 0x00010000 && ver < 0x00010010;
37 case vcFEATURE_VSHELPER : return ver >= 0x00010000;
38 case vcFEATURE_VKILL : return ver >= 0x00010004;
39 case vcFEATURE_RLIMIT : return ver >= 0x00010004;
40 case vcFEATURE_VINFO : return ver >= 0x00010010;
41 case vcFEATURE_VHI : return ver >= 0x00010010;
42 case vcFEATURE_IATTR : return ver >= 0x00010011;
43 case vcFEATURE_MIGRATE : return ver >= 0x00010012;
44 case vcFEATURE_NAMESPACE : return ver >= 0x00010012;
45 case vcFEATURE_VWAIT : return ver >= 0x00010025;
46 case vcFEATURE_SCHED : return ver >= 0x00020000; // todo
47 case vcFEATURE_VNET : return ver >= 0x00020001;
48 case vcFEATURE_PERSISTENT : return ver >= 0x00020002;
49 case vcFEATURE_VSTAT : return ver >= 0x00020103;
50 case vcFEATURE_PPTAG : return conf & VC_VCI_PPTAG;
51 case vcFEATURE_SPACES : return conf & VC_VCI_SPACES;
52 case vcFEATURE_PIDSPACE : return ver >= 0x00020304 || ver >= 0x00020201;
53 default : assert(false);