X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvserver-info.c;h=29a3b0cfd890c29819ad3c343de048711778da77;hb=989f6cc00a65b6c06f1453f50abc442a28dad714;hp=014489df4e382ffed17df4c0ffa375d00d35df10;hpb=8463f7b04ea526fac094ed007284cc682aadaa56;p=util-vserver.git diff --git a/src/vserver-info.c b/src/vserver-info.c index 014489d..29a3b0c 100644 --- a/src/vserver-info.c +++ b/src/vserver-info.c @@ -189,7 +189,7 @@ verifyCap() struct __user_cap_header_struct header; struct __user_cap_data_struct user[2]; - header.version = _LINUX_CAPABILITY_VERSION_2; + header.version = _LINUX_CAPABILITY_VERSION_3; header.pid = 0; if (getuid()!=0) { @@ -205,7 +205,7 @@ verifyCap() retry: if (capget(&header, user)==-1) { if (!retried && - header.version != _LINUX_CAPABILITY_VERSION_2) { + header.version != _LINUX_CAPABILITY_VERSION_3) { header.version = _LINUX_CAPABILITY_VERSION_1; retried = 1; goto retry; @@ -242,6 +242,21 @@ getAPIVer(char *buf) return buf; } +static char * +getAPIConfig(char *buf) +{ + vc_vci_t v = vc_get_vci(); + size_t l; + + if (v==(vc_vci_t)-1) return 0; + + l = utilvserver_fmt_xuint64(0, (unsigned int)v); + memcpy(buf, "0x0000000000000000", 19); + utilvserver_fmt_xuint64(buf+2+16-l, (unsigned int)v); + + return buf; +} + static inline char * getCtxId(char *buf, const char *pid_str, xid_t (*get_id)(pid_t pid), const char *err_str) { @@ -432,12 +447,18 @@ printSysInfo(char *buf) "Versions:\n" " Kernel: "); WRITE_STR(1, uts.release); + WRITE_MSG(1, "\n" " VS-API: "); - memset(buf, 0, 128); if (getAPIVer(buf)) WRITE_STR(1, buf); else WRITE_MSG(1, "???"); + + WRITE_MSG(1, "\n" + " VCI: "); + memset(buf, 0, 128); + if (getAPIConfig(buf)) WRITE_STR(1, buf); + else WRITE_MSG(1, "???"); WRITE_MSG(1, "\n" " util-vserver: " PACKAGE_VERSION "; " __DATE__ ", " __TIME__"\n"