[CRIU] [RFC PATCHv2 17/32] zdtm: tests: make all command-line arguments variables static
Ivan Shapovalov
intelfx at intelfx.name
Sat Mar 12 00:42:16 PST 2016
With Arch's toolchain, having a non-static global variable "dirname" causes
subtle breakage: address of such "dirname", as taken by .value initializer
inside TEST_OPTION(), is different from the address of "dirname" as taken
from inside the main() function.
This is probably related to existence of dirname() library function.
While at it, just make all such variables static which is anyway correct.
Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
---
test/zdtm/static/bind-mount.c | 2 +-
test/zdtm/static/binfmt_misc.c | 2 +-
test/zdtm/static/cgroup00.c | 2 +-
test/zdtm/static/cgroup01.c | 2 +-
test/zdtm/static/cgroup02.c | 2 +-
test/zdtm/static/cgroup03.c | 2 +-
test/zdtm/static/cgroup_stray.c | 2 +-
test/zdtm/static/cgroupns.c | 2 +-
test/zdtm/static/chroot-file.c | 4 ++--
test/zdtm/static/chroot.c | 4 ++--
test/zdtm/static/console.c | 2 +-
test/zdtm/static/cow01.c | 2 +-
test/zdtm/static/cwd00.c | 2 +-
test/zdtm/static/cwd01.c | 2 +-
test/zdtm/static/cwd02.c | 2 +-
test/zdtm/static/deleted_dev.c | 2 +-
test/zdtm/static/deleted_unix_sock.c | 2 +-
test/zdtm/static/env00.c | 2 +-
test/zdtm/static/fdt_shared.c | 2 +-
test/zdtm/static/fifo-ghost.c | 2 +-
test/zdtm/static/fifo-rowo-pair.c | 4 ++--
test/zdtm/static/fifo.c | 2 +-
test/zdtm/static/fifo_ro.c | 2 +-
test/zdtm/static/fifo_wronly.c | 2 +-
test/zdtm/static/file_append.c | 2 +-
test/zdtm/static/file_attr.c | 6 +++---
test/zdtm/static/file_locks00.c | 2 +-
test/zdtm/static/file_locks01.c | 2 +-
test/zdtm/static/file_locks02.c | 2 +-
test/zdtm/static/file_locks03.c | 2 +-
test/zdtm/static/file_locks04.c | 2 +-
test/zdtm/static/file_locks05.c | 2 +-
test/zdtm/static/file_shared.c | 2 +-
test/zdtm/static/futex.c | 2 +-
test/zdtm/static/inotify00.c | 2 +-
test/zdtm/static/inotify02.c | 2 +-
test/zdtm/static/jobctl00.c | 4 ++--
test/zdtm/static/link10.c | 2 +-
test/zdtm/static/maps00.c | 2 +-
test/zdtm/static/maps_file_prot.c | 2 +-
test/zdtm/static/mnt_ext_auto.c | 2 +-
test/zdtm/static/mnt_ext_master.c | 2 +-
test/zdtm/static/mnt_ro_bind.c | 2 +-
test/zdtm/static/mntns_deleted.c | 2 +-
test/zdtm/static/mntns_link_remap.c | 2 +-
test/zdtm/static/mntns_open.c | 2 +-
test/zdtm/static/mntns_root_bind.c | 2 +-
test/zdtm/static/mntns_shared_bind.c | 2 +-
test/zdtm/static/mntns_shared_vs_private.c | 2 +-
test/zdtm/static/mount_paths.c | 2 +-
test/zdtm/static/mtime_mmap.c | 2 +-
test/zdtm/static/netns-nf.c | 2 +-
test/zdtm/static/overmount_dev.c | 2 +-
test/zdtm/static/overmount_fifo.c | 2 +-
test/zdtm/static/overmount_file.c | 2 +-
test/zdtm/static/overmount_sock.c | 2 +-
test/zdtm/static/rmdir_open.c | 2 +-
test/zdtm/static/shm.c | 2 +-
test/zdtm/static/sk-unix-rel.c | 2 +-
test/zdtm/static/socket_close_data01.c | 2 +-
test/zdtm/static/sockets00.c | 2 +-
test/zdtm/static/sockets_dgram.c | 2 +-
test/zdtm/static/tempfs.c | 2 +-
test/zdtm/static/tempfs_ro.c | 2 +-
test/zdtm/static/tempfs_subns.c | 2 +-
test/zdtm/static/umask00.c | 2 +-
test/zdtm/static/unlink_fifo.c | 2 +-
test/zdtm/static/unlink_fifo_wronly.c | 2 +-
test/zdtm/static/unlink_fstat00.c | 2 +-
test/zdtm/static/unlink_fstat01.c | 2 +-
test/zdtm/static/unlink_fstat02.c | 2 +-
test/zdtm/static/unlink_fstat03.c | 2 +-
test/zdtm/static/unlink_largefile.c | 2 +-
test/zdtm/static/unlink_mmap00.c | 2 +-
test/zdtm/static/unlink_mmap01.c | 2 +-
test/zdtm/static/unlink_mmap02.c | 2 +-
test/zdtm/static/unlink_regular00.c | 2 +-
test/zdtm/static/vt.c | 2 +-
test/zdtm/static/write_read00.c | 2 +-
test/zdtm/static/write_read01.c | 2 +-
test/zdtm/static/write_read02.c | 2 +-
test/zdtm/static/write_read10.c | 2 +-
test/zdtm/transition/epoll.c | 2 +-
test/zdtm/transition/fifo_dyn.c | 2 +-
test/zdtm/transition/fifo_loop.c | 4 ++--
test/zdtm/transition/file_read.c | 4 ++--
test/zdtm/transition/ipc.c | 2 +-
test/zdtm/transition/pipe_loop00.c | 2 +-
test/zdtm/transition/pipe_shared00.c | 2 +-
test/zdtm/transition/ptrace.c | 2 +-
test/zdtm/transition/socket_loop00.c | 2 +-
test/zdtm/transition/unix_sock.c | 4 ++--
92 files changed, 101 insertions(+), 101 deletions(-)
diff --git a/test/zdtm/static/bind-mount.c b/test/zdtm/static/bind-mount.c
index 06c5cf1..7e07219 100644
--- a/test/zdtm/static/bind-mount.c
+++ b/test/zdtm/static/bind-mount.c
@@ -11,7 +11,7 @@
const char *test_doc = "Check bind-mounts";
const char *test_author = "Pavel Emelianov <avagin at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/binfmt_misc.c b/test/zdtm/static/binfmt_misc.c
index 9d7394c..89a8367 100644
--- a/test/zdtm/static/binfmt_misc.c
+++ b/test/zdtm/static/binfmt_misc.c
@@ -17,7 +17,7 @@ const char *test_author = "Kirill Tkhai <ktkhai at odin.com";
#define MAX_MAGIC_OFFSET 128 /* Max magic+offset */
#define MAX_EXTENSION 128
-char *dirname = "binfmt_misc.dir";
+static char *dirname = "binfmt_misc.dir";
TEST_OPTION(dirname, string, "binfmt_misc mount directory name", 1);
const char *NAME[2] = { "magic_file", "extension_file" };
diff --git a/test/zdtm/static/cgroup00.c b/test/zdtm/static/cgroup00.c
index ee14d1f..c36c532 100644
--- a/test/zdtm/static/cgroup00.c
+++ b/test/zdtm/static/cgroup00.c
@@ -10,7 +10,7 @@
const char *test_doc = "Check that cgroups layout is preserved";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "cgroup directory name", 1);
static const char *cgname = "zdtmtst";
#define SUBNAME "subcg00"
diff --git a/test/zdtm/static/cgroup01.c b/test/zdtm/static/cgroup01.c
index 384f860..0693abf 100644
--- a/test/zdtm/static/cgroup01.c
+++ b/test/zdtm/static/cgroup01.c
@@ -9,7 +9,7 @@
const char *test_doc = "Check that empty cgroups are preserved";
const char *test_author = "Tycho Andersen <tycho.andersen at canonical.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "cgroup directory name", 1);
static const char *cgname = "zdtmtst";
static const char *subname = "subcg01";
diff --git a/test/zdtm/static/cgroup02.c b/test/zdtm/static/cgroup02.c
index d892b2f..5def210 100644
--- a/test/zdtm/static/cgroup02.c
+++ b/test/zdtm/static/cgroup02.c
@@ -11,7 +11,7 @@
const char *test_doc = "Check that empty cgroups are preserved";
const char *test_author = "Tycho Andersen <tycho.andersen at canonical.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "cgroup directory name", 1);
static const char *cgname = "zdtmtst";
static const char *subname = "oldroot";
diff --git a/test/zdtm/static/cgroup03.c b/test/zdtm/static/cgroup03.c
index c6c4938..efccf21 100644
--- a/test/zdtm/static/cgroup03.c
+++ b/test/zdtm/static/cgroup03.c
@@ -12,7 +12,7 @@
const char *test_doc = "Check that global cgroup settings (+perms) are restored";
const char *test_author = "Tycho Andersen <tycho.andersen at canonical.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "cgroup directory name", 1);
static const char *cgname = "zdtmtst";
diff --git a/test/zdtm/static/cgroup_stray.c b/test/zdtm/static/cgroup_stray.c
index 204ffb7..d27f5a8 100644
--- a/test/zdtm/static/cgroup_stray.c
+++ b/test/zdtm/static/cgroup_stray.c
@@ -17,7 +17,7 @@
const char *test_doc = "Check that stray cgroups are c/r'd correctly";
const char *test_author = "Tycho Andersen <tycho.andersen at canonical.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "cgroup directory name", 1);
static const char *cgname = "zdtmtst";
diff --git a/test/zdtm/static/cgroupns.c b/test/zdtm/static/cgroupns.c
index 955ab72..29d26d4 100644
--- a/test/zdtm/static/cgroupns.c
+++ b/test/zdtm/static/cgroupns.c
@@ -22,7 +22,7 @@ const char *test_doc = "Check that cgroup NS is correctly handled.";
const char *test_author = "Tycho Andersen <tycho.andersen at canonical.com>";
/* we need dirname before test_init() here */
-char *dirname = "cgroupns.test";
+static char *dirname = "cgroupns.test";
static const char *cgname = "zdtmtst";
int mount_and_add(const char *controller, const char *path)
diff --git a/test/zdtm/static/chroot-file.c b/test/zdtm/static/chroot-file.c
index 94f5842..08f7982 100644
--- a/test/zdtm/static/chroot-file.c
+++ b/test/zdtm/static/chroot-file.c
@@ -11,9 +11,9 @@
const char *test_doc = "Check that out-of-root file survives";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define MSG "out-file-contents"
diff --git a/test/zdtm/static/chroot.c b/test/zdtm/static/chroot.c
index 39b1ace..4e25bb8 100644
--- a/test/zdtm/static/chroot.c
+++ b/test/zdtm/static/chroot.c
@@ -11,9 +11,9 @@
const char *test_doc = "Check that root didn't change";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static char *filepath;
diff --git a/test/zdtm/static/console.c b/test/zdtm/static/console.c
index a86b146..5fef5f2 100644
--- a/test/zdtm/static/console.c
+++ b/test/zdtm/static/console.c
@@ -14,7 +14,7 @@
const char *test_doc = "Check c/r for console device";
const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/cow01.c b/test/zdtm/static/cow01.c
index 895dd90..cc09d51 100644
--- a/test/zdtm/static/cow01.c
+++ b/test/zdtm/static/cow01.c
@@ -15,7 +15,7 @@
const char *test_doc = "Check that cow memory are restored";
const char *test_author = "Andrey Vagin <avagin at parallels.com";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
struct test_case {
diff --git a/test/zdtm/static/cwd00.c b/test/zdtm/static/cwd00.c
index b0736f5..4e8d23f 100644
--- a/test/zdtm/static/cwd00.c
+++ b/test/zdtm/static/cwd00.c
@@ -11,7 +11,7 @@
const char *test_doc = "Check that cwd didn't change";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/cwd01.c b/test/zdtm/static/cwd01.c
index 4e10a6b..2dcb874 100644
--- a/test/zdtm/static/cwd01.c
+++ b/test/zdtm/static/cwd01.c
@@ -14,7 +14,7 @@
const char *test_doc = "Check that removed cwd works";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/cwd02.c b/test/zdtm/static/cwd02.c
index 1237445..17b0d7d 100644
--- a/test/zdtm/static/cwd02.c
+++ b/test/zdtm/static/cwd02.c
@@ -11,7 +11,7 @@
const char *test_doc = "Check that removed and opened cwd are kept";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/deleted_dev.c b/test/zdtm/static/deleted_dev.c
index e855aed..1ebe4f3 100644
--- a/test/zdtm/static/deleted_dev.c
+++ b/test/zdtm/static/deleted_dev.c
@@ -11,7 +11,7 @@ const char *test_doc = "Check that we can migrate with a device special file "
"open and unlinked before migration";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/deleted_unix_sock.c b/test/zdtm/static/deleted_unix_sock.c
index 3562e26..8906ff3 100644
--- a/test/zdtm/static/deleted_unix_sock.c
+++ b/test/zdtm/static/deleted_unix_sock.c
@@ -15,7 +15,7 @@ const char *test_doc = "Create a unix socket, and destroy it before "
"and the parent can read from it after migration";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static int fill_sock_name(struct sockaddr_un *name, const char *filename)
diff --git a/test/zdtm/static/env00.c b/test/zdtm/static/env00.c
index 1feabfa..385b660 100644
--- a/test/zdtm/static/env00.c
+++ b/test/zdtm/static/env00.c
@@ -7,7 +7,7 @@
const char *test_doc = "Check that environment didn't change";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *envname;
+static char *envname;
TEST_OPTION(envname, string, "environment variable name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/fdt_shared.c b/test/zdtm/static/fdt_shared.c
index 908f6bc..98b4960 100644
--- a/test/zdtm/static/fdt_shared.c
+++ b/test/zdtm/static/fdt_shared.c
@@ -13,7 +13,7 @@
const char *test_doc = "Check a shared file descriptor table.";
const char *test_author = "Andrew Vagin <avagin at openvz.org>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define STACK_SIZE 4096
diff --git a/test/zdtm/static/fifo-ghost.c b/test/zdtm/static/fifo-ghost.c
index 94a8c57..f2f79b5 100644
--- a/test/zdtm/static/fifo-ghost.c
+++ b/test/zdtm/static/fifo-ghost.c
@@ -10,7 +10,7 @@
const char *test_doc = "Check that a ghost fifo with data restored";
const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/fifo-rowo-pair.c b/test/zdtm/static/fifo-rowo-pair.c
index b967147..c0cafa2 100644
--- a/test/zdtm/static/fifo-rowo-pair.c
+++ b/test/zdtm/static/fifo-rowo-pair.c
@@ -20,10 +20,10 @@ const char *test_doc = "Test for fifo ro/wo with "
"fake fifo needed on criu side";
const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org>";
-char *name_master;
+static char *name_master;
TEST_OPTION(name_master, string, "master fifo name", 1);
-char *name_slave;
+static char *name_slave;
TEST_OPTION(name_slave, string, "slave fifo name", 1);
#define TEST_VALUE (00100)
diff --git a/test/zdtm/static/fifo.c b/test/zdtm/static/fifo.c
index c8437d9..8ed818c 100644
--- a/test/zdtm/static/fifo.c
+++ b/test/zdtm/static/fifo.c
@@ -11,7 +11,7 @@ const char *test_doc = "Check that we can migrate with a named pipe "
"open";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define BUF_SIZE (16 * 4096) /* A fifo buffer has 16 slots by default */
diff --git a/test/zdtm/static/fifo_ro.c b/test/zdtm/static/fifo_ro.c
index 63c4d29..03dd981 100644
--- a/test/zdtm/static/fifo_ro.c
+++ b/test/zdtm/static/fifo_ro.c
@@ -10,7 +10,7 @@
const char *test_doc = "Check that a fifo read-only descriptor is restored with data";
const char *test_author = "Andrew Vagin <avagin at openvz.org>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define BUF_SIZE (16 * 4096) /* A fifo buffer has 16 slots by default */
diff --git a/test/zdtm/static/fifo_wronly.c b/test/zdtm/static/fifo_wronly.c
index 2fbd69e..32a9f46 100644
--- a/test/zdtm/static/fifo_wronly.c
+++ b/test/zdtm/static/fifo_wronly.c
@@ -13,7 +13,7 @@
const char *test_doc = "Check that we can migrate with a named pipe, "
"opened in WRONLY mode";
#define BUF_SIZE 256
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/file_append.c b/test/zdtm/static/file_append.c
index 14f1877..d704750 100644
--- a/test/zdtm/static/file_append.c
+++ b/test/zdtm/static/file_append.c
@@ -12,7 +12,7 @@
const char *test_doc = "Check O_APPEND preserved";
const char *test_author = "Pavel Emelyanov <xemul at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/file_attr.c b/test/zdtm/static/file_attr.c
index 80ad789..57dde36 100644
--- a/test/zdtm/static/file_attr.c
+++ b/test/zdtm/static/file_attr.c
@@ -14,14 +14,14 @@ const char *test_doc = "Check that attributes and content of an open, "
"correctly";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define DEF_PERMS 06604 /* -rwS--Sr--, really esoteric one */
-unsigned int perms = DEF_PERMS;
+static unsigned int perms = DEF_PERMS;
TEST_OPTION(perms, uint, "permissions to set on file "
"(default " __stringify(DEF_PERMS) ")", 0);
#define DEF_MTIME 123456 /* another really esoteric one */
-unsigned int mtime = DEF_MTIME;
+static unsigned int mtime = DEF_MTIME;
TEST_OPTION(mtime, uint, "mtime to set on file "
"(default " __stringify(DEF_MTIME) ")", 0);
diff --git a/test/zdtm/static/file_locks00.c b/test/zdtm/static/file_locks00.c
index f701e00..f3ea60f 100644
--- a/test/zdtm/static/file_locks00.c
+++ b/test/zdtm/static/file_locks00.c
@@ -15,7 +15,7 @@
const char *test_doc = "Check that posix flocks are restored";
const char *test_author = "Qiang Huang <h.huangqiang at huawei.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
char file0[PATH_MAX];
diff --git a/test/zdtm/static/file_locks01.c b/test/zdtm/static/file_locks01.c
index 24f54ac..d8d6d43 100644
--- a/test/zdtm/static/file_locks01.c
+++ b/test/zdtm/static/file_locks01.c
@@ -15,7 +15,7 @@
const char *test_doc = "Check that flock locks are restored";
const char *test_author = "Qiang Huang <h.huangqiang at huawei.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
char file0[PATH_MAX];
diff --git a/test/zdtm/static/file_locks02.c b/test/zdtm/static/file_locks02.c
index 2db3bd0..99742dd 100644
--- a/test/zdtm/static/file_locks02.c
+++ b/test/zdtm/static/file_locks02.c
@@ -13,7 +13,7 @@
const char *test_doc = "Check that 'shared' flocks work";
const char *test_author = "Pavel Emelyanov <xemul at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static int check_file_locks(pid_t child)
diff --git a/test/zdtm/static/file_locks03.c b/test/zdtm/static/file_locks03.c
index 167fd2e..a909d89 100644
--- a/test/zdtm/static/file_locks03.c
+++ b/test/zdtm/static/file_locks03.c
@@ -13,7 +13,7 @@
const char *test_doc = "Check that 'inherited' flocks work";
const char *test_author = "Pavel Emelyanov <xemul at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static int check_file_locks(int alt_pid)
diff --git a/test/zdtm/static/file_locks04.c b/test/zdtm/static/file_locks04.c
index 995dd09..7f1214d 100644
--- a/test/zdtm/static/file_locks04.c
+++ b/test/zdtm/static/file_locks04.c
@@ -13,7 +13,7 @@
const char *test_doc = "Check that 'overlapping' flocks work";
const char *test_author = "Pavel Emelyanov <xemul at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static int check_file_locks(int alt_pid, int fd)
diff --git a/test/zdtm/static/file_locks05.c b/test/zdtm/static/file_locks05.c
index f7d34b1..8c0395f 100644
--- a/test/zdtm/static/file_locks05.c
+++ b/test/zdtm/static/file_locks05.c
@@ -13,7 +13,7 @@
const char *test_doc = "Sanity check for criu lock-test quirk";
const char *test_author = "Pavel Emelyanov <xemul at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/file_shared.c b/test/zdtm/static/file_shared.c
index 8f1acb1..44017fa 100644
--- a/test/zdtm/static/file_shared.c
+++ b/test/zdtm/static/file_shared.c
@@ -13,7 +13,7 @@
const char *test_doc = "Check shared struct file-s";
const char *test_author = "Andrey Vagin <avagin at openvz.org>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/futex.c b/test/zdtm/static/futex.c
index 2ad82d2..a7b9bca 100644
--- a/test/zdtm/static/futex.c
+++ b/test/zdtm/static/futex.c
@@ -24,7 +24,7 @@ void *thread_fn(void *lock)
#define DEF_NUM_THREADS 10
#define MAX_NUM_THREADS 50
-int num_threads = DEF_NUM_THREADS;
+static int num_threads = DEF_NUM_THREADS;
TEST_OPTION(num_threads, int, "number of threads "
"(default " __stringify(DEF_NUM_THREADS)
" maximum " __stringify(MAX_NUM_THREADS) ")", 0);
diff --git a/test/zdtm/static/inotify00.c b/test/zdtm/static/inotify00.c
index 00190dc..ddc1d77 100644
--- a/test/zdtm/static/inotify00.c
+++ b/test/zdtm/static/inotify00.c
@@ -23,7 +23,7 @@
const char *test_doc = "Check for inotify delivery";
const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define TEST_FILE "inotify-removed"
diff --git a/test/zdtm/static/inotify02.c b/test/zdtm/static/inotify02.c
index eca36dd..330ab6b 100644
--- a/test/zdtm/static/inotify02.c
+++ b/test/zdtm/static/inotify02.c
@@ -24,7 +24,7 @@
const char *test_doc = "Check for inotify file-handles storm";
const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
static int num_of_handles(int fd)
diff --git a/test/zdtm/static/jobctl00.c b/test/zdtm/static/jobctl00.c
index 397747b..28164dd 100644
--- a/test/zdtm/static/jobctl00.c
+++ b/test/zdtm/static/jobctl00.c
@@ -14,13 +14,13 @@ const char *test_author = "Roman Kagan <rkagan at parallels.com>";
#define JOBS_DEF 8
#define JOBS_MAX 64
-unsigned int num_jobs = JOBS_DEF;
+static unsigned int num_jobs = JOBS_DEF;
TEST_OPTION(num_jobs, uint, "# \"jobs\" in a \"shell\" "
"(default " __stringify(JOBS_DEF)
", max " __stringify(JOBS_MAX) ")", 0);
#define PROCS_DEF 4
-unsigned int num_procs = PROCS_DEF;
+static unsigned int num_procs = PROCS_DEF;
TEST_OPTION(num_procs, uint, "# processes in a \"job\" "
"(default " __stringify(PROCS_DEF) ")", 0);
diff --git a/test/zdtm/static/link10.c b/test/zdtm/static/link10.c
index 9f4c7f0..919d604 100644
--- a/test/zdtm/static/link10.c
+++ b/test/zdtm/static/link10.c
@@ -12,7 +12,7 @@
const char *test_doc = "Migrate two hardlinked, open, and unlinked files";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/maps00.c b/test/zdtm/static/maps00.c
index aa3c29e..b2edd33 100644
--- a/test/zdtm/static/maps00.c
+++ b/test/zdtm/static/maps00.c
@@ -14,7 +14,7 @@ const char *test_doc = "Create all sorts of maps and compare /proc/pid/maps\n"
"before and after migration\n";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
const static int map_prots[] = {
diff --git a/test/zdtm/static/maps_file_prot.c b/test/zdtm/static/maps_file_prot.c
index 3b28c1f..186caa1 100644
--- a/test/zdtm/static/maps_file_prot.c
+++ b/test/zdtm/static/maps_file_prot.c
@@ -10,7 +10,7 @@
const char *test_doc = "Test mappings of same file with different prot";
const char *test_author = "Jamie Liu <jamieliu at google.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define die(fmt, arg...) do { pr_perror(fmt, ## arg); return 1; } while (0)
diff --git a/test/zdtm/static/mnt_ext_auto.c b/test/zdtm/static/mnt_ext_auto.c
index 4a931b9..c91baec 100644
--- a/test/zdtm/static/mnt_ext_auto.c
+++ b/test/zdtm/static/mnt_ext_auto.c
@@ -12,7 +12,7 @@
const char *test_doc = "Run busy loop while migrating";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *dirname = "mnt_ext_auto.test";
+static char *dirname = "mnt_ext_auto.test";
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/mnt_ext_master.c b/test/zdtm/static/mnt_ext_master.c
index 290868e..37f45d4 100644
--- a/test/zdtm/static/mnt_ext_master.c
+++ b/test/zdtm/static/mnt_ext_master.c
@@ -12,7 +12,7 @@
const char *test_doc = "Check that mounts with external master peers are c/r'd";
const char *test_author = "Tycho Andersen <tycho.andersen at canonical.com>";
-char *dirname = "mnt_ext_auto.test";
+static char *dirname = "mnt_ext_auto.test";
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/mnt_ro_bind.c b/test/zdtm/static/mnt_ro_bind.c
index 1d98814..5134c70 100644
--- a/test/zdtm/static/mnt_ro_bind.c
+++ b/test/zdtm/static/mnt_ro_bind.c
@@ -12,7 +12,7 @@
const char *test_doc = "Check read-only bind-mounts";
const char *test_author = "Andrew Vagin <avagin at openvz.org>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define TEST_WORD "testtest"
diff --git a/test/zdtm/static/mntns_deleted.c b/test/zdtm/static/mntns_deleted.c
index b38d834..827b5ce 100644
--- a/test/zdtm/static/mntns_deleted.c
+++ b/test/zdtm/static/mntns_deleted.c
@@ -23,7 +23,7 @@
const char *test_doc = "Check the restore of deleted bindmounts";
const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define TEST_DIR_SRC "test-src"
diff --git a/test/zdtm/static/mntns_link_remap.c b/test/zdtm/static/mntns_link_remap.c
index 210188b..1862f68 100644
--- a/test/zdtm/static/mntns_link_remap.c
+++ b/test/zdtm/static/mntns_link_remap.c
@@ -23,7 +23,7 @@ const char *test_doc = "Check ghost and link-remap files in a few mntns";
const char *test_author = "Andrew Vagin <avagin at parallels.com>";
#define MPTS_FILE "F"
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define NS_STACK_SIZE 4096
diff --git a/test/zdtm/static/mntns_open.c b/test/zdtm/static/mntns_open.c
index 629d762..64d0d81 100644
--- a/test/zdtm/static/mntns_open.c
+++ b/test/zdtm/static/mntns_open.c
@@ -22,7 +22,7 @@ const char *test_doc = "Check that mnt_id is repsected";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
#define MPTS_FILE "F"
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
char fpath[PATH_MAX];
diff --git a/test/zdtm/static/mntns_root_bind.c b/test/zdtm/static/mntns_root_bind.c
index 3bd0bec..234c14e 100644
--- a/test/zdtm/static/mntns_root_bind.c
+++ b/test/zdtm/static/mntns_root_bind.c
@@ -21,7 +21,7 @@
const char *test_doc = "Check bind-mouns of the root mount";
const char *test_author = "Andrew Vagin <avagin at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
diff --git a/test/zdtm/static/mntns_shared_bind.c b/test/zdtm/static/mntns_shared_bind.c
index f11b2df..8f039d4 100644
--- a/test/zdtm/static/mntns_shared_bind.c
+++ b/test/zdtm/static/mntns_shared_bind.c
@@ -21,7 +21,7 @@
const char *test_doc = "Check shared non-root bind-mounts";
const char *test_author = "Andrew Vagin <avagin at gmail.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
diff --git a/test/zdtm/static/mntns_shared_vs_private.c b/test/zdtm/static/mntns_shared_vs_private.c
index 204ac11..3fae6f2 100644
--- a/test/zdtm/static/mntns_shared_vs_private.c
+++ b/test/zdtm/static/mntns_shared_vs_private.c
@@ -21,7 +21,7 @@
const char *test_doc = "Check a private mount in a shared mount";
const char *test_author = "Andrew Vagin <avagin at gmail.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
diff --git a/test/zdtm/static/mount_paths.c b/test/zdtm/static/mount_paths.c
index a42b0eb..6b81704 100644
--- a/test/zdtm/static/mount_paths.c
+++ b/test/zdtm/static/mount_paths.c
@@ -11,7 +11,7 @@
const char *test_doc = "Check that special charecters in paths are handled correctly";
const char *test_author = "Andrew Vagin <avagin at virtuozzo.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define TEST_DIR "tmpfs \t \t\\\\\t test \t\t\\\\ \t\\"
diff --git a/test/zdtm/static/mtime_mmap.c b/test/zdtm/static/mtime_mmap.c
index 6c97487..49c40c2 100644
--- a/test/zdtm/static/mtime_mmap.c
+++ b/test/zdtm/static/mtime_mmap.c
@@ -14,7 +14,7 @@
const char *test_doc = "file mmaped for write and being written should change mtime\n"
"and be migrated with correct new data";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define FILE_SIZE (16 * 1024)
diff --git a/test/zdtm/static/netns-nf.c b/test/zdtm/static/netns-nf.c
index 393f0e7..3e133b7 100644
--- a/test/zdtm/static/netns-nf.c
+++ b/test/zdtm/static/netns-nf.c
@@ -8,7 +8,7 @@
const char *test_doc = "Check that netfilter rules (some) are kept";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/overmount_dev.c b/test/zdtm/static/overmount_dev.c
index b3dd4e0..853ff3a 100644
--- a/test/zdtm/static/overmount_dev.c
+++ b/test/zdtm/static/overmount_dev.c
@@ -12,7 +12,7 @@ const char *test_doc = "Check that we can migrate with a device special file "
"another filesystem";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/overmount_fifo.c b/test/zdtm/static/overmount_fifo.c
index 2de2a8a..c57c03e 100644
--- a/test/zdtm/static/overmount_fifo.c
+++ b/test/zdtm/static/overmount_fifo.c
@@ -12,7 +12,7 @@ const char *test_doc = "Check that we can migrate with a named pipe "
"another filesystem";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/overmount_file.c b/test/zdtm/static/overmount_file.c
index 5c370e0..3cc1dc4 100644
--- a/test/zdtm/static/overmount_file.c
+++ b/test/zdtm/static/overmount_file.c
@@ -12,7 +12,7 @@ const char *test_doc = "Check that we can't migrate with a file open in a "
"filesystem";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/overmount_sock.c b/test/zdtm/static/overmount_sock.c
index 94e4c7e..8d81841 100644
--- a/test/zdtm/static/overmount_sock.c
+++ b/test/zdtm/static/overmount_sock.c
@@ -15,7 +15,7 @@ const char *test_doc = "Check that we can migrate with a unix socket "
" another filesystem";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
static int fill_sock_name(struct sockaddr_un *name, const char *filename)
diff --git a/test/zdtm/static/rmdir_open.c b/test/zdtm/static/rmdir_open.c
index a4fb5b0..97b6272 100644
--- a/test/zdtm/static/rmdir_open.c
+++ b/test/zdtm/static/rmdir_open.c
@@ -10,7 +10,7 @@
const char *test_doc = "Check that opened removed dir works";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/shm.c b/test/zdtm/static/shm.c
index fc90a99..95049db 100644
--- a/test/zdtm/static/shm.c
+++ b/test/zdtm/static/shm.c
@@ -18,7 +18,7 @@ const char *test_doc="Tests detached shmems migrate fine";
const char *test_author="Stanislav Kinsbursky <skinsbursky at parallels.com>";
#define DEF_MEM_SIZE (40960)
-unsigned int shmem_size = DEF_MEM_SIZE;
+static unsigned int shmem_size = DEF_MEM_SIZE;
TEST_OPTION(shmem_size, uint, "Size of shared memory segment", 0);
#define INIT_CRC (~0)
diff --git a/test/zdtm/static/sk-unix-rel.c b/test/zdtm/static/sk-unix-rel.c
index d341ce9..578153d 100644
--- a/test/zdtm/static/sk-unix-rel.c
+++ b/test/zdtm/static/sk-unix-rel.c
@@ -22,7 +22,7 @@ const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org";
#define SK_DATA "packet"
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "socket file name", 1);
#define TEST_MODE 0640
diff --git a/test/zdtm/static/socket_close_data01.c b/test/zdtm/static/socket_close_data01.c
index 53b5f7a..5c46ac3 100644
--- a/test/zdtm/static/socket_close_data01.c
+++ b/test/zdtm/static/socket_close_data01.c
@@ -13,7 +13,7 @@ const char *test_doc = "Check data of bound socket and possibility to connect";
const char *test_author = "Kirill Tkhai <ktkhai at virtuozzo";
#define MSG "hello"
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static int client(const char *iter)
diff --git a/test/zdtm/static/sockets00.c b/test/zdtm/static/sockets00.c
index 9d00957..c3a6324 100644
--- a/test/zdtm/static/sockets00.c
+++ b/test/zdtm/static/sockets00.c
@@ -22,7 +22,7 @@ const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org";
#define SK_DATA "packet"
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "socket file name", 1);
#define TEST_MODE 0640
diff --git a/test/zdtm/static/sockets_dgram.c b/test/zdtm/static/sockets_dgram.c
index a34bb14..27aa731 100644
--- a/test/zdtm/static/sockets_dgram.c
+++ b/test/zdtm/static/sockets_dgram.c
@@ -22,7 +22,7 @@ const char *test_author = "Cyrill Gorcunov <gorcunov at openvz.org";
#define SK_DATA_CONN "data-packet-conn"
#define SK_DATA_BOUND_CONN "data-packet-bound-conn"
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "socket file name", 1);
int main(int argc, char *argv[])
diff --git a/test/zdtm/static/tempfs.c b/test/zdtm/static/tempfs.c
index 66c51a5..253a278 100644
--- a/test/zdtm/static/tempfs.c
+++ b/test/zdtm/static/tempfs.c
@@ -11,7 +11,7 @@
const char *test_doc = "Check tmpfs mount";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define TEST_WORD "testtest"
diff --git a/test/zdtm/static/tempfs_ro.c b/test/zdtm/static/tempfs_ro.c
index f30ae8d..b18ba32 100644
--- a/test/zdtm/static/tempfs_ro.c
+++ b/test/zdtm/static/tempfs_ro.c
@@ -11,7 +11,7 @@
const char *test_doc = "Check read-only tmpfs mount";
const char *test_author = "Andrew Vagin <avagin at openvz.org>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define TEST_WORD "testtest"
diff --git a/test/zdtm/static/tempfs_subns.c b/test/zdtm/static/tempfs_subns.c
index 413d0a1..eddf471 100644
--- a/test/zdtm/static/tempfs_subns.c
+++ b/test/zdtm/static/tempfs_subns.c
@@ -14,7 +14,7 @@
const char *test_doc = "Check tmpfs in a non-root mntns";
const char *test_author = "Andrew Vagin <avagin at virtuozzo.com";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/umask00.c b/test/zdtm/static/umask00.c
index 1157f0d..b922a2d 100644
--- a/test/zdtm/static/umask00.c
+++ b/test/zdtm/static/umask00.c
@@ -5,7 +5,7 @@
const char *test_doc = "Check that umask didn't change";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
-unsigned int mask;
+static unsigned int mask;
TEST_OPTION(mask, uint, "umask", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/unlink_fifo.c b/test/zdtm/static/unlink_fifo.c
index 765f5eb..9f9c924 100644
--- a/test/zdtm/static/unlink_fifo.c
+++ b/test/zdtm/static/unlink_fifo.c
@@ -11,7 +11,7 @@ const char *test_doc = "Check that we can migrate with a named pipe "
"open and then unlinked";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/unlink_fifo_wronly.c b/test/zdtm/static/unlink_fifo_wronly.c
index 5fb4c34..8dcbe4a 100644
--- a/test/zdtm/static/unlink_fifo_wronly.c
+++ b/test/zdtm/static/unlink_fifo_wronly.c
@@ -9,7 +9,7 @@
const char *test_doc = "Check that we can migrate with a named pipe, "
"opened in WRONLY mode and then unlinked";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/unlink_fstat00.c b/test/zdtm/static/unlink_fstat00.c
index 4965dbc..188d877 100644
--- a/test/zdtm/static/unlink_fstat00.c
+++ b/test/zdtm/static/unlink_fstat00.c
@@ -10,7 +10,7 @@
const char *test_doc = "Open, unlink, change size, seek, migrate, check size";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/unlink_fstat01.c b/test/zdtm/static/unlink_fstat01.c
index 104abec..e099ace 100644
--- a/test/zdtm/static/unlink_fstat01.c
+++ b/test/zdtm/static/unlink_fstat01.c
@@ -10,7 +10,7 @@
const char *test_doc = "Open, unlink, change size, migrate, check size";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/unlink_fstat02.c b/test/zdtm/static/unlink_fstat02.c
index dd18b8f..1478cba 100644
--- a/test/zdtm/static/unlink_fstat02.c
+++ b/test/zdtm/static/unlink_fstat02.c
@@ -10,7 +10,7 @@
const char *test_doc = "Open, link, unlink x2, change size, migrate, check size";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static char link_name[1024];
diff --git a/test/zdtm/static/unlink_fstat03.c b/test/zdtm/static/unlink_fstat03.c
index 06268e3..d3a9f6d 100644
--- a/test/zdtm/static/unlink_fstat03.c
+++ b/test/zdtm/static/unlink_fstat03.c
@@ -12,7 +12,7 @@
const char *test_doc = "Open, link, unlink former, change size, migrate, check size";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static char link_name[1024];
diff --git a/test/zdtm/static/unlink_largefile.c b/test/zdtm/static/unlink_largefile.c
index b1f8079..d19a0ba 100644
--- a/test/zdtm/static/unlink_largefile.c
+++ b/test/zdtm/static/unlink_largefile.c
@@ -9,7 +9,7 @@
const char *test_doc = "Checkpointing/restore of big (2Gb) unlinked files";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/unlink_mmap00.c b/test/zdtm/static/unlink_mmap00.c
index 03509aa..247f1c3 100644
--- a/test/zdtm/static/unlink_mmap00.c
+++ b/test/zdtm/static/unlink_mmap00.c
@@ -11,7 +11,7 @@
const char *test_doc = "Test mmaped and unlinked files";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#ifndef PAGE_SIZE
diff --git a/test/zdtm/static/unlink_mmap01.c b/test/zdtm/static/unlink_mmap01.c
index 66c1bc3..e95ed1b 100644
--- a/test/zdtm/static/unlink_mmap01.c
+++ b/test/zdtm/static/unlink_mmap01.c
@@ -13,7 +13,7 @@
const char *test_doc = "Test mmaped and unlinked files (2, with hard links)";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static char linkname[4096];
diff --git a/test/zdtm/static/unlink_mmap02.c b/test/zdtm/static/unlink_mmap02.c
index 85d6b38..cb67dd9 100644
--- a/test/zdtm/static/unlink_mmap02.c
+++ b/test/zdtm/static/unlink_mmap02.c
@@ -11,7 +11,7 @@
const char *test_doc = "Test mmaped, opened and unlinked files";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#ifndef PAGE_SIZE
diff --git a/test/zdtm/static/unlink_regular00.c b/test/zdtm/static/unlink_regular00.c
index 6e97df2..7dab5b3 100644
--- a/test/zdtm/static/unlink_regular00.c
+++ b/test/zdtm/static/unlink_regular00.c
@@ -13,7 +13,7 @@
const char *test_doc = "Checkpointing/restore of unlinked file inside unlinked directory";
const char *test_author = "Kirill Tkhai <ktkhai at virtuozzo.com>";
-char *dirname;
+static char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
#define SUBDIR "subdir"
diff --git a/test/zdtm/static/vt.c b/test/zdtm/static/vt.c
index 1726a6f..c9ab9b1 100644
--- a/test/zdtm/static/vt.c
+++ b/test/zdtm/static/vt.c
@@ -14,7 +14,7 @@
const char *test_doc = "Check c/r of a virtual terminal";
const char *test_author = "Ruslan Kuprieiev <kupruser at gmail.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/static/write_read00.c b/test/zdtm/static/write_read00.c
index 1648e35..4fc3176 100644
--- a/test/zdtm/static/write_read00.c
+++ b/test/zdtm/static/write_read00.c
@@ -8,7 +8,7 @@
const char *test_doc = "Write file before migration, read after";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/write_read01.c b/test/zdtm/static/write_read01.c
index 0d41767..be38dbf 100644
--- a/test/zdtm/static/write_read01.c
+++ b/test/zdtm/static/write_read01.c
@@ -8,7 +8,7 @@
const char *test_doc = "Write and half way read file before migration, complete after";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/write_read02.c b/test/zdtm/static/write_read02.c
index 0a80558..b274465 100644
--- a/test/zdtm/static/write_read02.c
+++ b/test/zdtm/static/write_read02.c
@@ -8,7 +8,7 @@
const char *test_doc = "Write file half way before migration, complete and read after";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/static/write_read10.c b/test/zdtm/static/write_read10.c
index 8af581d..ddd6efb 100644
--- a/test/zdtm/static/write_read10.c
+++ b/test/zdtm/static/write_read10.c
@@ -13,7 +13,7 @@ const char *test_doc = "Open r/w and unlink file, and fork before migration;\n"
"can read from it after migration";
const char *test_author = "Roman Kagan <rkagan at parallels.com>";
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char ** argv)
diff --git a/test/zdtm/transition/epoll.c b/test/zdtm/transition/epoll.c
index f89d96d..60a5756 100644
--- a/test/zdtm/transition/epoll.c
+++ b/test/zdtm/transition/epoll.c
@@ -31,7 +31,7 @@ static char *child_fail_reason[] = {
"Can't write"
};
-int scale = 13;
+static int scale = 13;
TEST_OPTION(scale, int, "How many children should perform testing", 0);
static int pids[MAX_SCALE];
diff --git a/test/zdtm/transition/fifo_dyn.c b/test/zdtm/transition/fifo_dyn.c
index 62ebce4..f91dc44 100644
--- a/test/zdtm/transition/fifo_dyn.c
+++ b/test/zdtm/transition/fifo_dyn.c
@@ -17,7 +17,7 @@ const char *test_doc = "dynamic FIFO test";
#define PROCS_DEF 2 /* 0 - parent, 1 - child */
#define BUF_SIZE 256
unsigned int num_procs = PROCS_DEF;
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
int main(int argc, char **argv)
diff --git a/test/zdtm/transition/fifo_loop.c b/test/zdtm/transition/fifo_loop.c
index 2e28320..a8e69f3 100644
--- a/test/zdtm/transition/fifo_loop.c
+++ b/test/zdtm/transition/fifo_loop.c
@@ -15,10 +15,10 @@
const char *test_doc = "Multi-process fifo loop";
#define BUF_SIZE 256
#define PROCS_DEF 4
-unsigned int num_procs = PROCS_DEF;
+static unsigned int num_procs = PROCS_DEF;
TEST_OPTION(num_procs, uint, "# processes to create "
"(default " __stringify(PROCS_DEF) ")", 0);
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static int pids[PROCS_DEF];
diff --git a/test/zdtm/transition/file_read.c b/test/zdtm/transition/file_read.c
index 63926c0..0e6a0bb 100644
--- a/test/zdtm/transition/file_read.c
+++ b/test/zdtm/transition/file_read.c
@@ -42,10 +42,10 @@ static char *kids_fail_reasons[] = {
/* 7 */ "Lseek failed"
};
-int scale = 13;
+static int scale = 13;
TEST_OPTION(scale, int, "How many children should perform testing", 0);
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
static int pids[MAX_SCALE];
diff --git a/test/zdtm/transition/ipc.c b/test/zdtm/transition/ipc.c
index 4affe04..ff47fd1 100644
--- a/test/zdtm/transition/ipc.c
+++ b/test/zdtm/transition/ipc.c
@@ -31,7 +31,7 @@ static struct sembuf lock = {
};
#define DEF_MEM_SIZE (40960)
-unsigned int shmem_size = DEF_MEM_SIZE;
+static unsigned int shmem_size = DEF_MEM_SIZE;
TEST_OPTION(shmem_size, uint, "Size of shared memory segment", 0);
#define INIT_CRC (~0)
diff --git a/test/zdtm/transition/pipe_loop00.c b/test/zdtm/transition/pipe_loop00.c
index cce6027..e635c70 100644
--- a/test/zdtm/transition/pipe_loop00.c
+++ b/test/zdtm/transition/pipe_loop00.c
@@ -15,7 +15,7 @@ const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
#define PROCS_DEF 4
#define PROCS_MAX 64
-unsigned int num_procs = PROCS_DEF;
+static unsigned int num_procs = PROCS_DEF;
TEST_OPTION(num_procs, uint, "# processes to create "
"(default " __stringify(PROCS_DEF)
", max " __stringify(PROCS_MAX) ")", 0);
diff --git a/test/zdtm/transition/pipe_shared00.c b/test/zdtm/transition/pipe_shared00.c
index 64708d9..6bb6d53 100644
--- a/test/zdtm/transition/pipe_shared00.c
+++ b/test/zdtm/transition/pipe_shared00.c
@@ -15,7 +15,7 @@ const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
#define PROCS_DEF 4
#define PROCS_MAX 64
-unsigned int num_procs = PROCS_DEF;
+static unsigned int num_procs = PROCS_DEF;
TEST_OPTION(num_procs, uint, "# processes to create "
"(default " __stringify(PROCS_DEF)
", max " __stringify(PROCS_MAX) ")", 0);
diff --git a/test/zdtm/transition/ptrace.c b/test/zdtm/transition/ptrace.c
index dc6eca2..d63e7a2 100644
--- a/test/zdtm/transition/ptrace.c
+++ b/test/zdtm/transition/ptrace.c
@@ -16,7 +16,7 @@ const char *test_doc = "Tests that ptraced thread do not escape from tracing";
const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
#define NR_THREADS 2
-unsigned int nr_threads = NR_THREADS;
+static unsigned int nr_threads = NR_THREADS;
TEST_OPTION(nr_threads, uint, "Number of threads", 0);
static void *thread(void *arg)
diff --git a/test/zdtm/transition/socket_loop00.c b/test/zdtm/transition/socket_loop00.c
index 9bc3d6e..f716890 100644
--- a/test/zdtm/transition/socket_loop00.c
+++ b/test/zdtm/transition/socket_loop00.c
@@ -16,7 +16,7 @@ const char *test_author = "Pavel Emelianov <xemul at parallels.com>";
#define PROCS_DEF 4
#define PROCS_MAX 64
-unsigned int num_procs = PROCS_DEF;
+static unsigned int num_procs = PROCS_DEF;
TEST_OPTION(num_procs, uint, "# processes to create "
"(default " __stringify(PROCS_DEF)
", max " __stringify(PROCS_MAX) ")", 0);
diff --git a/test/zdtm/transition/unix_sock.c b/test/zdtm/transition/unix_sock.c
index 64a4919..a3ca29c 100644
--- a/test/zdtm/transition/unix_sock.c
+++ b/test/zdtm/transition/unix_sock.c
@@ -18,12 +18,12 @@ const char *test_author = "Roman Kagan <rkagan at parallels.com>";
#define PROCS_DEF 4
#define PROCS_MAX 64
-unsigned int num_procs = PROCS_DEF;
+static unsigned int num_procs = PROCS_DEF;
TEST_OPTION(num_procs, uint, "# processes to create "
"(default " __stringify(PROCS_DEF)
", max " __stringify(PROCS_MAX) ")", 0);
-char *filename;
+static char *filename;
TEST_OPTION(filename, string, "file name", 1);
#define ACCEPT_TIMEOUT 100 /* max delay for the child to connect */
--
2.7.2
More information about the CRIU
mailing list