Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

vzlist: show swappages

vzlist was using /proc/user_beancounters interface to read BC values.
swappages is not there, so we need to switch to new (/proc/bc/resources)
file, with an old one as a failover.

http://bugzilla.openvz.org/1984

Reported-by: Slava Dubrovskiy <dubrsl@altlinux.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
  • Loading branch information...
commit 8b490bfeac05b03510d899667356331265af26c4 1 parent f4ba1b2
Kirill Kolyshkin kolyshkin authored
Showing with 7 additions and 3 deletions.
  1. +1 −0  include/ub.h
  2. +6 −3 src/vzlist.c
1  include/ub.h
View
@@ -21,6 +21,7 @@
#include "types.h"
#define PROCUBC "/proc/user_beancounters"
+#define PROC_BC_RES "/proc/bc/resources"
#ifndef UB_KMEMSIZE
#define UB_KMEMSIZE 0 /* Unswappable kernel memory size including
9 src/vzlist.c
View
@@ -982,10 +982,13 @@ static int get_ub()
char *s;
struct Cveinfo ve;
- if ((fp = fopen(PROCUBC, "r")) == NULL) {
- fprintf(stderr, "Unable to open %s\n", PROCUBC);
- return 1;
+ if ((fp = fopen(PROC_BC_RES, "r")) == NULL) {
+ if ((fp = fopen(PROCUBC, "r")) == NULL) {
+ fprintf(stderr, "Unable to open %s\n", PROCUBC);
+ return 1;
+ }
}
+
veid = 0;
memset(&ve, 0, sizeof(struct Cveinfo));
while (!feof(fp)) {
Please sign in to comment.
Something went wrong with that request. Please try again.