[Pkg-libvirt-commits] [libguestfs] 18/21: v2v: domainxml: Fix missing functions in the !HAVE_LIBVIRT case.

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:16:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.29.50
in repository libguestfs.

commit 6561c96fb7b383cd239c6b1f638510514557c549
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Jul 9 17:53:39 2015 +0100

    v2v: domainxml: Fix missing functions in the !HAVE_LIBVIRT case.
    
    This also uses a C macro to simplify the error functions in this case.
    
    This fixes commit badfc2e9b2a56fd5bac849a6edca4fec823abeea.
---
 v2v/domainxml-c.c | 39 +++++++++++----------------------------
 1 file changed, 11 insertions(+), 28 deletions(-)

diff --git a/v2v/domainxml-c.c b/v2v/domainxml-c.c
index efedbe4..d0b7b58 100644
--- a/v2v/domainxml-c.c
+++ b/v2v/domainxml-c.c
@@ -485,34 +485,17 @@ v2v_domain_exists (value connv, value domnamev)
 
 #else /* !HAVE_LIBVIRT */
 
-value v2v_dumpxml (value connv, value domv) __attribute__((noreturn));
-
-value
-v2v_dumpxml (value connv, value domv)
-{
-  caml_invalid_argument ("virt-v2v was compiled without libvirt support");
-}
-
-value v2v_pool_dumpxml (value connv, value poolv) __attribute__((noreturn));
-
-value
-v2v_pool_dumpxml (value connv, value poolv)
-{
-  caml_invalid_argument ("virt-v2v was compiled without libvirt support");
-}
-
-value v2v_vol_dumpxml (value connv, value poolnamev, value volnamev) __attribute__((noreturn));
-
-value
-v2v_vol_dumpxml (value connv, value poolnamev, value volnamev)
-{
-  caml_invalid_argument ("virt-v2v was compiled without libvirt support");
-}
+#define NO_LIBVIRT(proto)                                               \
+  proto __attribute__((noreturn));                                      \
+  proto                                                                 \
+  {                                                                     \
+    caml_invalid_argument ("virt-v2v was compiled without libvirt support"); \
+  }
 
-value
-v2v_capabilities (value connv, value unitv)
-{
-  caml_invalid_argument ("virt-v2v was compiled without libvirt support");
-}
+NO_LIBVIRT (value v2v_dumpxml (value connv, value domv))
+NO_LIBVIRT (value v2v_pool_dumpxml (value connv, value poolv))
+NO_LIBVIRT (value v2v_vol_dumpxml (value connv, value poolnamev, value volnamev))
+NO_LIBVIRT (value v2v_capabilities (value connv, value unitv))
+NO_LIBVIRT (value v2v_domain_exists (value connv, value domnamev))
 
 #endif /* !HAVE_LIBVIRT */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list