From: "Daniel P. Berrange" <berrange(a)redhat.com>
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 6 +++---
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_driver.c | 4 ++--
src/util/virjson.c | 14 +++++++-------
tests/Makefile.am | 2 +-
tests/qemuhelptest.c | 2 +-
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5acba9b..988d167 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1206,15 +1206,15 @@ if test "x$with_yajl" != "xno"; then
CPPFLAGS="$old_cppflags"
LIBS="$old_libs"
if test "x$with_yajl" = "xyes" ; then
- AC_DEFINE_UNQUOTED([HAVE_YAJL], 1,
+ AC_DEFINE_UNQUOTED([WITH_YAJL], 1,
[whether YAJL is available for JSON parsing/formatting])
fi
if test "x$with_yajl2" = "xyes" ; then
- AC_DEFINE_UNQUOTED([HAVE_YAJL2], 1,
+ AC_DEFINE_UNQUOTED([WITH_YAJL2], 1,
[whether YAJL has API version 2])
fi
fi
-AM_CONDITIONAL([HAVE_YAJL], [test "x$with_yajl" = "xyes"])
+AM_CONDITIONAL([WITH_YAJL], [test "x$with_yajl" = "xyes"])
AC_SUBST([YAJL_CFLAGS])
AC_SUBST([YAJL_LIBS])
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 320d8c8..97c921c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1142,7 +1142,7 @@ qemuCapsComputeCmdFlags(const char *help,
* backported for libvirt. The benefits of JSON mode now
* outweigh the downside.
*/
-#if HAVE_YAJL
+#if WITH_YAJL
if (version >= 13000) {
qemuCapsSet(caps, QEMU_CAPS_MONITOR_JSON);
} else if (version >= 12000 &&
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 06b0d28..33abdfc 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1991,7 +1991,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
goto cleanup;
}
} else {
-#if HAVE_YAJL
+#if WITH_YAJL
if (qemuCapsGet(priv->caps, QEMU_CAPS_MONITOR_JSON)) {
if (!qemuCapsGet(priv->caps, QEMU_CAPS_NO_SHUTDOWN)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -2003,7 +2003,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Reboot is not supported without the JSON
monitor"));
goto cleanup;
-#if HAVE_YAJL
+#if WITH_YAJL
}
#endif
}
diff --git a/src/util/virjson.c b/src/util/virjson.c
index db5eda2..e6a3b1b 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -29,11 +29,11 @@
#include "virlog.h"
#include "virutil.h"
-#if HAVE_YAJL
+#if WITH_YAJL
# include <yajl/yajl_gen.h>
# include <yajl/yajl_parse.h>
-# ifdef HAVE_YAJL2
+# ifdef WITH_YAJL2
# define yajl_size_t size_t
# else
# define yajl_size_t unsigned int
@@ -659,7 +659,7 @@ int virJSONValueObjectIsNull(virJSONValuePtr object, const char *key)
}
-#if HAVE_YAJL
+#if WITH_YAJL
static int virJSONParserInsertValue(virJSONParserPtr parser,
virJSONValuePtr value)
{
@@ -937,13 +937,13 @@ virJSONValuePtr virJSONValueFromString(const char *jsonstring)
yajl_handle hand;
virJSONParser parser = { NULL, NULL, 0 };
virJSONValuePtr ret = NULL;
-# ifndef HAVE_YAJL2
+# ifndef WITH_YAJL2
yajl_parser_config cfg = { 1, 1 };
# endif
VIR_DEBUG("string=%s", jsonstring);
-# ifdef HAVE_YAJL2
+# ifdef WITH_YAJL2
hand = yajl_alloc(&parserCallbacks, NULL, &parser);
if (hand) {
yajl_config(hand, yajl_allow_comments, 1);
@@ -1061,13 +1061,13 @@ char *virJSONValueToString(virJSONValuePtr object,
const unsigned char *str;
char *ret = NULL;
yajl_size_t len;
-# ifndef HAVE_YAJL2
+# ifndef WITH_YAJL2
yajl_gen_config conf = { pretty ? 1 : 0, pretty ? " " : " "};
# endif
VIR_DEBUG("object=%p", object);
-# ifdef HAVE_YAJL2
+# ifdef WITH_YAJL2
g = yajl_gen_alloc(NULL);
if (g) {
yajl_gen_config(g, yajl_gen_beautify, pretty ? 1 : 0);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9c7c6fb..0e5aec4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -146,7 +146,7 @@ if WITH_CIL
test_programs += object-locking
endif
-if HAVE_YAJL
+if WITH_YAJL
test_programs += jsontest
endif
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 252ad3a..bf09288 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -56,7 +56,7 @@ static int testHelpStrParsing(const void *data)
&version, &is_kvm, &kvm_version, false) == -1)
goto cleanup;
-# ifndef HAVE_YAJL
+# ifndef WITH_YAJL
if (qemuCapsGet(info->flags, QEMU_CAPS_MONITOR_JSON))
qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
# endif
--
1.7.11.7