From 289a175b263b2f637e275f7c8e3620479e8eb215 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 5 Mar 2004 03:27:56 +0000 Subject: [PATCH] added 'FEATURE' tag git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1087 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/vserver-info.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util-vserver/src/vserver-info.c b/util-vserver/src/vserver-info.c index b355b39..eb63df4 100644 --- a/util-vserver/src/vserver-info.c +++ b/util-vserver/src/vserver-info.c @@ -44,6 +44,7 @@ typedef enum { tgNONE,tgCONTEXT, tgRUNNING, tgAPIVER, tgINITPID, tgINITPID_PID, tgXID, tgUTS, tgSYSINFO, + tgFEATURE, } VserverTag; static struct { @@ -65,6 +66,7 @@ static struct { "context, sysname, nodename, release, version, " "machine and domainname") }, { "SYSINFO", tgSYSINFO, "gives out information about the systen" }, + { "FEATURE", tgFEATURE, "returns 0 iff the queried feature is supported" }, }; int wrapper_exit_code = 1; @@ -290,6 +292,12 @@ getContext(char *buf, char const *vserver) } static int +testFeature(int argc, char *argv[]) +{ + return (argc>0 && vc_isSupportedString(argv[0])) ? EXIT_SUCCESS : EXIT_FAILURE; +} + +static int execQuery(char const *vserver, VserverTag tag, int argc, char *argv[]) { char const * res = 0; @@ -318,6 +326,7 @@ execQuery(char const *vserver, VserverTag tag, int argc, char *argv[]) case tgAPIVER : res = getAPIVer(buf); break; case tgUTS : res = getUTS(buf, xid, argc, argv); break; case tgSYSINFO : return printSysInfo(buf); break; + case tgFEATURE : return testFeature(argc,argv); break; default : assert(false); abort(); // TODO } -- 1.8.1.5