Skip to content

Commit 8ee3b0c

Browse files
committed
Remove obsolete OpenVZ and VServer support
This commit fully removes all of the OpenVZ and Linux VServer legacy that has been dormant and unused for the past few years. The code has been disabled by default for several releases now and has not been in use for quite some time. Assisted-By: Claude Haiku 4.5
1 parent ac2cdee commit 8ee3b0c

10 files changed

Lines changed: 9 additions & 234 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ jobs:
6969
- name: Bootstrap
7070
run: ./autogen.sh
7171
- name: Configure
72-
run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
72+
run: ./configure --enable-werror --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
7373
- name: Build
7474
run: make -k
7575
- name: Distcheck
76-
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling'
76+
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling'
7777

7878
build-ubuntu-latest-full-featured-clang:
7979
runs-on: ubuntu-latest
@@ -93,11 +93,11 @@ jobs:
9393
- name: Bootstrap
9494
run: ./autogen.sh
9595
- name: Configure
96-
run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
96+
run: ./configure --enable-werror --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
9797
- name: Build
9898
run: make -k
9999
- name: Distcheck
100-
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling'
100+
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling'
101101

102102
build-ubuntu-latest-gcc-static:
103103
runs-on: ubuntu-latest
@@ -114,11 +114,11 @@ jobs:
114114
- name: Bootstrap
115115
run: ./autogen.sh
116116
- name: Configure
117-
run: ./configure --enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
117+
run: ./configure --enable-static --enable-werror --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
118118
- name: Build
119119
run: make -k
120120
- name: Distcheck
121-
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities'
121+
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-static --enable-werror --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities'
122122

123123
build-ubuntu-latest-pcp:
124124
# we want PCP v5.2.3+
@@ -170,7 +170,7 @@ jobs:
170170
- name: Bootstrap
171171
run: ./autogen.sh
172172
- name: Configure
173-
run: scan-build-22 -analyze-headers --status-bugs ./configure --enable-debug --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
173+
run: scan-build-22 -analyze-headers --status-bugs ./configure --enable-debug --enable-werror --enable-unicode --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
174174
- name: Build
175175
run: scan-build-22 -analyze-headers --status-bugs make -j"$(nproc)"
176176

@@ -200,7 +200,7 @@ jobs:
200200
- name: Bootstrap
201201
run: ./autogen.sh
202202
- name: Configure
203-
run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
203+
run: ./configure --enable-werror --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities --enable-backtrace --enable-demangling || ( cat config.log; exit 1; )
204204
- name: Build
205205
run: make -k
206206
- name: Run sanitized htop (1)

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ coverage:
525525
$(MAKE) all AM_CPPFLAGS="-fprofile-arcs -ftest-coverage" AM_LDFLAGS="-lgcov"
526526

527527
cppcheck:
528-
cppcheck -q -v . --enable=all -DHAVE_OPENVZ
528+
cppcheck -q -v . --enable=all
529529

530530
dist-hook: $(top_distdir)/configure
531531
@if test "x$$FORCE_MAKE_DIST" != x || \

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,6 @@ To install on the local system run `make install`. By default `make install` ins
158158
* `--with-proc`:
159159
location of a Linux-compatible proc filesystem
160160
- default: */proc*
161-
* `--enable-openvz`:
162-
enable OpenVZ support
163-
- default: *no*
164-
* `--enable-vserver`:
165-
enable VServer support
166-
- default: *no*
167-
* `--enable-ancient-vserver`:
168-
enable ancient VServer support (implies `--enable-vserver`)
169-
- default: *no*
170161
* `--enable-delayacct`:
171162
enable Linux delay accounting support
172163
- dependencies: *libnl-3-dev*(build-time) and *libnl-genl-3-dev*(build-time), at runtime *libnl-3* and *libnl-genl-3* are loaded via `dlopen(3)` if available and requested

configure.ac

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,52 +1509,6 @@ fi
15091509
AC_DEFINE_UNQUOTED([PROCDIR], ["$with_proc"], [Path of proc filesystem.])
15101510

15111511

