Skip to content
Commits on Source (5)
......@@ -131,6 +131,7 @@ Ben Gray <ben.r.gray@gmail.com>
Benjamin Cama <benoar@dolka.fr>
Bharata B Rao <bharata@linux.vnet.ibm.com>
Bing Bu Cao <mars@linux.vnet.ibm.com>
Bing Niu <bing.niu@intel.com>
Bjoern Walk <bwalk@linux.ibm.com>
Bjoern Walk <bwalk@linux.vnet.ibm.com>
Bob Liu <bob.liu@oracle.com>
......@@ -228,6 +229,7 @@ Eugen Feller <eugen.feller@inria.fr>
Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Fabiano Fidêncio <fabiano@fidencio.org>
Fabiano Fidêncio <fidencio@redhat.com>
Farhan Ali <alifm@linux.ibm.com>
Farhan Ali <alifm@linux.vnet.ibm.com>
Federico Simoncelli <fsimonce@redhat.com>
Felix Geyer <debfx@fobos.de>
......@@ -470,6 +472,7 @@ Rick Harris <rconradharris@gmail.com>
Riku Voipio <riku.voipio@linaro.org>
Roland Schulz <schullzroll@gmail.com>
Rolf Eike Beer <eike@sf-mail.de>
Roman Bolshakov <r.bolshakov@yadro.com>
Roman Mohr <rmohr@redhat.com>
Rommer <rommer@active.by>
Ron Yorston <rmy@tigress.co.uk>
......@@ -560,6 +563,7 @@ Vasiliy Tolstov <v.tolstov@selfip.ru>
Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Ville Skyttä <ville.skytta@iki.fi>
Vincent Bernat <vincent@bernat.im>
Vitaly Kuznetsov <vkuznets@redhat.com>
Vitor de Lima <vitor.lima@eldorado.org.br>
Vladislav Bogdanov <bubble@hoster-ok.com>
Václav Pavlín <vpavlin@redhat.com>
......
This diff is collapsed.
......@@ -143,6 +143,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/ldexp.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/libunistring-base.m4 \
$(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \
$(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \
$(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \
......@@ -261,7 +262,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/virt-gnutls.m4 $(top_srcdir)/m4/virt-hal.m4 \
$(top_srcdir)/m4/virt-host-validate.m4 \
$(top_srcdir)/m4/virt-init-script.m4 \
$(top_srcdir)/m4/virt-jansson.m4 $(top_srcdir)/m4/virt-lib.m4 \
$(top_srcdir)/m4/virt-lib.m4 $(top_srcdir)/m4/virt-libiscsi.m4 \
$(top_srcdir)/m4/virt-libnl.m4 \
$(top_srcdir)/m4/virt-libpcap.m4 \
$(top_srcdir)/m4/virt-libssh.m4 \
......@@ -292,6 +293,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/virt-storage-disk.m4 \
$(top_srcdir)/m4/virt-storage-fs.m4 \
$(top_srcdir)/m4/virt-storage-gluster.m4 \
$(top_srcdir)/m4/virt-storage-iscsi-direct.m4 \
$(top_srcdir)/m4/virt-storage-iscsi.m4 \
$(top_srcdir)/m4/virt-storage-lvm.m4 \
$(top_srcdir)/m4/virt-storage-mpath.m4 \
......@@ -316,9 +318,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
$(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \
$(top_srcdir)/m4/wctomb.m4 $(top_srcdir)/m4/wctype_h.m4 \
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \
$(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
......@@ -1381,12 +1383,12 @@ IP6TABLES_PATH = @IP6TABLES_PATH@
IPTABLES_PATH = @IPTABLES_PATH@
IP_PATH = @IP_PATH@
ISCSIADM = @ISCSIADM@
JANSSON_CFLAGS = @JANSSON_CFLAGS@
JANSSON_LIBS = @JANSSON_LIBS@
LD = @LD@
LDEXP_LIBM = @LDEXP_LIBM@
LDFLAGS = @LDFLAGS@
LIBINTL = @LIBINTL@
LIBISCSI_CFLAGS = @LIBISCSI_CFLAGS@
LIBISCSI_LIBS = @LIBISCSI_LIBS@
LIBMULTITHREAD = @LIBMULTITHREAD@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
LIBNL_LIBS = @LIBNL_LIBS@
......@@ -1407,6 +1409,8 @@ LIBSSH_LIBS = @LIBSSH_LIBS@
LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
LIBTHREAD = @LIBTHREAD@
LIBTOOL = @LIBTOOL@
LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
LIBVIRT_ADMIN_SYMBOL_FILE = @LIBVIRT_ADMIN_SYMBOL_FILE@
LIBVIRT_LXC_SYMBOL_FILE = @LIBVIRT_LXC_SYMBOL_FILE@
LIBVIRT_MAJOR_VERSION = @LIBVIRT_MAJOR_VERSION@
......@@ -1599,6 +1603,7 @@ PVCREATE = @PVCREATE@
PVREMOVE = @PVREMOVE@
PVS = @PVS@
PYTHON = @PYTHON@
QEMU = @QEMU@
QEMU_BRIDGE_HELPER = @QEMU_BRIDGE_HELPER@
QEMU_PR_HELPER = @QEMU_PR_HELPER@
RADVD = @RADVD@
......@@ -1862,8 +1867,6 @@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
SSH2_CFLAGS = @SSH2_CFLAGS@
SSH2_LIBS = @SSH2_LIBS@
STABLE_ORDERING_JANSSON_CFLAGS = @STABLE_ORDERING_JANSSON_CFLAGS@
STABLE_ORDERING_JANSSON_LIBS = @STABLE_ORDERING_JANSSON_LIBS@
STATIC_BINARIES = @STATIC_BINARIES@
STDALIGN_H = @STDALIGN_H@
STDARG_H = @STDARG_H@
......@@ -1916,6 +1919,8 @@ XENAPI_LIBS = @XENAPI_LIBS@
XGETTEXT = @XGETTEXT@
XMLLINT = @XMLLINT@
XSLTPROC = @XSLTPROC@
YAJL_CFLAGS = @YAJL_CFLAGS@
YAJL_LIBS = @YAJL_LIBS@
ZFS = @ZFS@
ZPOOL = @ZPOOL@
abs_aux_dir = @abs_aux_dir@
......
libvirt releases
================
# v4.7.0 (2018-09-03)
* New features
- storage: add storage pool iscsi-direct
Introduce a new storage pool backend that uses libiscsi instead of
iscsiadm. It support basic pool operations: checkPool and refreshPool.
- Add support for MBA (Memory Bandwidth Allocation technology)
Domain vCPU threads can now have allocated some parts of host memory
bandwidth by using the memorytune element in cputune.
- qemu: Add support for RISC-V guests
riscv32 and riscv64 guest architectures are now supported.
* Improvements
- qemu: Add ccw support for vhost-vsock
Support the vhost-vsock-ccw device on S390.
- qemu: Make default machine type independent of QEMU
We can't control whether or not QEMU will change its default machine
type in the future, or whether downstream distributions will decide to
compile out some machine types, so our only option to provide a
predictable behavior is taking care of the default ourselves;
management applications and users are encouraged to explicitly pick a
machine type when creating new guests.
- apparmor: Various improvements
Rules have been added to deal with a number of scenarios that didn't
work correctly.
* Bug fixes
- esx: Truncate CPU model name
Some CPU model names are too long to be stored into the corresponding
property, and should be explicitly truncated to avoid unexpected
behavior in users of the virNodeGetInfo() API such as virsh nodeinfo.
- utils: Remove arbitrary limit on socket_id/core_id
Both values were assumed to be smaller than 4096, but in fact they are
entirely hardware-dependent and there have been reports of machines
presenting much bigger values, preventing libvirt from working
correctly; all such limits have now been removed.
# v4.6.0 (2018-08-06)
* New features
......
......@@ -1593,6 +1593,7 @@ m4_include([m4/lib-ld.m4])
m4_include([m4/lib-link.m4])
m4_include([m4/lib-prefix.m4])
m4_include([m4/libtool.m4])
m4_include([m4/libunistring-base.m4])
m4_include([m4/limits-h.m4])
m4_include([m4/localcharset.m4])
m4_include([m4/locale-fr.m4])
......@@ -1786,8 +1787,8 @@ m4_include([m4/virt-gnutls.m4])
m4_include([m4/virt-hal.m4])
m4_include([m4/virt-host-validate.m4])
m4_include([m4/virt-init-script.m4])
m4_include([m4/virt-jansson.m4])
m4_include([m4/virt-lib.m4])
m4_include([m4/virt-libiscsi.m4])
m4_include([m4/virt-libnl.m4])
m4_include([m4/virt-libpcap.m4])
m4_include([m4/virt-libssh.m4])
......@@ -1822,6 +1823,7 @@ m4_include([m4/virt-storage-dir.m4])
m4_include([m4/virt-storage-disk.m4])
m4_include([m4/virt-storage-fs.m4])
m4_include([m4/virt-storage-gluster.m4])
m4_include([m4/virt-storage-iscsi-direct.m4])
m4_include([m4/virt-storage-iscsi.m4])
m4_include([m4/virt-storage-lvm.m4])
m4_include([m4/virt-storage-mpath.m4])
......@@ -1852,6 +1854,7 @@ m4_include([m4/wcrtomb.m4])
m4_include([m4/wctob.m4])
m4_include([m4/wctomb.m4])
m4_include([m4/wctype_h.m4])
m4_include([m4/wcwidth.m4])
m4_include([m4/wint_t.m4])
m4_include([m4/write.m4])
m4_include([m4/xalloc.m4])
......
......@@ -36,7 +36,6 @@
# undef WITH_DEVMAPPER
# undef WITH_DTRACE_PROBES
# undef WITH_GNUTLS
# undef WITH_JANSSON
# undef WITH_LIBSSH
# undef WITH_MACVTAP
# undef WITH_NUMACTL
......@@ -44,6 +43,8 @@
# undef WITH_SSH2
# undef WITH_SYSTEMD_DAEMON
# undef WITH_VIRTUALPORT
# undef WITH_YAJL
# undef WITH_YAJL2
#endif
/*
......
......@@ -711,6 +711,9 @@
/* Define to 1 when the gnulib module wctomb should be tested. */
#undef GNULIB_TEST_WCTOMB
/* Define to 1 when the gnulib module wcwidth should be tested. */
#undef GNULIB_TEST_WCWIDTH
/* Define to 1 when the gnulib module write should be tested. */
#undef GNULIB_TEST_WRITE
......@@ -1105,6 +1108,10 @@
*/
#undef HAVE_DECL_WCTOB
/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you
don't. */
#undef HAVE_DECL_WCWIDTH
/* Define to 1 if you have the declaration of `_fseeki64', and to 0 if you
don't. */
#undef HAVE_DECL__FSEEKI64
......@@ -1393,6 +1400,9 @@
/* Define to 1 if you have the `libxl_domain_config_from_json' function. */
#undef HAVE_LIBXL_DOMAIN_CONFIG_FROM_JSON
/* Define to 1 if you have the `yajl' library (-lyajl). */
#undef HAVE_LIBYAJL
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
......@@ -2111,6 +2121,9 @@
/* Define to 1 if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
/* Define to 1 if you have the 'wcwidth' function. */
#undef HAVE_WCWIDTH
/* Define to 1 if you have the <winsock2.h> header file. */
#undef HAVE_WINSOCK2_H
......@@ -2744,8 +2757,8 @@
/* whether the interface driver is enabled */
#undef WITH_INTERFACE
/* whether jansson >= 2.5 is available */
#undef WITH_JANSSON
/* whether libiscsi >= 1.18.0 is available */
#undef WITH_LIBISCSI
/* whether libparted >= $PARTED_REQUIRED is available */
#undef WITH_LIBPARTED
......@@ -2837,9 +2850,6 @@
/* whether libssh2 >= 1.3 is available */
#undef WITH_SSH2
/* whether jansson >= 2.8 is available */
#undef WITH_STABLE_ORDERING_JANSSON
/* Define to 1 if at least one storage backend is in use */
#undef WITH_STORAGE
......@@ -2858,6 +2868,9 @@
/* whether iSCSI backend for storage driver is enabled */
#undef WITH_STORAGE_ISCSI
/* whether iSCSI backend for storage driver is enabled */
#undef WITH_STORAGE_ISCSI_DIRECT
/* whether LVM backend for storage driver is enabled */
#undef WITH_STORAGE_LVM
......@@ -2909,6 +2922,12 @@
/* whether libxenserver is available */
#undef WITH_XENAPI
/* whether libyajl is available */
#undef WITH_YAJL
/* whether libyajl is available */
#undef WITH_YAJL2
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
......
This diff is collapsed.
......@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
AC_INIT([libvirt], [4.6.0], [libvir-list@redhat.com], [], [https://libvirt.org])
AC_INIT([libvirt], [4.7.0], [libvir-list@redhat.com], [], [https://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
......@@ -250,7 +250,7 @@ LIBVIRT_ARG_FIREWALLD
LIBVIRT_ARG_FUSE
LIBVIRT_ARG_GLUSTER
LIBVIRT_ARG_HAL
LIBVIRT_ARG_JANSSON
LIBVIRT_ARG_LIBISCSI
LIBVIRT_ARG_LIBPCAP
LIBVIRT_ARG_LIBSSH
LIBVIRT_ARG_LIBXML
......@@ -291,7 +291,7 @@ LIBVIRT_CHECK_FUSE
LIBVIRT_CHECK_GLUSTER
LIBVIRT_CHECK_GNUTLS
LIBVIRT_CHECK_HAL
LIBVIRT_CHECK_JANSSON
LIBVIRT_CHECK_LIBISCSI
LIBVIRT_CHECK_LIBNL
LIBVIRT_CHECK_LIBPARTED
LIBVIRT_CHECK_LIBPCAP
......@@ -564,6 +564,7 @@ LIBVIRT_STORAGE_ARG_DIR
LIBVIRT_STORAGE_ARG_FS
LIBVIRT_STORAGE_ARG_LVM
LIBVIRT_STORAGE_ARG_ISCSI
LIBVIRT_STORAGE_ARG_ISCSI_DIRECT
LIBVIRT_STORAGE_ARG_SCSI
LIBVIRT_STORAGE_ARG_MPATH
LIBVIRT_STORAGE_ARG_DISK
......@@ -578,6 +579,7 @@ if test "$with_libvirtd" = "no"; then
with_storage_fs=no
with_storage_lvm=no
with_storage_iscsi=no
with_storage_iscsi_direct=no
with_storage_scsi=no
with_storage_mpath=no
with_storage_disk=no
......@@ -598,6 +600,7 @@ LIBVIRT_STORAGE_CHECK_DIR
LIBVIRT_STORAGE_CHECK_FS
LIBVIRT_STORAGE_CHECK_LVM
LIBVIRT_STORAGE_CHECK_ISCSI
LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT
LIBVIRT_STORAGE_CHECK_SCSI
LIBVIRT_STORAGE_CHECK_MPATH
LIBVIRT_STORAGE_CHECK_DISK
......@@ -608,7 +611,7 @@ LIBVIRT_STORAGE_CHECK_ZFS
LIBVIRT_STORAGE_CHECK_VSTORAGE
with_storage=no
for backend in dir fs lvm iscsi scsi mpath rbd disk; do
for backend in dir fs lvm iscsi iscsi_direct scsi mpath rbd disk; do
if eval test \$with_storage_$backend = yes; then
with_storage=yes
break
......@@ -936,6 +939,7 @@ LIBVIRT_STORAGE_RESULT_DIR
LIBVIRT_STORAGE_RESULT_FS
LIBVIRT_STORAGE_RESULT_LVM
LIBVIRT_STORAGE_RESULT_ISCSI
LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT
LIBVIRT_STORAGE_RESULT_SCSI
LIBVIRT_STORAGE_RESULT_MPATH
LIBVIRT_STORAGE_RESULT_DISK
......@@ -972,7 +976,7 @@ LIBVIRT_RESULT_FUSE
LIBVIRT_RESULT_GLUSTER
LIBVIRT_RESULT_GNUTLS
LIBVIRT_RESULT_HAL
LIBVIRT_RESULT_JANSSON
LIBVIRT_RESULT_LIBISCSI
LIBVIRT_RESULT_LIBNL
LIBVIRT_RESULT_LIBPCAP
LIBVIRT_RESULT_LIBSSH
......
libvirt (4.7.0-1) unstable; urgency=medium
* [8ff38ac] New upstream version 4.7.0
(Closes: #908341)
* [afdd147] Bump symbol versions
* [41fa8f5] Rediff patches.
Drop all jansson related patches. Fixed ustream.
-- Guido Günther <agx@sigxcpu.org> Sun, 09 Sep 2018 21:42:33 +0200
libvirt (4.6.0-2) unstable; urgency=medium
* [c33faee] Drop dwarves dependency.
......
......@@ -115,7 +115,8 @@ libvirt.so.0 libvirt0 #MINVER#
*@LIBVIRT_4.4.0 4.4.0
*@LIBVIRT_4.5.0 4.5.0
*@LIBVIRT_4.6.0 4.6.0
*@LIBVIRT_PRIVATE_4.6.0 4.6.0
*@LIBVIRT_4.7.0 4.7.0
*@LIBVIRT_PRIVATE_4.7.0 4.7.0
libvirt-qemu.so.0 libvirt0 #MINVER#
*@LIBVIRT_QEMU_0.8.3 0.8.3
......@@ -137,4 +138,4 @@ libvirt-admin.so.0 libvirt0 #MINVER#
*@LIBVIRT_ADMIN_1.3.0 1.2.18
*@LIBVIRT_ADMIN_2.0.0 2.0.0~rc1
*@LIBVIRT_ADMIN_3.0.0 3.0.0
*@LIBVIRT_ADMIN_PRIVATE_4.6.0 4.6.0
*@LIBVIRT_ADMIN_PRIVATE_4.7.0 4.7.0
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:40:11 +0200
Subject: Revert "Remove functions using yajl"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit bf114decb34f21cd225ead6dc4d929d35a8c5fe5.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/util/virjson.c | 529 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 528 insertions(+), 1 deletion(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 80274bc..608ba85 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -29,6 +29,22 @@
#include "virstring.h"
#include "virutil.h"
+#if WITH_YAJL
+# include <yajl/yajl_gen.h>
+# include <yajl/yajl_parse.h>
+
+# ifdef WITH_YAJL2
+# define yajl_size_t size_t
+# define VIR_YAJL_STATUS_OK(status) ((status) == yajl_status_ok)
+# else
+# define yajl_size_t unsigned int
+# define yajl_complete_parse yajl_parse_complete
+# define VIR_YAJL_STATUS_OK(status) \
+ ((status) == yajl_status_ok || (status) == yajl_status_insufficient_data)
+# endif
+
+#endif
+
/* XXX fixme */
#define VIR_FROM_THIS VIR_FROM_NONE
@@ -72,6 +88,23 @@ struct _virJSONValue {
};
+typedef struct _virJSONParserState virJSONParserState;
+typedef virJSONParserState *virJSONParserStatePtr;
+struct _virJSONParserState {
+ virJSONValuePtr value;
+ char *key;
+};
+
+typedef struct _virJSONParser virJSONParser;
+typedef virJSONParser *virJSONParserPtr;
+struct _virJSONParser {
+ virJSONValuePtr head;
+ virJSONParserStatePtr state;
+ size_t nstate;
+ int wrap;
+};
+
+
virJSONType
virJSONValueGetType(const virJSONValue *value)
{
@@ -1458,7 +1491,501 @@ virJSONValueCopy(const virJSONValue *in)
}
-#if WITH_JANSSON
+#if WITH_YAJL
+static int
+virJSONParserInsertValue(virJSONParserPtr parser,
+ virJSONValuePtr value)
+{
+ if (!parser->head) {
+ parser->head = value;
+ } else {
+ virJSONParserStatePtr state;
+ if (!parser->nstate) {
+ VIR_DEBUG("got a value to insert without a container");
+ return -1;
+ }
+
+ state = &parser->state[parser->nstate-1];
+
+ switch (state->value->type) {
+ case VIR_JSON_TYPE_OBJECT: {
+ if (!state->key) {
+ VIR_DEBUG("missing key when inserting object value");
+ return -1;
+ }
+
+ if (virJSONValueObjectAppend(state->value,
+ state->key,
+ value) < 0)
+ return -1;
+
+ VIR_FREE(state->key);
+ } break;
+
+ case VIR_JSON_TYPE_ARRAY: {
+ if (state->key) {
+ VIR_DEBUG("unexpected key when inserting array value");
+ return -1;
+ }
+
+ if (virJSONValueArrayAppend(state->value,
+ value) < 0)
+ return -1;
+ } break;
+
+ default:
+ VIR_DEBUG("unexpected value type, not a container");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+
+static int
+virJSONParserHandleNull(void *ctx)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONValuePtr value = virJSONValueNewNull();
+
+ VIR_DEBUG("parser=%p", parser);
+
+ if (!value)
+ return 0;
+
+ if (virJSONParserInsertValue(parser, value) < 0) {
+ virJSONValueFree(value);
+ return 0;
+ }
+
+ return 1;
+}
+
+
+static int
+virJSONParserHandleBoolean(void *ctx,
+ int boolean_)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONValuePtr value = virJSONValueNewBoolean(boolean_);
+
+ VIR_DEBUG("parser=%p boolean=%d", parser, boolean_);
+
+ if (!value)
+ return 0;
+
+ if (virJSONParserInsertValue(parser, value) < 0) {
+ virJSONValueFree(value);
+ return 0;
+ }
+
+ return 1;
+}
+
+
+static int
+virJSONParserHandleNumber(void *ctx,
+ const char *s,
+ yajl_size_t l)
+{
+ virJSONParserPtr parser = ctx;
+ char *str;
+ virJSONValuePtr value;
+
+ if (VIR_STRNDUP(str, s, l) < 0)
+ return -1;
+ value = virJSONValueNewNumber(str);
+ VIR_FREE(str);
+
+ VIR_DEBUG("parser=%p str=%s", parser, str);
+
+ if (!value)
+ return 0;
+
+ if (virJSONParserInsertValue(parser, value) < 0) {
+ virJSONValueFree(value);
+ return 0;
+ }
+
+ return 1;
+}
+
+
+static int
+virJSONParserHandleString(void *ctx,
+ const unsigned char *stringVal,
+ yajl_size_t stringLen)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONValuePtr value = virJSONValueNewStringLen((const char *)stringVal,
+ stringLen);
+
+ VIR_DEBUG("parser=%p str=%p", parser, (const char *)stringVal);
+
+ if (!value)
+ return 0;
+
+ if (virJSONParserInsertValue(parser, value) < 0) {
+ virJSONValueFree(value);
+ return 0;
+ }
+
+ return 1;
+}
+
+
+static int
+virJSONParserHandleMapKey(void *ctx,
+ const unsigned char *stringVal,
+ yajl_size_t stringLen)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONParserStatePtr state;
+
+ VIR_DEBUG("parser=%p key=%p", parser, (const char *)stringVal);
+
+ if (!parser->nstate)
+ return 0;
+
+ state = &parser->state[parser->nstate-1];
+ if (state->key)
+ return 0;
+ if (VIR_STRNDUP(state->key, (const char *)stringVal, stringLen) < 0)
+ return 0;
+ return 1;
+}
+
+
+static int
+virJSONParserHandleStartMap(void *ctx)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONValuePtr value = virJSONValueNewObject();
+
+ VIR_DEBUG("parser=%p", parser);
+
+ if (!value)
+ return 0;
+
+ if (virJSONParserInsertValue(parser, value) < 0) {
+ virJSONValueFree(value);
+ return 0;
+ }
+
+ if (VIR_REALLOC_N(parser->state,
+ parser->nstate + 1) < 0) {
+ return 0;
+ }
+
+ parser->state[parser->nstate].value = value;
+ parser->state[parser->nstate].key = NULL;
+ parser->nstate++;
+
+ return 1;
+}
+
+
+static int
+virJSONParserHandleEndMap(void *ctx)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONParserStatePtr state;
+
+ VIR_DEBUG("parser=%p", parser);
+
+ if (!parser->nstate)
+ return 0;
+
+ state = &(parser->state[parser->nstate-1]);
+ if (state->key) {
+ VIR_FREE(state->key);
+ return 0;
+ }
+
+ VIR_DELETE_ELEMENT(parser->state, parser->nstate - 1, parser->nstate);
+
+ return 1;
+}
+
+
+static int
+virJSONParserHandleStartArray(void *ctx)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONValuePtr value = virJSONValueNewArray();
+
+ VIR_DEBUG("parser=%p", parser);
+
+ if (!value)
+ return 0;
+
+ if (virJSONParserInsertValue(parser, value) < 0) {
+ virJSONValueFree(value);
+ return 0;
+ }
+
+ if (VIR_REALLOC_N(parser->state,
+ parser->nstate + 1) < 0)
+ return 0;
+
+ parser->state[parser->nstate].value = value;
+ parser->state[parser->nstate].key = NULL;
+ parser->nstate++;
+
+ return 1;
+}
+
+
+static int
+virJSONParserHandleEndArray(void *ctx)
+{
+ virJSONParserPtr parser = ctx;
+ virJSONParserStatePtr state;
+
+ VIR_DEBUG("parser=%p", parser);
+
+ if (!(parser->nstate - parser->wrap))
+ return 0;
+
+ state = &(parser->state[parser->nstate-1]);
+ if (state->key) {
+ VIR_FREE(state->key);
+ return 0;
+ }
+
+ VIR_DELETE_ELEMENT(parser->state, parser->nstate - 1, parser->nstate);
+
+ return 1;
+}
+
+
+static const yajl_callbacks parserCallbacks = {
+ virJSONParserHandleNull,
+ virJSONParserHandleBoolean,
+ NULL,
+ NULL,
+ virJSONParserHandleNumber,
+ virJSONParserHandleString,
+ virJSONParserHandleStartMap,
+ virJSONParserHandleMapKey,
+ virJSONParserHandleEndMap,
+ virJSONParserHandleStartArray,
+ virJSONParserHandleEndArray
+};
+
+
+/* XXX add an incremental streaming parser - yajl trivially supports it */
+virJSONValuePtr
+virJSONValueFromString(const char *jsonstring)
+{
+ yajl_handle hand;
+ virJSONParser parser = { NULL, NULL, 0, 0 };
+ virJSONValuePtr ret = NULL;
+ int rc;
+ size_t len = strlen(jsonstring);
+# ifndef WITH_YAJL2
+ yajl_parser_config cfg = { 0, 1 }; /* Match yajl 2 default behavior */
+ VIR_AUTOPTR(virJSONValue) tmp = NULL;
+# endif
+
+ VIR_DEBUG("string=%s", jsonstring);
+
+# ifdef WITH_YAJL2
+ hand = yajl_alloc(&parserCallbacks, NULL, &parser);
+# else
+ hand = yajl_alloc(&parserCallbacks, &cfg, NULL, &parser);
+# endif
+ if (!hand) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to create JSON parser"));
+ goto cleanup;
+ }
+
+ /* Yajl 2 is nice enough to default to rejecting trailing garbage.
+ * Yajl 1.0.12 has yajl_get_bytes_consumed to make that detection
+ * simpler. But we're stuck with yajl 1.0.7 on RHEL 6, which
+ * happily quits parsing at the end of a valid JSON construct,
+ * with no visibility into how much more input remains. Wrapping
+ * things in an array forces yajl to confess the truth. */
+# ifdef WITH_YAJL2
+ rc = yajl_parse(hand, (const unsigned char *)jsonstring, len);
+# else
+ rc = yajl_parse(hand, (const unsigned char *)"[", 1);
+ parser.wrap = 1;
+ if (VIR_YAJL_STATUS_OK(rc))
+ rc = yajl_parse(hand, (const unsigned char *)jsonstring, len);
+ parser.wrap = 0;
+ if (VIR_YAJL_STATUS_OK(rc))
+ rc = yajl_parse(hand, (const unsigned char *)"]", 1);
+# endif
+ if (!VIR_YAJL_STATUS_OK(rc) ||
+ yajl_complete_parse(hand) != yajl_status_ok) {
+ unsigned char *errstr = yajl_get_error(hand, 1,
+ (const unsigned char*)jsonstring,
+ strlen(jsonstring));
+
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse json %s: %s"),
+ jsonstring, (const char*) errstr);
+ yajl_free_error(hand, errstr);
+ virJSONValueFree(parser.head);
+ goto cleanup;
+ }
+
+ if (parser.nstate != 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse json %s: unterminated string/map/array"),
+ jsonstring);
+ virJSONValueFree(parser.head);
+ } else {
+ ret = parser.head;
+# ifndef WITH_YAJL2
+ /* Undo the array wrapping above */
+ tmp = ret;
+ ret = NULL;
+ if (virJSONValueArraySize(tmp) > 1)
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse json %s: too many items present"),
+ jsonstring);
+ else
+ ret = virJSONValueArraySteal(tmp, 0);
+# endif
+ }
+
+ cleanup:
+ yajl_free(hand);
+
+ if (parser.nstate) {
+ size_t i;
+ for (i = 0; i < parser.nstate; i++)
+ VIR_FREE(parser.state[i].key);
+ VIR_FREE(parser.state);
+ }
+
+ VIR_DEBUG("result=%p", ret);
+
+ return ret;
+}
+
+
+static int
+virJSONValueToStringOne(virJSONValuePtr object,
+ yajl_gen g)
+{
+ size_t i;
+
+ VIR_DEBUG("object=%p type=%d gen=%p", object, object->type, g);
+
+ switch (object->type) {
+ case VIR_JSON_TYPE_OBJECT:
+ if (yajl_gen_map_open(g) != yajl_gen_status_ok)
+ return -1;
+ for (i = 0; i < object->data.object.npairs; i++) {
+ if (yajl_gen_string(g,
+ (unsigned char *)object->data.object.pairs[i].key,
+ strlen(object->data.object.pairs[i].key))
+ != yajl_gen_status_ok)
+ return -1;
+ if (virJSONValueToStringOne(object->data.object.pairs[i].value, g) < 0)
+ return -1;
+ }
+ if (yajl_gen_map_close(g) != yajl_gen_status_ok)
+ return -1;
+ break;
+ case VIR_JSON_TYPE_ARRAY:
+ if (yajl_gen_array_open(g) != yajl_gen_status_ok)
+ return -1;
+ for (i = 0; i < object->data.array.nvalues; i++) {
+ if (virJSONValueToStringOne(object->data.array.values[i], g) < 0)
+ return -1;
+ }
+ if (yajl_gen_array_close(g) != yajl_gen_status_ok)
+ return -1;
+ break;
+
+ case VIR_JSON_TYPE_STRING:
+ if (yajl_gen_string(g, (unsigned char *)object->data.string,
+ strlen(object->data.string)) != yajl_gen_status_ok)
+ return -1;
+ break;
+
+ case VIR_JSON_TYPE_NUMBER:
+ if (yajl_gen_number(g, object->data.number,
+ strlen(object->data.number)) != yajl_gen_status_ok)
+ return -1;
+ break;
+
+ case VIR_JSON_TYPE_BOOLEAN:
+ if (yajl_gen_bool(g, object->data.boolean) != yajl_gen_status_ok)
+ return -1;
+ break;
+
+ case VIR_JSON_TYPE_NULL:
+ if (yajl_gen_null(g) != yajl_gen_status_ok)
+ return -1;
+ break;
+
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+
+char *
+virJSONValueToString(virJSONValuePtr object,
+ bool pretty)
+{
+ yajl_gen g;
+ const unsigned char *str;
+ char *ret = NULL;
+ yajl_size_t len;
+# ifndef WITH_YAJL2
+ yajl_gen_config conf = { pretty ? 1 : 0, pretty ? " " : " "};
+# endif
+
+ VIR_DEBUG("object=%p", object);
+
+# ifdef WITH_YAJL2
+ g = yajl_gen_alloc(NULL);
+ if (g) {
+ yajl_gen_config(g, yajl_gen_beautify, pretty ? 1 : 0);
+ yajl_gen_config(g, yajl_gen_indent_string, pretty ? " " : " ");
+ yajl_gen_config(g, yajl_gen_validate_utf8, 1);
+ }
+# else
+ g = yajl_gen_alloc(&conf, NULL);
+# endif
+ if (!g) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to create JSON formatter"));
+ goto cleanup;
+ }
+
+ if (virJSONValueToStringOne(object, g) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ if (yajl_gen_get_buf(g, &str, &len) != yajl_gen_status_ok) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ ignore_value(VIR_STRDUP(ret, (const char *)str));
+
+ cleanup:
+ yajl_gen_free(g);
+
+ VIR_DEBUG("result=%s", NULLSTR(ret));
+
+ return ret;
+}
+
+
+#elif WITH_JANSSON
# include <jansson.h>
static virJSONValuePtr
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:39:56 +0200
Subject: Revert "Remove virJSONValueNewStringLen"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit 8f802c6d8659beb9eb3cab96ba2553e251728337.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/virjson.c | 22 ++++++++++++++++++++++
src/util/virjson.h | 1 +
3 files changed, 24 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index fc386e1..a5e88a9 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2098,6 +2098,7 @@ virJSONValueNewNumberUint;
virJSONValueNewNumberUlong;
virJSONValueNewObject;
virJSONValueNewString;
+virJSONValueNewStringLen;
virJSONValueObjectAdd;
virJSONValueObjectAddVArgs;
virJSONValueObjectAppend;
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 01a387b..80274bc 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -420,6 +420,28 @@ virJSONValueNewString(const char *data)
}
+virJSONValuePtr
+virJSONValueNewStringLen(const char *data,
+ size_t length)
+{
+ virJSONValuePtr val;
+
+ if (!data)
+ return virJSONValueNewNull();
+
+ if (VIR_ALLOC(val) < 0)
+ return NULL;
+
+ val->type = VIR_JSON_TYPE_STRING;
+ if (VIR_STRNDUP(val->data.string, data, length) < 0) {
+ VIR_FREE(val);
+ return NULL;
+ }
+
+ return val;
+}
+
+
static virJSONValuePtr
virJSONValueNewNumber(const char *data)
{
diff --git a/src/util/virjson.h b/src/util/virjson.h
index 0d5a7ef..75f7f17 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -59,6 +59,7 @@ int virJSONValueObjectAddVArgs(virJSONValuePtr obj, va_list args)
virJSONValuePtr virJSONValueNewString(const char *data);
+virJSONValuePtr virJSONValueNewStringLen(const char *data, size_t length);
virJSONValuePtr virJSONValueNewNumberInt(int data);
virJSONValuePtr virJSONValueNewNumberUint(unsigned int data);
virJSONValuePtr virJSONValueNewNumberLong(long long data);
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:41:14 +0200
Subject: Revert "build: add --with-jansson"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit 12b34f094e2f1c7f414f4bb8f880a9d65c8fcd85.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Conflicts:
configure.ac:
Commit 8aa85e0b introduced LIBVIRT_*_LIBISCSI macros.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
configure.ac | 6 +++---
m4/virt-jansson.m4 | 29 -----------------------------
2 files changed, 3 insertions(+), 32 deletions(-)
delete mode 100644 m4/virt-jansson.m4
diff --git a/configure.ac b/configure.ac
index 71666ba..411fbe5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -250,7 +250,7 @@ LIBVIRT_ARG_FIREWALLD
LIBVIRT_ARG_FUSE
LIBVIRT_ARG_GLUSTER
LIBVIRT_ARG_HAL
-LIBVIRT_ARG_JANSSON
+LIBVIRT_ARG_LIBISCSI
LIBVIRT_ARG_LIBPCAP
LIBVIRT_ARG_LIBSSH
LIBVIRT_ARG_LIBXML
@@ -291,7 +291,7 @@ LIBVIRT_CHECK_FUSE
LIBVIRT_CHECK_GLUSTER
LIBVIRT_CHECK_GNUTLS
LIBVIRT_CHECK_HAL
-LIBVIRT_CHECK_JANSSON
+LIBVIRT_CHECK_LIBISCSI
LIBVIRT_CHECK_LIBNL
LIBVIRT_CHECK_LIBPARTED
LIBVIRT_CHECK_LIBPCAP
@@ -972,7 +972,7 @@ LIBVIRT_RESULT_FUSE
LIBVIRT_RESULT_GLUSTER
LIBVIRT_RESULT_GNUTLS
LIBVIRT_RESULT_HAL
-LIBVIRT_RESULT_JANSSON
+LIBVIRT_RESULT_LIBISCSI
LIBVIRT_RESULT_LIBNL
LIBVIRT_RESULT_LIBPCAP
LIBVIRT_RESULT_LIBSSH
diff --git a/m4/virt-jansson.m4 b/m4/virt-jansson.m4
deleted file mode 100644
index 206d6a5..0000000
--- a/m4/virt-jansson.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-dnl The jansson library
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library. If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_ARG_JANSSON],[
- LIBVIRT_ARG_WITH_FEATURE([JANSSON], [jansson], [check])
-])
-
-AC_DEFUN([LIBVIRT_CHECK_JANSSON],[
- dnl Jansson http://www.digip.org/jansson/
- LIBVIRT_CHECK_PKG([JANSSON], [jansson], [2.5])
-])
-
-AC_DEFUN([LIBVIRT_RESULT_JANSSON],[
- LIBVIRT_RESULT_LIB([JANSSON])
-])
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:40:02 +0200
Subject: Revert "build: remove references to WITH_YAJL for SETUID_RPC_CLIENT"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit 1caf8441604b58e4a89aa2c09975b8346928c52a.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
config-post.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/config-post.h b/config-post.h
index 0567212..24117bb 100644
--- a/config-post.h
+++ b/config-post.h
@@ -44,6 +44,8 @@
# undef WITH_SSH2
# undef WITH_SYSTEMD_DAEMON
# undef WITH_VIRTUALPORT
+# undef WITH_YAJL
+# undef WITH_YAJL2
#endif
/*
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:39:39 +0200
Subject: Revert "build: require Jansson if QEMU driver is enabled"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit 01ce04375c3348fd683475e5aa5231149ef6a78a.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
m4/virt-driver-qemu.m4 | 3 ---
1 file changed, 3 deletions(-)
diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
index 2d9992d..ddb2834 100644
--- a/m4/virt-driver-qemu.m4
+++ b/m4/virt-driver-qemu.m4
@@ -27,9 +27,6 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [
AC_REQUIRE([LIBVIRT_CHECK_JANSSON])
- if test "$with_qemu:$with_jansson" = "yes:no"; then
- AC_MSG_ERROR([Jansson >= 2.5 is required to build QEMU driver])
- fi
if test "$with_qemu" = "check"; then
with_qemu=$with_jansson
fi
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:39:48 +0200
Subject: Revert "build: switch --with-qemu default from yes to check"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit c5ae8e0c2b4b6bb3c667cfadaf65a66c3f4f3d85.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
m4/virt-driver-qemu.m4 | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
index ddb2834..80e1d3a 100644
--- a/m4/virt-driver-qemu.m4
+++ b/m4/virt-driver-qemu.m4
@@ -18,7 +18,7 @@ dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
- LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [check])
+ LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [yes])
LIBVIRT_ARG_WITH([QEMU_USER], [username to run QEMU system instance as],
['platform dependent'])
LIBVIRT_ARG_WITH([QEMU_GROUP], [groupname to run QEMU system instance as],
@@ -26,10 +26,6 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
])
AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [
- AC_REQUIRE([LIBVIRT_CHECK_JANSSON])
- if test "$with_qemu" = "check"; then
- with_qemu=$with_jansson
- fi
if test "$with_qemu" = "yes" ; then
AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled])
fi
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:40:25 +0200
Subject: Revert "build: undef WITH_JANSSON for SETUID_RPC_CLIENT"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit 93fdc9e0b0cbb2eec32745a868ac4633f0912ad5.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
config-post.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/config-post.h b/config-post.h
index 24117bb..063e30f 100644
--- a/config-post.h
+++ b/config-post.h
@@ -36,7 +36,6 @@
# undef WITH_DEVMAPPER
# undef WITH_DTRACE_PROBES
# undef WITH_GNUTLS
-# undef WITH_JANSSON
# undef WITH_LIBSSH
# undef WITH_MACVTAP
# undef WITH_NUMACTL
From: =?utf-8?q?J=C3=A1n_Tomko?= <jtomko@redhat.com>
Date: Mon, 13 Aug 2018 13:39:33 +0200
Subject: Revert "m4: Introduce STABLE_ORDERING_JANSSON"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This reverts commit 4dd60540007042bfc0087a67f57f3e9f3311a84a.
Jansson cannot parse QEMU's quirky JSON.
Revert back to yajl.
https://bugzilla.redhat.com/show_bug.cgi?id=1614569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
m4/virt-jansson.m4 | 3 ---
tests/qemublocktest.c | 5 -----
tests/qemucapabilitiestest.c | 5 -----
tests/qemucommandutiltest.c | 5 -----
tests/qemuhotplugtest.c | 5 -----
tests/qemumigparamstest.c | 5 -----
tests/qemumonitorjsontest.c | 5 -----
tests/virjsontest.c | 5 -----
tests/virmacmaptest.c | 5 -----
tests/virnetdaemontest.c | 5 -----
10 files changed, 48 deletions(-)
diff --git a/m4/virt-jansson.m4 b/m4/virt-jansson.m4
index ab4c020..206d6a5 100644
--- a/m4/virt-jansson.m4
+++ b/m4/virt-jansson.m4
@@ -22,9 +22,6 @@ AC_DEFUN([LIBVIRT_ARG_JANSSON],[
AC_DEFUN([LIBVIRT_CHECK_JANSSON],[
dnl Jansson http://www.digip.org/jansson/
LIBVIRT_CHECK_PKG([JANSSON], [jansson], [2.5])
- dnl Older versions of Jansson did not preserve the order of object keys
- dnl use this check to guard the tests that are sensitive to this
- LIBVIRT_CHECK_PKG([STABLE_ORDERING_JANSSON], [jansson], [2.8], [true])
])
AC_DEFUN([LIBVIRT_RESULT_JANSSON],[
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index d22b4b7..9a387cf 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -337,11 +337,6 @@ mymain(void)
char *capslatest_x86_64 = NULL;
virQEMUCapsPtr caps_x86_64 = NULL;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
if (qemuTestDriverInit(&driver) < 0)
return EXIT_FAILURE;
diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
index 28f903a..641ec4f 100644
--- a/tests/qemucapabilitiestest.c
+++ b/tests/qemucapabilitiestest.c
@@ -141,11 +141,6 @@ mymain(void)
int ret = 0;
testQemuData data;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c
index 9b13dde..8e57a1b 100644
--- a/tests/qemucommandutiltest.c
+++ b/tests/qemucommandutiltest.c
@@ -76,11 +76,6 @@ mymain(void)
int ret = 0;
testQemuCommandBuildObjectFromJSONData data1;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 3c0eecb..2fb96c6 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -593,11 +593,6 @@ mymain(void)
struct qemuHotplugTestData data = {0};
struct testQemuHotplugCpuParams cpudata;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
diff --git a/tests/qemumigparamstest.c b/tests/qemumigparamstest.c
index 5e12430..b8af682 100644
--- a/tests/qemumigparamstest.c
+++ b/tests/qemumigparamstest.c
@@ -203,11 +203,6 @@ mymain(void)
virQEMUDriver driver;
int ret = 0;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 1826c4f..c11615f 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2863,11 +2863,6 @@ mymain(void)
virJSONValuePtr metaschema = NULL;
char *metaschemastr = NULL;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
diff --git a/tests/virjsontest.c b/tests/virjsontest.c
index d352d37..d42413d 100644
--- a/tests/virjsontest.c
+++ b/tests/virjsontest.c
@@ -479,11 +479,6 @@ mymain(void)
{
int ret = 0;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
#define DO_TEST_FULL(name, cmd, doc, expect, pass) \
do { \
struct testInfo info = { doc, expect, pass }; \
diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c
index 420531d..6e3e998 100644
--- a/tests/virmacmaptest.c
+++ b/tests/virmacmaptest.c
@@ -157,11 +157,6 @@ mymain(void)
int ret = 0;
virMacMapPtr mgr = NULL;
-#if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-#endif
-
#define DO_TEST_BASIC(f, d, ...) \
do { \
const char * const m[] = {__VA_ARGS__, NULL }; \
diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
index 277fb06..cbc961d 100644
--- a/tests/virnetdaemontest.c
+++ b/tests/virnetdaemontest.c
@@ -375,11 +375,6 @@ mymain(void)
int ret = 0;
const char *server_names[] = { "testServer0", "testServer1" };
-# if !WITH_STABLE_ORDERING_JANSSON
- fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
- return EXIT_AM_SKIP;
-# endif
-
if (virInitialize() < 0 ||
virEventRegisterDefaultImpl() < 0) {
virDispatchError(NULL);