From cb71801a2b58b763a1fbe06f71494e7698572f05 Mon Sep 17 00:00:00 2001 From: Daniel P. Berrange Date: Dec 11 2015 12:15:31 +0000 Subject: Add patch to fix 32-bit test suite check Signed-off-by: Daniel P. Berrange --- diff --git a/0001-test-qemuxml2argv-Mock-virMemoryMaxValue-to-remove-3.patch b/0001-test-qemuxml2argv-Mock-virMemoryMaxValue-to-remove-3.patch new file mode 100644 index 0000000..3196048 --- /dev/null +++ b/0001-test-qemuxml2argv-Mock-virMemoryMaxValue-to-remove-3.patch @@ -0,0 +1,52 @@ +From ace1ee225f5cd87fb095054a6a19bdcd0fa57518 Mon Sep 17 00:00:00 2001 +From: Peter Krempa +Date: Thu, 10 Dec 2015 14:36:51 +0100 +Subject: [PATCH] test: qemuxml2argv: Mock virMemoryMaxValue to remove 32/64 + bit difference + +Always return LLONG_MAX even on 32 bit systems. The limitation +originates from our use of "unsigned long" in several APIs. The internal +data type is unsigned long long. Make the test suite deterministic by +removing the architecture difference. + +Flaw was introduced in 645881139b3d2c86acf9d644c3a1471520bc9e57 where +I've added a test that uses too large numbers. +--- + src/util/virutil.c | 2 ++ + tests/qemuxml2argvmock.c | 10 ++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/src/util/virutil.c b/src/util/virutil.c +index 177f9d7..bb9604a 100644 +--- a/src/util/virutil.c ++++ b/src/util/virutil.c +@@ -2658,6 +2658,8 @@ virMemoryLimitIsSet(unsigned long long value) + * @capped: whether the value must fit into unsigned long + * (long long is assumed otherwise) + * ++ * Note: This function is mocked in tests/qemuxml2argvmock.c for test stability ++ * + * Returns the maximum possible memory value in bytes. + */ + unsigned long long +diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c +index e58b8ce..8426108 100644 +--- a/tests/qemuxml2argvmock.c ++++ b/tests/qemuxml2argvmock.c +@@ -74,3 +74,13 @@ virTPMCreateCancelPath(const char *devpath) + + return path; + } ++ ++/** ++ * Large values for memory would fail on 32 bit systems, despite having ++ * variables that support it. ++ */ ++unsigned long long ++virMemoryMaxValue(bool capped ATTRIBUTE_UNUSED) ++{ ++ return LLONG_MAX; ++} +-- +2.5.0 + diff --git a/libvirt.spec b/libvirt.spec index 407431c..de5bf86 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -388,6 +388,7 @@ URL: http://libvirt.org/ %define mainturl stable_updates/ %endif Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz +Patch1: 0001-test-qemuxml2argv-Mock-virMemoryMaxValue-to-remove-3.patch %if %{with_libvirtd} Requires: libvirt-daemon = %{version}-%{release}