1512-
AC_ARG_ENABLE(
1513-
[openvz],
1514-
[AS_HELP_STRING(
1515-
[--enable-openvz],
1516-
[enable OpenVZ support @<:@default=no@:>@]
1517-
)],
1518-
[],
1519-
[enable_openvz=no]
1520-
)
1521-
if test "x$enable_openvz" = xyes; then
1522-
AC_DEFINE([HAVE_OPENVZ], [1], [Define if openvz support enabled.])
1523-
fi
1524-
1525-
1526-
AC_ARG_ENABLE(
1527-
[vserver],
1528-
[AS_HELP_STRING(
1529-
[--enable-vserver],
1530-
[enable VServer support @<:@default=no@:>@]
1531-
)],
1532-
[],
1533-
[enable_vserver=no]
1534-
)
1535-
if test "x$enable_vserver" = xyes; then
1536-
AC_DEFINE([HAVE_VSERVER], [1], [Define if VServer support enabled.])
1537-
fi
1538-
1539-
1540-
AC_ARG_ENABLE(
1541-
[ancient_vserver],
1542-
[AS_HELP_STRING(
1543-
[--enable-ancient-vserver],
1544-
[enable ancient VServer support (implies --enable-vserver) @<:@default=no@:>@]
1545-
)],
1546-
[],
1547-
[enable_ancient_vserver=no]
1548-
)
1549-
if test "x$enable_ancient_vserver" = xyes; then
1550-
if test "x$enable_vserver" != xyes; then
1551-
enable_vserver=implied
1552-
fi
1553-
AC_DEFINE([HAVE_VSERVER], [1], [Define if VServer support enabled.])
1554-
AC_DEFINE([HAVE_ANCIENT_VSERVER], [1], [Define if ancient vserver support enabled.])
1555-
fi
1556-
1557-
15581512
AC_ARG_ENABLE(
15591513
[capabilities],
15601514
[AS_HELP_STRING(
@@ -1867,9 +1821,6 @@ AC_MSG_RESULT([
18671821
18681822
platform: $my_htop_platform ($host_os)
18691823
(Linux) proc directory: $with_proc
1870-
(Linux) openvz: $enable_openvz
1871-
(Linux) vserver: $enable_vserver
1872-
(Linux) ancient vserver: $enable_ancient_vserver
18731824
(Linux) delay accounting: $enable_delayacct
18741825
(Linux) sensors: $enable_sensors
18751826
(Linux) capabilities: $enable_capabilities

htop.1.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -527,15 +527,6 @@ The number of Light-Weight Processes (=threads) in the process.
527527
.B TGID
528528
The thread group ID.
529529
.TP
530-
.B CTID
531-
OpenVZ container ID, a.k.a virtual environment ID.
532-
.TP
533-
.B VPID
534-
OpenVZ process ID.
535-
.TP
536-
.B VXID
537-
VServer process ID.
538-
.TP
539530
.B RCHAR (RD_CHAR)
540531
The number of bytes the process has read.
541532
.TP

linux/LinuxProcess.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
7070
[TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, },
7171
[NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, .defaultSortDesc = true, },
7272
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
73-
#ifdef HAVE_OPENVZ
74-
[CTID] = { .name = "CTID", .title = " CTID ", .description = "OpenVZ container ID (a.k.a. virtual environment ID)", .flags = PROCESS_FLAG_LINUX_OPENVZ, },
75-
[VPID] = { .name = "VPID", .title = "VPID", .description = "OpenVZ process ID", .flags = PROCESS_FLAG_LINUX_OPENVZ, .pidColumn = true, },
76-
#endif
77-
#ifdef HAVE_VSERVER
78-
[VXID] = { .name = "VXID", .title = " VXID ", .description = "VServer process ID", .flags = PROCESS_FLAG_LINUX_VSERVER, },
79-
#endif
8073
[RCHAR] = { .name = "RCHAR", .title = "RCHAR ", .description = "Number of bytes the process has read", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, },
8174
[WCHAR] = { .name = "WCHAR", .title = "WCHAR ", .description = "Number of bytes the process has written", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, },
8275
[SYSCR] = { .name = "SYSCR", .title = " READ_SYSC ", .description = "Number of read(2) syscalls for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, },
@@ -128,9 +121,6 @@ void Process_delete(Object* cast) {
128121
free(this->container_short);
129122
free(this->cgroup_short);
130123
free(this->cgroup);
131-
#ifdef HAVE_OPENVZ
132-
free(this->ctid);
133-
#endif
134124
free(this->secattr);
135125
free(this);
136126
}
@@ -278,13 +268,6 @@ static void LinuxProcess_rowWriteField(const Row* super, RichString* str, Proces
278268
case IO_READ_RATE: Row_printRate(str, lp->io_rate_read_bps, coloring); return;
279269
case IO_WRITE_RATE: Row_printRate(str, lp->io_rate_write_bps, coloring); return;
280270
case IO_RATE: Row_printRate(str, LinuxProcess_totalIORate(lp), coloring); return;
281-
#ifdef HAVE_OPENVZ
282-
case CTID: xSnprintf(buffer, n, "%-8s ", lp->ctid ? lp->ctid : ""); break;
283-
case VPID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, lp->vpid); break;
284-
#endif
285-
#ifdef HAVE_VSERVER
286-
case VXID: xSnprintf(buffer, n, "%5u ", lp->vxid); break;
287-
#endif
288271
case CGROUP:
289272
xSnprintf(buffer, n, "%-*.*s ", Row_fieldWidths[CGROUP], Row_fieldWidths[CGROUP], lp->cgroup ? lp->cgroup : "N/A");
290273
RichString_appendWide(str, attr, buffer);
@@ -427,16 +410,6 @@ static int LinuxProcess_compareByKey(const Process* v1, const Process* v2, Proce
427410
return compareRealNumbers(p1->io_rate_write_bps, p2->io_rate_write_bps);
428411
case IO_RATE:
429412
return compareRealNumbers(LinuxProcess_totalIORate(p1), LinuxProcess_totalIORate(p2));
430-
#ifdef HAVE_OPENVZ
431-
case CTID:
432-
return SPACESHIP_NULLSTR(p1->ctid, p2->ctid);
433-
case VPID:
434-
return SPACESHIP_NUMBER(p1->vpid, p2->vpid);
435-
#endif
436-
#ifdef HAVE_VSERVER
437-
case VXID:
438-
return SPACESHIP_NUMBER(p1->vxid, p2->vxid);
439-
#endif
440413
case CGROUP:
441414
return SPACESHIP_NULLSTR(p1->cgroup, p2->cgroup);
442415
case CCGROUP:

linux/LinuxProcess.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ in the source distribution for its full text.
1919

2020

2121
#define PROCESS_FLAG_LINUX_IOPRIO 0x00000100
22-
#define PROCESS_FLAG_LINUX_OPENVZ 0x00000200
23-
#define PROCESS_FLAG_LINUX_VSERVER 0x00000400
2422
#define PROCESS_FLAG_LINUX_CGROUP 0x00000800
2523
#define PROCESS_FLAG_LINUX_OOM 0x00001000
2624
#define PROCESS_FLAG_LINUX_SMAPS 0x00002000
@@ -83,13 +81,6 @@ typedef struct LinuxProcess_ {
8381
/* Storage data written (in bytes per second) */
8482
double io_rate_write_bps;
8583

86-
#ifdef HAVE_OPENVZ
87-
char* ctid;
88-
pid_t vpid;
89-
#endif
90-
#ifdef HAVE_VSERVER
91-
unsigned int vxid;
92-
#endif
9384
char* cgroup;
9485
char* cgroup_short;
9586
char* container_short;

linux/LinuxProcessTable.c

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,6 @@ static bool LinuxProcessTable_readStatusFile(Process* process, openat_arg_t proc
551551

552552
unsigned long ctxt = 0;
553553
process->isRunningInContainer = TRI_OFF;
554-
#ifdef HAVE_VSERVER
555-
lp->vxid = 0;
556-
#endif
557554

558555
FILE* statusfile = fopenat(procFd, "status", "r");
559556
if (!statusfile)
@@ -594,23 +591,6 @@ static bool LinuxProcessTable_readStatusFile(Process* process, openat_arg_t proc
594591
if (ok == 1) {
595592
ctxt += nvctxt;
596593
}
597-
598-
#ifdef HAVE_VSERVER
599-
} else if (String_startsWith(buffer, "VxID:")) {
600-
int vxid;
601-
int ok = sscanf(buffer, "VxID:\t%32d", &vxid);
602-
if (ok == 1) {
603-
lp->vxid = vxid;
604-
}
605-
#ifdef HAVE_ANCIENT_VSERVER
606-
} else if (String_startsWith(buffer, "s_context:")) {
607-
int vxid;
608-
int ok = sscanf(buffer, "s_context:\t%32d", &vxid);
609-
if (ok == 1) {
610-
lp->vxid = vxid;
611-
}
612-
#endif /* HAVE_ANCIENT_VSERVER */
613-
#endif /* HAVE_VSERVER */
614594
}
615595
}
616596

@@ -929,95 +909,6 @@ static bool LinuxProcessTable_readSmapsFile(LinuxProcess* process, openat_arg_t
929909
return true;
930910
}
931911

932-
#ifdef HAVE_OPENVZ
933-
934-
static void LinuxProcessTable_readOpenVZData(LinuxProcess* process, openat_arg_t procFd) {
935-
if (access(PROCDIR "/vz", R_OK) != 0) {
936-
free(process->ctid);
937-
process->ctid = NULL;
938-
process->vpid = Process_getPid(&process->super);
939-
return;
940-
}
941-
942-
FILE* file = fopenat(procFd, "status", "r");
943-
if (!file) {
944-
free(process->ctid);
945-
process->ctid = NULL;
946-
process->vpid = Process_getPid(&process->super);
947-
return;
948-
}
949-
950-
bool foundEnvID = false;
951-
bool foundVPid = false;
952-
char linebuf[256];
953-
while (fgets(linebuf, sizeof(linebuf), file) != NULL) {
954-
if (strchr(linebuf, '\n') == NULL) {
955-
// Partial line, skip to end of this line
956-
if (!skipEndOfLine(file)) {
957-
break;
958-
}
959-
}
960-
961-
char* name_value_sep = strchr(linebuf, ':');
962-
if (name_value_sep == NULL) {
963-
continue;
964-
}
965-
966-
int field;
967-
if (0 == strncasecmp(linebuf, "envID", name_value_sep - linebuf)) {
968-
field = 1;
969-
} else if (0 == strncasecmp(linebuf, "VPid", name_value_sep - linebuf)) {
970-
field = 2;
971-
} else {
972-
continue;
973-
}
974-
975-
do {
976-
name_value_sep++;
977-
} while (*name_value_sep != '\0' && *name_value_sep <= 32);
978-
979-
char* value_end = name_value_sep;
980-
981-
while (*value_end > 32) {
982-
value_end++;
983-
}
984-
985-
if (name_value_sep == value_end) {
986-
continue;
987-
}
988-
989-
*value_end = '\0';
990-
991-
switch (field) {
992-
case 1:
993-
foundEnvID = true;
994-
if (!String_eq(name_value_sep, process->ctid ? process->ctid : ""))
995-
free_and_xStrdup(&process->ctid, name_value_sep);
996-
break;
997-
case 2:
998-
if ((process->vpid = strtopid(name_value_sep)) != 0)
999-
foundVPid = true;
1000-
break;
1001-
default:
1002-
//Sanity Check: Should never reach here, or the implementation is missing something!
1003-
assert(false && "OpenVZ handling: Unimplemented case for field handling reached.");
1004-
}
1005-
}
1006-
1007-
fclose(file);
1008-
1009-
if (!foundEnvID) {
1010-
free(process->ctid);
1011-
process->ctid = NULL;
1012-
}
1013-
1014-
if (!foundVPid) {
1015-
process->vpid = Process_getPid(&process->super);
1016-
}
1017-
}
1018-
1019-
#endif /* HAVE_OPENVZ */
1020-
1021912
/*
1022913
* Read /proc/<pid>/cgroup (thread-specific data)
1023914
*/
@@ -1769,9 +1660,6 @@ static bool LinuxProcessTable_recurseProcTree(LinuxProcessTable* this, openat_ar
17691660

17701661
if (ss->flags & PROCESS_FLAG_LINUX_CTXT
17711662
|| ((hideRunningInContainer || ss->flags & PROCESS_FLAG_LINUX_CONTAINER) && proc->isRunningInContainer == TRI_INITIAL)
1772-
#ifdef HAVE_VSERVER
1773-
|| ss->flags & PROCESS_FLAG_LINUX_VSERVER
1774-
#endif
17751663
) {
17761664
proc->isRunningInContainer = TRI_OFF;
17771665
if (!LinuxProcessTable_readStatusFile(proc, procFd))
@@ -1780,12 +1668,6 @@ static bool LinuxProcessTable_recurseProcTree(LinuxProcessTable* this, openat_ar
17801668

17811669
if (!preExisting) {
17821670

1783-
#ifdef HAVE_OPENVZ
1784-
if (ss->flags & PROCESS_FLAG_LINUX_OPENVZ) {
1785-
LinuxProcessTable_readOpenVZData(lp, procFd);
1786-
}
1787-
#endif
1788-
17891671
if (proc->isKernelThread) {
17901672
Process_updateCmdline(proc, NULL, 0, 0);
17911673
} else {

0 commit comments

Comments
 (0)