Re: [PATCH] Make tests independant of system page size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 02, 2015 at 11:10:44AM +0000, Daniel P. Berrange wrote:
Some code paths have special logic depending on the page size
reported by sysconf, which in turn affects the test results.
We must mock this so tests always have a consistent page size.
---
src/libvirt_private.syms |  2 ++
src/openvz/openvz_util.c |  5 +----
src/qemu/qemu_command.c  |  4 ++--
src/qemu/qemu_driver.c   |  6 +-----
src/util/virfile.c       |  2 +-
src/util/virnuma.c       |  6 +++---
src/util/virutil.c       | 13 +++++++++++++
src/util/virutil.h       |  3 +++
src/xen/xen_hypervisor.c |  4 ++--
tests/qemuxml2argvmock.c | 13 +++++++++++++
tests/qemuxml2argvtest.c |  1 +
11 files changed, 42 insertions(+), 17 deletions(-)

[...]
diff --git a/src/util/virutil.c b/src/util/virutil.c
index 3037293..f3e8920 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -2577,3 +2577,16 @@ virGetListenFDs(void)
}

#endif /* WIN32 */
+
+long virGetSystemPageSize(void)
+{
+    return sysconf(_SC_PAGESIZE);
+}
+
+long virGetSystemPageSizeKB(void)
+{
+    long val = sysconf(_SC_PAGESIZE);

Use virGetSystemPageSize() here and you don't have to mock 2
functions.

ACK with that changed.

Attachment: pgpMa1pdkK2aF.pgp
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]