[libvirt] [PATCH] tests: Fix MinGW build for domaincapstest

Andrea Bolognani posted 1 patch 5 years ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190410133150.11403-1-abologna@redhat.com
tests/domaincapstest.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
[libvirt] [PATCH] tests: Fix MinGW build for domaincapstest
Posted by Andrea Bolognani 5 years ago
Commit 5b9819eedc71 started using the virFileWrapper APIs in
the test program, and correctly called them only in the section
of code guarded by WITH_QEMU; however, a single call to the
virFileWrapperClearPrefixes() function ended up in the
hypervisor-agnostic section, causing a build failure on MinGW.

Move the call to the QEMU-only section; while at it, also drop
the virFileWrapperRemovePrefix() calls, which are entirely
redundant since we'd drop all prefixes immediately afterwards
anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---

Another approach would be to simply drop the call to
virFileWrapperClearPrefixes(), but there really is no point
in removing prefixes one by one when we can just clear all of
them in one fell swoop.

 tests/domaincapstest.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 3ee95a4b58..a9922e1edb 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -451,9 +451,7 @@ mymain(void)
                  "x86_64", VIR_DOMAIN_VIRT_KVM);
     virObjectUnref(cfg);
 
-    virFileWrapperRemovePrefix(SYSCONFDIR "/qemu/firmware");
-    virFileWrapperRemovePrefix(PREFIX "/share/qemu/firmware");
-    virFileWrapperRemovePrefix("/home/user/.config/qemu/firmware");
+    virFileWrapperClearPrefixes();
 
 #endif /* WITH_QEMU */
 
@@ -476,8 +474,6 @@ mymain(void)
     DO_TEST_BHYVE("fbuf", "/usr/sbin/bhyve", &bhyve_caps, VIR_DOMAIN_VIRT_BHYVE);
 #endif /* WITH_BHYVE */
 
-    virFileWrapperClearPrefixes();
-
     return ret;
 }
 
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] tests: Fix MinGW build for domaincapstest
Posted by Michal Privoznik 5 years ago
On 4/10/19 3:31 PM, Andrea Bolognani wrote:
> Commit 5b9819eedc71 started using the virFileWrapper APIs in
> the test program, and correctly called them only in the section
> of code guarded by WITH_QEMU; however, a single call to the
> virFileWrapperClearPrefixes() function ended up in the
> hypervisor-agnostic section, causing a build failure on MinGW.
> 
> Move the call to the QEMU-only section; while at it, also drop
> the virFileWrapperRemovePrefix() calls, which are entirely
> redundant since we'd drop all prefixes immediately afterwards
> anyway.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
> 
> Another approach would be to simply drop the call to
> virFileWrapperClearPrefixes(), but there really is no point
> in removing prefixes one by one when we can just clear all of
> them in one fell swoop.
> 
>   tests/domaincapstest.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)

Okay, let's go with this approach. ACK

Michal

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