[libvirt] [PATCH] Fix compilation of statstest.c during make check

--- tests/statstest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tests/statstest.c b/tests/statstest.c index d18bb0c..c989992 100644 --- a/tests/statstest.c +++ b/tests/statstest.c @@ -17,7 +17,7 @@ static void testQuietError(void *userData ATTRIBUTE_UNUSED, static int testDevice(const char *path, int expect) { - int actual = xenLinuxDomainDeviceID(NULL, 1, path); + int actual = xenLinuxDomainDeviceID(1, path); if (actual == expect) { return 0; -- 1.7.5.4

On 07/07/2011 10:16 AM, Jim Fehlig wrote:
--- tests/statstest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/statstest.c b/tests/statstest.c index d18bb0c..c989992 100644 --- a/tests/statstest.c +++ b/tests/statstest.c @@ -17,7 +17,7 @@ static void testQuietError(void *userData ATTRIBUTE_UNUSED,
static int testDevice(const char *path, int expect) { - int actual = xenLinuxDomainDeviceID(NULL, 1, path); + int actual = xenLinuxDomainDeviceID(1, path);
ACK. This was a regression introduced in commit 60d769a1, back in April. So why did we not detect it until now? What is different about your test environment that triggered compilation of this code while others (myself included) have been happily unaware of its existence? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Eric Blake wrote:
On 07/07/2011 10:16 AM, Jim Fehlig wrote:
--- tests/statstest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/statstest.c b/tests/statstest.c index d18bb0c..c989992 100644 --- a/tests/statstest.c +++ b/tests/statstest.c @@ -17,7 +17,7 @@ static void testQuietError(void *userData ATTRIBUTE_UNUSED,
static int testDevice(const char *path, int expect) { - int actual = xenLinuxDomainDeviceID(NULL, 1, path); + int actual = xenLinuxDomainDeviceID(1, path);
ACK.
Pushed.
This was a regression introduced in commit 60d769a1, back in April. So why did we not detect it until now? What is different about your test environment that triggered compilation of this code while others (myself included) have been happily unaware of its existence?
In configure.ac, I see that xen kernel and xend must both be running to for ENABLE_XEN_TESTS to be true, which then enables building statstest.c and reconnect.c. I guess we're just not using xen much these days... Regards, Jim

On 07/07/2011 10:28 AM, Eric Blake wrote:
+++ b/tests/statstest.c @@ -17,7 +17,7 @@ static void testQuietError(void *userData ATTRIBUTE_UNUSED,
static int testDevice(const char *path, int expect) { - int actual = xenLinuxDomainDeviceID(NULL, 1, path); + int actual = xenLinuxDomainDeviceID(1, path);
ACK.
This was a regression introduced in commit 60d769a1, back in April. So why did we not detect it until now? What is different about your test environment that triggered compilation of this code while others (myself included) have been happily unaware of its existence?
Found it - statstest is guarded by the automake conditional ENABLE_XEN_TESTS, set at configure time according to whether xen sockets were usable. But to avoid this type of failure in the future, I'd rather have the test unconditionally compiled if xen headers are present, and merely have the test have an early opt-opt return 77 (for skip) if the xen socket cannot be connected to at runtime. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Jim Fehlig