[libvirt] [PATCH] Make tests independant of system page size

Martin Kletzander mkletzan at redhat.com
Mon Feb 2 12:32:32 UTC 2015


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150202/6711272a/attachment-0001.sig>


More information about the libvir-list mailing list