parent
dac1ea8516
commit
75f95d7304
@ -0,0 +1,412 @@
|
||||
From e37768d8892d6f467c7834f8b142b89f8f0af7dc Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 18 Oct 2024 21:52:21 +0100
|
||||
Subject: [PATCH] build: Assume __attribute__((cleanup)) always works
|
||||
|
||||
All recent compilers support this (except MS compilers which we don't
|
||||
care about). Assume it is supported. We test it in ./configure and
|
||||
hard fail if it doesn't work.
|
||||
|
||||
We still define HAVE_ATTRIBUTE_CLEANUP but you can now assume it is
|
||||
always defined and don't have to check it.
|
||||
---
|
||||
common | 2 +-
|
||||
daemon/daemon.h | 9 ---------
|
||||
daemon/sh.c | 5 -----
|
||||
daemon/yara.c | 8 --------
|
||||
generator/c.ml | 10 ----------
|
||||
generator/daemon.ml | 15 ---------------
|
||||
lib/guestfs-internal.h | 8 --------
|
||||
lib/info.c | 5 -----
|
||||
lib/launch-libvirt.c | 5 -----
|
||||
lib/qemu.c | 5 -----
|
||||
m4/guestfs-c.m4 | 7 ++-----
|
||||
11 files changed, 3 insertions(+), 76 deletions(-)
|
||||
|
||||
Submodule common b6e703dcc..01c532260:
|
||||
diff --git a/common/structs/structs-cleanups.h b/common/structs/structs-cleanups.h
|
||||
index b43dbd7..c6e7fd1 100644
|
||||
--- a/common/structs/structs-cleanups.h
|
||||
+++ b/common/structs/structs-cleanups.h
|
||||
@@ -28,7 +28,6 @@
|
||||
#ifndef GUESTFS_STRUCTS_CLEANUPS_H_
|
||||
#define GUESTFS_STRUCTS_CLEANUPS_H_
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_FREE_INT_BOOL \
|
||||
__attribute__((cleanup(guestfs_int_cleanup_free_int_bool)))
|
||||
#define CLEANUP_FREE_INT_BOOL_LIST \
|
||||
@@ -137,62 +136,6 @@
|
||||
__attribute__((cleanup(guestfs_int_cleanup_free_yara_detection)))
|
||||
#define CLEANUP_FREE_YARA_DETECTION_LIST \
|
||||
__attribute__((cleanup(guestfs_int_cleanup_free_yara_detection_list)))
|
||||
-#else /* !HAVE_ATTRIBUTE_CLEANUP */
|
||||
-#define CLEANUP_FREE_INT_BOOL
|
||||
-#define CLEANUP_FREE_INT_BOOL_LIST
|
||||
-#define CLEANUP_FREE_LVM_PV
|
||||
-#define CLEANUP_FREE_LVM_PV_LIST
|
||||
-#define CLEANUP_FREE_LVM_VG
|
||||
-#define CLEANUP_FREE_LVM_VG_LIST
|
||||
-#define CLEANUP_FREE_LVM_LV
|
||||
-#define CLEANUP_FREE_LVM_LV_LIST
|
||||
-#define CLEANUP_FREE_STAT
|
||||
-#define CLEANUP_FREE_STAT_LIST
|
||||
-#define CLEANUP_FREE_STATNS
|
||||
-#define CLEANUP_FREE_STATNS_LIST
|
||||
-#define CLEANUP_FREE_STATVFS
|
||||
-#define CLEANUP_FREE_STATVFS_LIST
|
||||
-#define CLEANUP_FREE_DIRENT
|
||||
-#define CLEANUP_FREE_DIRENT_LIST
|
||||
-#define CLEANUP_FREE_VERSION
|
||||
-#define CLEANUP_FREE_VERSION_LIST
|
||||
-#define CLEANUP_FREE_XATTR
|
||||
-#define CLEANUP_FREE_XATTR_LIST
|
||||
-#define CLEANUP_FREE_INOTIFY_EVENT
|
||||
-#define CLEANUP_FREE_INOTIFY_EVENT_LIST
|
||||
-#define CLEANUP_FREE_PARTITION
|
||||
-#define CLEANUP_FREE_PARTITION_LIST
|
||||
-#define CLEANUP_FREE_APPLICATION
|
||||
-#define CLEANUP_FREE_APPLICATION_LIST
|
||||
-#define CLEANUP_FREE_APPLICATION2
|
||||
-#define CLEANUP_FREE_APPLICATION2_LIST
|
||||
-#define CLEANUP_FREE_ISOINFO
|
||||
-#define CLEANUP_FREE_ISOINFO_LIST
|
||||
-#define CLEANUP_FREE_MDSTAT
|
||||
-#define CLEANUP_FREE_MDSTAT_LIST
|
||||
-#define CLEANUP_FREE_BTRFSSUBVOLUME
|
||||
-#define CLEANUP_FREE_BTRFSSUBVOLUME_LIST
|
||||
-#define CLEANUP_FREE_BTRFSQGROUP
|
||||
-#define CLEANUP_FREE_BTRFSQGROUP_LIST
|
||||
-#define CLEANUP_FREE_BTRFSBALANCE
|
||||
-#define CLEANUP_FREE_BTRFSBALANCE_LIST
|
||||
-#define CLEANUP_FREE_BTRFSSCRUB
|
||||
-#define CLEANUP_FREE_BTRFSSCRUB_LIST
|
||||
-#define CLEANUP_FREE_XFSINFO
|
||||
-#define CLEANUP_FREE_XFSINFO_LIST
|
||||
-#define CLEANUP_FREE_UTSNAME
|
||||
-#define CLEANUP_FREE_UTSNAME_LIST
|
||||
-#define CLEANUP_FREE_HIVEX_NODE
|
||||
-#define CLEANUP_FREE_HIVEX_NODE_LIST
|
||||
-#define CLEANUP_FREE_HIVEX_VALUE
|
||||
-#define CLEANUP_FREE_HIVEX_VALUE_LIST
|
||||
-#define CLEANUP_FREE_INTERNAL_MOUNTABLE
|
||||
-#define CLEANUP_FREE_INTERNAL_MOUNTABLE_LIST
|
||||
-#define CLEANUP_FREE_TSK_DIRENT
|
||||
-#define CLEANUP_FREE_TSK_DIRENT_LIST
|
||||
-#define CLEANUP_FREE_YARA_DETECTION
|
||||
-#define CLEANUP_FREE_YARA_DETECTION_LIST
|
||||
-#endif /* !HAVE_ATTRIBUTE_CLEANUP */
|
||||
|
||||
/* These functions are used internally by the CLEANUP_* macros.
|
||||
* Don't call them directly.
|
||||
diff --git a/common/utils/cleanups.h b/common/utils/cleanups.h
|
||||
index 932114f..be52d07 100644
|
||||
--- a/common/utils/cleanups.h
|
||||
+++ b/common/utils/cleanups.h
|
||||
@@ -19,7 +19,6 @@
|
||||
#ifndef GUESTFS_CLEANUPS_H_
|
||||
#define GUESTFS_CLEANUPS_H_
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_FREE \
|
||||
__attribute__((cleanup(guestfs_int_cleanup_free)))
|
||||
#define CLEANUP_HASH_FREE \
|
||||
@@ -50,23 +49,6 @@
|
||||
__attribute__((cleanup(guestfs_int_cleanup_xmlXPathFreeObject)))
|
||||
#define CLEANUP_PCRE2_MATCH_DATA_FREE \
|
||||
__attribute__((cleanup(guestfs_int_cleanup_pcre2_match_data_free)))
|
||||
-#else
|
||||
-#define CLEANUP_FREE
|
||||
-#define CLEANUP_HASH_FREE
|
||||
-#define CLEANUP_UNLINK_FREE
|
||||
-#define CLEANUP_CLOSE
|
||||
-#define CLEANUP_FCLOSE
|
||||
-#define CLEANUP_PCLOSE
|
||||
-#define CLEANUP_FREE_STRING_LIST
|
||||
-#define CLEANUP_XMLFREE
|
||||
-#define CLEANUP_XMLBUFFERFREE
|
||||
-#define CLEANUP_XMLFREEDOC
|
||||
-#define CLEANUP_XMLFREEURI
|
||||
-#define CLEANUP_XMLFREETEXTWRITER
|
||||
-#define CLEANUP_XMLXPATHFREECONTEXT
|
||||
-#define CLEANUP_XMLXPATHFREEOBJECT
|
||||
-#define CLEANUP_PCRE2_MATCH_DATA_FREE
|
||||
-#endif
|
||||
|
||||
/* These functions are used internally by the CLEANUP_* macros.
|
||||
* Don't call them directly.
|
||||
diff --git a/daemon/daemon.h b/daemon/daemon.h
|
||||
index e050588ca..5fc53245c 100644
|
||||
--- a/daemon/daemon.h
|
||||
+++ b/daemon/daemon.h
|
||||
@@ -93,11 +93,7 @@ extern char *read_whole_file (const char *filename, size_t *size_r);
|
||||
extern char *mountable_to_string (const mountable_t *mountable);
|
||||
extern void cleanup_free_mountable (mountable_t *mountable);
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_FREE_MOUNTABLE __attribute__((cleanup(cleanup_free_mountable)))
|
||||
-#else
|
||||
-#define CLEANUP_FREE_MOUNTABLE
|
||||
-#endif
|
||||
|
||||
/* cleanups.c */
|
||||
/* These functions are used internally by the CLEANUP_* macros.
|
||||
@@ -106,13 +102,8 @@ extern void cleanup_free_mountable (mountable_t *mountable);
|
||||
extern void cleanup_aug_close (void *ptr);
|
||||
extern void cleanup_free_stringsbuf (void *ptr);
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_AUG_CLOSE __attribute__((cleanup(cleanup_aug_close)))
|
||||
#define CLEANUP_FREE_STRINGSBUF __attribute__((cleanup(cleanup_free_stringsbuf)))
|
||||
-#else
|
||||
-#define CLEANUP_AUG_CLOSE
|
||||
-#define CLEANUP_FREE_STRINGSBUF
|
||||
-#endif
|
||||
|
||||
/* mount.c */
|
||||
extern int is_root_mounted (void);
|
||||
diff --git a/daemon/sh.c b/daemon/sh.c
|
||||
index 92ce08be0..21d4deeab 100644
|
||||
--- a/daemon/sh.c
|
||||
+++ b/daemon/sh.c
|
||||
@@ -32,13 +32,8 @@
|
||||
|
||||
#include "ignore-value.h"
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_BIND_STATE __attribute__((cleanup(free_bind_state)))
|
||||
#define CLEANUP_RESOLVER_STATE __attribute__((cleanup(free_resolver_state)))
|
||||
-#else
|
||||
-#define CLEANUP_BIND_STATE
|
||||
-#define CLEANUP_RESOLVER_STATE
|
||||
-#endif
|
||||
|
||||
struct bind_state {
|
||||
bool mounted;
|
||||
diff --git a/daemon/yara.c b/daemon/yara.c
|
||||
index 21137b733..9350dd27b 100644
|
||||
--- a/daemon/yara.c
|
||||
+++ b/daemon/yara.c
|
||||
@@ -39,12 +39,8 @@
|
||||
|
||||
#include <yara.h>
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_DESTROY_YARA_COMPILER \
|
||||
__attribute__((cleanup(cleanup_destroy_yara_compiler)))
|
||||
-#else
|
||||
-#define CLEANUP_DESTROY_YARA_COMPILER
|
||||
-#endif
|
||||
|
||||
struct write_callback_data {
|
||||
int fd;
|
||||
@@ -208,10 +204,6 @@ compile_rules_file (const char *rules_path)
|
||||
}
|
||||
|
||||
err:
|
||||
-#ifndef HAVE_ATTRIBUTE_CLEANUP
|
||||
- yr_compiler_destroy (compiler);
|
||||
-#endif
|
||||
-
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/generator/c.ml b/generator/c.ml
|
||||
index 447059b8a..838e7f426 100644
|
||||
--- a/generator/c.ml
|
||||
+++ b/generator/c.ml
|
||||
@@ -817,7 +817,6 @@ and generate_client_structs_cleanups_h () =
|
||||
#ifndef GUESTFS_STRUCTS_CLEANUPS_H_
|
||||
#define GUESTFS_STRUCTS_CLEANUPS_H_
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
";
|
||||
|
||||
List.iter (
|
||||
@@ -828,16 +827,7 @@ and generate_client_structs_cleanups_h () =
|
||||
pr " __attribute__((cleanup(guestfs_int_cleanup_free_%s_list)))\n" name
|
||||
) structs;
|
||||
|
||||
- pr "#else /* !HAVE_ATTRIBUTE_CLEANUP */\n";
|
||||
-
|
||||
- List.iter (
|
||||
- fun { s_name = name } ->
|
||||
- pr "#define CLEANUP_FREE_%s\n" (String.uppercase_ascii name);
|
||||
- pr "#define CLEANUP_FREE_%s_LIST\n" (String.uppercase_ascii name)
|
||||
- ) structs;
|
||||
-
|
||||
pr "\
|
||||
-#endif /* !HAVE_ATTRIBUTE_CLEANUP */
|
||||
|
||||
/* These functions are used internally by the CLEANUP_* macros.
|
||||
* Don't call them directly.
|
||||
diff --git a/generator/daemon.ml b/generator/daemon.ml
|
||||
index 78a2412d2..9ab9e12df 100644
|
||||
--- a/generator/daemon.ml
|
||||
+++ b/generator/daemon.ml
|
||||
@@ -127,8 +127,6 @@ let generate_daemon_stubs actions () =
|
||||
args_passed_to_daemon in
|
||||
|
||||
if args_passed_to_daemon <> [] then (
|
||||
- pr "#ifdef HAVE_ATTRIBUTE_CLEANUP\n";
|
||||
- pr "\n";
|
||||
pr "#define CLEANUP_XDR_FREE_%s_ARGS \\\n" uc_name;
|
||||
pr " __attribute__((cleanup(cleanup_xdr_free_%s_args)))\n" name;
|
||||
pr "\n";
|
||||
@@ -140,9 +138,6 @@ let generate_daemon_stubs actions () =
|
||||
name;
|
||||
pr "}\n";
|
||||
pr "\n";
|
||||
- pr "#else /* !HAVE_ATTRIBUTE_CLEANUP */\n";
|
||||
- pr "#define CLEANUP_XDR_FREE_%s_ARGS\n" uc_name;
|
||||
- pr "#endif /* !HAVE_ATTRIBUTE_CLEANUP */\n";
|
||||
pr "\n"
|
||||
);
|
||||
|
||||
@@ -1315,7 +1310,6 @@ let generate_daemon_structs_cleanups_h () =
|
||||
#ifndef GUESTFS_DAEMON_STRUCTS_CLEANUPS_H_
|
||||
#define GUESTFS_DAEMON_STRUCTS_CLEANUPS_H_
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
";
|
||||
|
||||
List.iter (
|
||||
@@ -1326,16 +1320,7 @@ let generate_daemon_structs_cleanups_h () =
|
||||
pr " __attribute__((cleanup(cleanup_free_int_%s_list)))\n" name
|
||||
) structs;
|
||||
|
||||
- pr "#else /* !HAVE_ATTRIBUTE_CLEANUP */\n";
|
||||
-
|
||||
- List.iter (
|
||||
- fun { s_name = name } ->
|
||||
- pr "#define CLEANUP_FREE_%s\n" (String.uppercase_ascii name);
|
||||
- pr "#define CLEANUP_FREE_%s_LIST\n" (String.uppercase_ascii name)
|
||||
- ) structs;
|
||||
-
|
||||
pr "\
|
||||
-#endif /* !HAVE_ATTRIBUTE_CLEANUP */
|
||||
|
||||
/* These functions are used internally by the CLEANUP_* macros.
|
||||
* Don't call them directly.
|
||||
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
|
||||
index 174ca135f..f9f4628aa 100644
|
||||
--- a/lib/guestfs-internal.h
|
||||
+++ b/lib/guestfs-internal.h
|
||||
@@ -661,11 +661,7 @@ extern void guestfs_int_end_stringsbuf (guestfs_h *g, struct stringsbuf *sb);
|
||||
|
||||
extern void guestfs_int_free_stringsbuf (struct stringsbuf *sb);
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_FREE_STRINGSBUF __attribute__((cleanup(guestfs_int_cleanup_free_stringsbuf)))
|
||||
-#else
|
||||
-#define CLEANUP_FREE_STRINGSBUF
|
||||
-#endif
|
||||
extern void guestfs_int_cleanup_free_stringsbuf (struct stringsbuf *sb);
|
||||
|
||||
/* proto.c */
|
||||
@@ -785,11 +781,7 @@ extern int guestfs_int_cmd_pipe_run (struct command *cmd, const char *mode);
|
||||
extern int guestfs_int_cmd_pipe_wait (struct command *cmd);
|
||||
extern char *guestfs_int_cmd_get_pipe_errors (struct command *cmd);
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_CMD_CLOSE __attribute__((cleanup(guestfs_int_cleanup_cmd_close)))
|
||||
-#else
|
||||
-#define CLEANUP_CMD_CLOSE
|
||||
-#endif
|
||||
extern void guestfs_int_cleanup_cmd_close (struct command **);
|
||||
|
||||
/* launch-*.c constructors */
|
||||
diff --git a/lib/info.c b/lib/info.c
|
||||
index 4dee7a26a..b60fc8b39 100644
|
||||
--- a/lib/info.c
|
||||
+++ b/lib/info.c
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "guestfs-internal.h"
|
||||
#include "guestfs-internal-actions.h"
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref)))
|
||||
|
||||
static void
|
||||
@@ -52,10 +51,6 @@ cleanup_json_t_decref (void *ptr)
|
||||
json_decref (* (json_t **) ptr);
|
||||
}
|
||||
|
||||
-#else
|
||||
-#define CLEANUP_JSON_T_DECREF
|
||||
-#endif
|
||||
-
|
||||
static json_t *get_json_output (guestfs_h *g, const char *filename);
|
||||
static int qemu_img_supports_U_option (guestfs_h *g);
|
||||
static void set_child_rlimits (struct command *);
|
||||
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
|
||||
index fed6dcc86..d01f65780 100644
|
||||
--- a/lib/launch-libvirt.c
|
||||
+++ b/lib/launch-libvirt.c
|
||||
@@ -97,7 +97,6 @@ xmlBufferDetach (xmlBufferPtr buf)
|
||||
}
|
||||
#endif
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_VIRSECRETFREE __attribute__((cleanup(cleanup_virSecretFree)))
|
||||
|
||||
static void
|
||||
@@ -108,10 +107,6 @@ cleanup_virSecretFree (void *ptr)
|
||||
virSecretFree (secret_obj);
|
||||
}
|
||||
|
||||
-#else /* !HAVE_ATTRIBUTE_CLEANUP */
|
||||
-#define CLEANUP_VIRSECRETFREE
|
||||
-#endif
|
||||
-
|
||||
/* List used to store a mapping of secret to libvirt secret UUID. */
|
||||
struct secret {
|
||||
char *secret;
|
||||
diff --git a/lib/qemu.c b/lib/qemu.c
|
||||
index 027790e4e..886c92e5d 100644
|
||||
--- a/lib/qemu.c
|
||||
+++ b/lib/qemu.c
|
||||
@@ -46,7 +46,6 @@
|
||||
#include "guestfs-internal.h"
|
||||
#include "guestfs_protocol.h"
|
||||
|
||||
-#ifdef HAVE_ATTRIBUTE_CLEANUP
|
||||
#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref)))
|
||||
|
||||
static void
|
||||
@@ -55,10 +54,6 @@ cleanup_json_t_decref (void *ptr)
|
||||
json_decref (* (json_t **) ptr);
|
||||
}
|
||||
|
||||
-#else
|
||||
-#define CLEANUP_JSON_T_DECREF
|
||||
-#endif
|
||||
-
|
||||
struct qemu_data {
|
||||
int generation; /* MEMO_GENERATION read from qemu.stat */
|
||||
uint64_t prev_size; /* Size of qemu binary when cached. */
|
||||
diff --git a/m4/guestfs-c.m4 b/m4/guestfs-c.m4
|
||||
index 44c64b6d6..49109cc8f 100644
|
||||
--- a/m4/guestfs-c.m4
|
||||
+++ b/m4/guestfs-c.m4
|
||||
@@ -109,15 +109,12 @@ main (int argc, char *argv[])
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_ATTRIBUTE_CLEANUP],[1],[Define to 1 if '__attribute__((cleanup(...)))' works with this compiler.])
|
||||
],[
|
||||
- AC_MSG_WARN(
|
||||
+ AC_MSG_ERROR(
|
||||
['__attribute__((cleanup(...)))' does not work.
|
||||
|
||||
You may not be using a sufficiently recent version of GCC or CLANG, or
|
||||
you may be using a C compiler which does not support this attribute,
|
||||
-or the configure test may be wrong.
|
||||
-
|
||||
-The code will still compile, but is likely to leak memory and other
|
||||
-resources when it runs.])])
|
||||
+or the configure test may be wrong.])])
|
||||
dnl restore CFLAGS
|
||||
CFLAGS="${acx_nbdkit_save_CFLAGS}"
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,56 @@
|
||||
From 53632b4b8245a6dd67c95015d52d1f4c562b14ed Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 21 Oct 2024 11:50:05 +0100
|
||||
Subject: [PATCH] appliance: Use stable owner, group and mtime in appliance
|
||||
tarballs
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2320025
|
||||
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
---
|
||||
appliance/Makefile.am | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
|
||||
index 8cb9bd1ff..7edc90e61 100644
|
||||
--- a/appliance/Makefile.am
|
||||
+++ b/appliance/Makefile.am
|
||||
@@ -113,12 +113,17 @@ packagelist: packagelist.in Makefile guestfsd.deps
|
||||
cmp -s $@ $@-t || mv $@-t $@
|
||||
rm -f $@-t
|
||||
|
||||
+# Use stable times and owner/group (RHBZ#2320025).
|
||||
+TAR_COMMAND := tar -z \
|
||||
+ --owner=0 --group=0 \
|
||||
+ $${SOURCE_DATE_EPOCH:+--mtime=@"$$SOURCE_DATE_EPOCH"}
|
||||
+
|
||||
supermin.d/daemon.tar.gz: ../daemon/guestfsd
|
||||
rm -f $@ $@-t
|
||||
rm -rf tmp-d
|
||||
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc
|
||||
ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
|
||||
- ( cd tmp-d && tar zcf - * ) > $@-t
|
||||
+ ( cd tmp-d && $(TAR_COMMAND) -cf - * ) > $@-t
|
||||
rm -r tmp-d
|
||||
mv $@-t $@
|
||||
|
||||
@@ -139,7 +144,7 @@ supermin.d/hostfiles: hostfiles.in Makefile
|
||||
|
||||
supermin.d/init.tar.gz: init
|
||||
rm -f $@ $@-t
|
||||
- ( cd $(srcdir) && tar zcf - init ) > $@-t
|
||||
+ ( cd $(srcdir) && $(TAR_COMMAND) -cf - init ) > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
# We should put this file in /lib/udev/rules.d, but put it in /etc so
|
||||
@@ -149,7 +154,7 @@ supermin.d/udev-rules.tar.gz: 99-guestfs-serial.rules
|
||||
rm -rf tmp-u
|
||||
mkdir -p tmp-u/etc/udev/rules.d
|
||||
for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$(basename $$f); done
|
||||
- ( cd tmp-u && tar zcf - etc ) > $@-t
|
||||
+ ( cd tmp-u && $(TAR_COMMAND) -cf - etc ) > $@-t
|
||||
rm -r tmp-u
|
||||
mv $@-t $@
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,58 @@
|
||||
From 798e3e59b2af5057521c170268c03ab88aaf1307 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 22 Oct 2024 09:14:15 +0100
|
||||
Subject: [PATCH] appliance: Refactor the TAR_COMMAND macro
|
||||
|
||||
No change, just make it easier to understand.
|
||||
|
||||
Updates: commit 53632b4b8245a6dd67c95015d52d1f4c562b14ed
|
||||
---
|
||||
appliance/Makefile.am | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
|
||||
index 7edc90e61..ce9940358 100644
|
||||
--- a/appliance/Makefile.am
|
||||
+++ b/appliance/Makefile.am
|
||||
@@ -113,8 +113,9 @@ packagelist: packagelist.in Makefile guestfsd.deps
|
||||
cmp -s $@ $@-t || mv $@-t $@
|
||||
rm -f $@-t
|
||||
|
||||
-# Use stable times and owner/group (RHBZ#2320025).
|
||||
-TAR_COMMAND := tar -z \
|
||||
+# Use stable owner/group and mtimes (RHBZ#2320025).
|
||||
+TAR_OPTIONS := \
|
||||
+ -z \
|
||||
--owner=0 --group=0 \
|
||||
$${SOURCE_DATE_EPOCH:+--mtime=@"$$SOURCE_DATE_EPOCH"}
|
||||
|
||||
@@ -123,7 +124,7 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd
|
||||
rm -rf tmp-d
|
||||
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc
|
||||
ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
|
||||
- ( cd tmp-d && $(TAR_COMMAND) -cf - * ) > $@-t
|
||||
+ ( cd tmp-d && tar $(TAR_OPTIONS) -cf - * ) > $@-t
|
||||
rm -r tmp-d
|
||||
mv $@-t $@
|
||||
|
||||
@@ -144,7 +145,7 @@ supermin.d/hostfiles: hostfiles.in Makefile
|
||||
|
||||
supermin.d/init.tar.gz: init
|
||||
rm -f $@ $@-t
|
||||
- ( cd $(srcdir) && $(TAR_COMMAND) -cf - init ) > $@-t
|
||||
+ ( cd $(srcdir) && tar $(TAR_OPTIONS) -cf - init ) > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
# We should put this file in /lib/udev/rules.d, but put it in /etc so
|
||||
@@ -154,7 +155,7 @@ supermin.d/udev-rules.tar.gz: 99-guestfs-serial.rules
|
||||
rm -rf tmp-u
|
||||
mkdir -p tmp-u/etc/udev/rules.d
|
||||
for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$(basename $$f); done
|
||||
- ( cd tmp-u && $(TAR_COMMAND) -cf - etc ) > $@-t
|
||||
+ ( cd tmp-u && tar $(TAR_OPTIONS) -cf - etc ) > $@-t
|
||||
rm -r tmp-u
|
||||
mv $@-t $@
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,48 @@
|
||||
From 53872a0a1a267040677572c30b68bd1e8b62ebe3 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 22 Oct 2024 11:01:25 +0100
|
||||
Subject: [PATCH] build: Add new dependency on json-c
|
||||
|
||||
This will eventually replace Jansson for all JSON parsing. However
|
||||
this commit simply introduces the new dependency in the configure
|
||||
script and documents it.
|
||||
|
||||
I chose json-c 0.14 as the baseline since that is the version in RHEL 9.
|
||||
Probably earlier versions would work.
|
||||
---
|
||||
docs/guestfs-building.pod | 4 ++++
|
||||
m4/guestfs-libraries.m4 | 3 +++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
|
||||
index 2c0845212..de175aaff 100644
|
||||
--- a/docs/guestfs-building.pod
|
||||
+++ b/docs/guestfs-building.pod
|
||||
@@ -189,6 +189,10 @@ I<Required>.
|
||||
|
||||
I<Required>.
|
||||
|
||||
+=item json-c E<ge> 0.14
|
||||
+
|
||||
+I<Required>.
|
||||
+
|
||||
=item po4a
|
||||
|
||||
I<Required> if compiling from git.
|
||||
diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
|
||||
index 18c4cd307..ee406d273 100644
|
||||
--- a/m4/guestfs-libraries.m4
|
||||
+++ b/m4/guestfs-libraries.m4
|
||||
@@ -304,6 +304,9 @@ LIBS="$old_LIBS"
|
||||
dnl Check for Jansson JSON library (required).
|
||||
PKG_CHECK_MODULES([JANSSON], [jansson >= 2.7])
|
||||
|
||||
+dnl Check for JSON-C library (required).
|
||||
+PKG_CHECK_MODULES([JSON_C], [json-c >= 0.14])
|
||||
+
|
||||
dnl Check for C++ (optional, we just use this to test the header works).
|
||||
AC_PROG_CXX
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,234 @@
|
||||
From 5ea1e899e00f49ed27f25697e632d864760faf96 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 18 Oct 2024 21:44:13 +0100
|
||||
Subject: [PATCH] daemon/ldm.c: Replace jansson with json-c
|
||||
|
||||
---
|
||||
daemon/Makefile.am | 4 +--
|
||||
daemon/ldm.c | 89 +++++++++++++++++++++++++---------------------
|
||||
2 files changed, 51 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
|
||||
index bc74b6ef7..bb72c0244 100644
|
||||
--- a/daemon/Makefile.am
|
||||
+++ b/daemon/Makefile.am
|
||||
@@ -225,7 +225,7 @@ guestfsd_LDADD = \
|
||||
camldaemon.o \
|
||||
$(ACL_LIBS) \
|
||||
$(CAP_LIBS) \
|
||||
- $(JANSSON_LIBS) \
|
||||
+ $(JSON_C_LIBS) \
|
||||
$(SELINUX_LIBS) \
|
||||
$(AUGEAS_LIBS) \
|
||||
$(HIVEX_LIBS) \
|
||||
@@ -264,7 +264,7 @@ guestfsd_CFLAGS = \
|
||||
$(AUGEAS_CFLAGS) \
|
||||
$(HIVEX_CFLAGS) \
|
||||
$(SD_JOURNAL_CFLAGS) \
|
||||
- $(JANSSON_CFLAGS) \
|
||||
+ $(JSON_C_CFLAGS) \
|
||||
$(PCRE2_CFLAGS) \
|
||||
$(LIBRPM_CFLAGS)
|
||||
|
||||
diff --git a/daemon/ldm.c b/daemon/ldm.c
|
||||
index be4fb9701..1488b9259 100644
|
||||
--- a/daemon/ldm.c
|
||||
+++ b/daemon/ldm.c
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
|
||||
-#include <jansson.h>
|
||||
+#include <json.h>
|
||||
|
||||
#include "daemon.h"
|
||||
#include "actions.h"
|
||||
@@ -65,44 +65,54 @@ do_ldmtool_remove_all (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static json_t *
|
||||
-parse_json (const char *json, const char *func)
|
||||
+static json_object *
|
||||
+parse_json (const char *json, const char *caller)
|
||||
{
|
||||
- json_t *tree;
|
||||
- json_error_t err;
|
||||
+ json_object *tree = NULL;
|
||||
+ json_tokener *tok = NULL;
|
||||
+ enum json_tokener_error err;
|
||||
|
||||
if (verbose)
|
||||
- fprintf (stderr, "%s: parsing json: %s\n", func, json);
|
||||
+ fprintf (stderr, "%s: parsing json: %s\n", caller, json);
|
||||
|
||||
- tree = json_loads (json, 0, &err);
|
||||
- if (tree == NULL) {
|
||||
- reply_with_error ("parse error: %s",
|
||||
- strlen (err.text) ? err.text : "unknown error");
|
||||
+ tok = json_tokener_new ();
|
||||
+ json_tokener_set_flags (tok,
|
||||
+ JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8);
|
||||
+ tree = json_tokener_parse_ex (tok, json, strlen (json));
|
||||
+ err = json_tokener_get_error (tok);
|
||||
+ if (err != json_tokener_success) {
|
||||
+ reply_with_error ("%s: parse error: %s",
|
||||
+ caller, json_tokener_error_desc (err));
|
||||
+ json_tokener_free (tok);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- /* Caller should free this by doing 'json_decref (tree);'. */
|
||||
+ json_tokener_free (tok);
|
||||
+
|
||||
+ /* Caller should free this by doing json_object_put (tree). */
|
||||
return tree;
|
||||
}
|
||||
|
||||
#define TYPE_ERROR ((char **) -1)
|
||||
|
||||
static char **
|
||||
-json_value_to_string_list (json_t *node)
|
||||
+json_value_to_string_list (json_object *node)
|
||||
{
|
||||
CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (strs);
|
||||
- json_t *n;
|
||||
+ json_object *n;
|
||||
size_t i;
|
||||
|
||||
- if (!json_is_array (node))
|
||||
+ if (json_object_get_type (node) != json_type_array)
|
||||
return TYPE_ERROR;
|
||||
|
||||
- json_array_foreach (node, i, n) {
|
||||
- if (!json_is_string (n))
|
||||
+ for (i = 0; i < json_object_array_length (node); ++i) {
|
||||
+ n = json_object_array_get_idx (node, i); /* Doesn't incr the refcount. */
|
||||
+ if (json_object_get_type (n) != json_type_string)
|
||||
return TYPE_ERROR;
|
||||
- if (add_string (&strs, json_string_value (n)) == -1)
|
||||
+ if (add_string (&strs, json_object_get_string (n)) == -1)
|
||||
return NULL;
|
||||
}
|
||||
+
|
||||
if (end_stringsbuf (&strs) == -1)
|
||||
return NULL;
|
||||
|
||||
@@ -111,17 +121,17 @@ json_value_to_string_list (json_t *node)
|
||||
|
||||
static char **
|
||||
parse_json_get_string_list (const char *json,
|
||||
- const char *func, const char *cmd)
|
||||
+ const char *caller, const char *cmd)
|
||||
{
|
||||
char **ret;
|
||||
- json_t *tree = NULL;
|
||||
+ json_object *tree = NULL;
|
||||
|
||||
- tree = parse_json (json, func);
|
||||
+ tree = parse_json (json, caller);
|
||||
if (tree == NULL)
|
||||
return NULL;
|
||||
|
||||
ret = json_value_to_string_list (tree);
|
||||
- json_decref (tree);
|
||||
+ json_object_put (tree);
|
||||
if (ret == TYPE_ERROR) {
|
||||
reply_with_error ("output of '%s' was not a JSON array of strings", cmd);
|
||||
return NULL;
|
||||
@@ -133,74 +143,73 @@ parse_json_get_string_list (const char *json,
|
||||
|
||||
static char *
|
||||
parse_json_get_object_string (const char *json, const char *key, int flags,
|
||||
- const char *func, const char *cmd)
|
||||
+ const char *caller, const char *cmd)
|
||||
{
|
||||
const char *str;
|
||||
char *ret;
|
||||
- json_t *tree = NULL, *node;
|
||||
+ json_object *tree = NULL, *node;
|
||||
|
||||
- tree = parse_json (json, func);
|
||||
+ tree = parse_json (json, caller);
|
||||
if (tree == NULL)
|
||||
return NULL;
|
||||
|
||||
- if (!json_is_object (tree))
|
||||
+ if (json_object_get_type (tree) != json_type_object)
|
||||
goto bad_type;
|
||||
|
||||
- node = json_object_get (tree, key);
|
||||
+ node = json_object_object_get (tree, key);
|
||||
if (node == NULL)
|
||||
goto bad_type;
|
||||
|
||||
- if ((flags & GET_STRING_NULL_TO_EMPTY) && json_is_null (node))
|
||||
+ if ((flags & GET_STRING_NULL_TO_EMPTY) &&
|
||||
+ json_object_get_type (node) == json_type_null)
|
||||
ret = strdup ("");
|
||||
else {
|
||||
- str = json_string_value (node);
|
||||
- if (str == NULL)
|
||||
- goto bad_type;
|
||||
- ret = strndup (str, json_string_length (node));
|
||||
+ str = json_object_get_string (node);
|
||||
+ ret = strndup (str, strlen (str));
|
||||
}
|
||||
if (ret == NULL)
|
||||
reply_with_perror ("strdup");
|
||||
|
||||
- json_decref (tree);
|
||||
+ json_object_put (tree);
|
||||
|
||||
return ret;
|
||||
|
||||
bad_type:
|
||||
reply_with_error ("output of '%s' was not a JSON object "
|
||||
"containing a key '%s' of type string", cmd, key);
|
||||
- json_decref (tree);
|
||||
+ json_object_put (tree);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char **
|
||||
parse_json_get_object_string_list (const char *json, const char *key,
|
||||
- const char *func, const char *cmd)
|
||||
+ const char *caller, const char *cmd)
|
||||
{
|
||||
char **ret;
|
||||
- json_t *tree, *node;
|
||||
+ json_object *tree, *node;
|
||||
|
||||
- tree = parse_json (json, func);
|
||||
+ tree = parse_json (json, caller);
|
||||
if (tree == NULL)
|
||||
return NULL;
|
||||
|
||||
- if (!json_is_object (tree))
|
||||
+ if (json_object_get_type (tree) != json_type_object)
|
||||
goto bad_type;
|
||||
|
||||
- node = json_object_get (tree, key);
|
||||
+ node = json_object_object_get (tree, key);
|
||||
if (node == NULL)
|
||||
goto bad_type;
|
||||
|
||||
ret = json_value_to_string_list (node);
|
||||
if (ret == TYPE_ERROR)
|
||||
goto bad_type;
|
||||
- json_decref (tree);
|
||||
+ json_object_put (tree);
|
||||
return ret;
|
||||
|
||||
bad_type:
|
||||
reply_with_error ("output of '%s' was not a JSON object "
|
||||
"containing a key '%s' of type array of strings",
|
||||
cmd, key);
|
||||
- json_decref (tree);
|
||||
+ json_object_put (tree);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,158 @@
|
||||
From 9e3c1f44cafc2ce568462fcedc0033cab7d94cae Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 22 Oct 2024 16:24:30 +0100
|
||||
Subject: [PATCH] lib/qemu.c: Replace jansson with json-c
|
||||
|
||||
---
|
||||
lib/qemu.c | 73 ++++++++++++++++++++++++++++--------------------------
|
||||
1 file changed, 38 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/lib/qemu.c b/lib/qemu.c
|
||||
index f92707710..1d7f45f00 100644
|
||||
--- a/lib/qemu.c
|
||||
+++ b/lib/qemu.c
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <libxml/uri.h>
|
||||
|
||||
-#include <jansson.h>
|
||||
+#include <json.h>
|
||||
|
||||
#include "full-write.h"
|
||||
#include "ignore-value.h"
|
||||
@@ -46,12 +46,13 @@
|
||||
#include "guestfs-internal.h"
|
||||
#include "guestfs_protocol.h"
|
||||
|
||||
-#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref)))
|
||||
+#define CLEANUP_JSON_OBJECT_PUT \
|
||||
+ __attribute__((cleanup(cleanup_json_object_put)))
|
||||
|
||||
static void
|
||||
-cleanup_json_t_decref (void *ptr)
|
||||
+cleanup_json_object_put (void *ptr)
|
||||
{
|
||||
- json_decref (* (json_t **) ptr);
|
||||
+ json_object_put (* (json_object **) ptr);
|
||||
}
|
||||
|
||||
struct qemu_data {
|
||||
@@ -66,7 +67,7 @@ struct qemu_data {
|
||||
|
||||
/* The following fields are derived from the fields above. */
|
||||
struct version qemu_version; /* Parsed qemu version number. */
|
||||
- json_t *qmp_schema_tree; /* qmp_schema parsed into a JSON tree */
|
||||
+ json_object *qmp_schema_tree; /* qmp_schema parsed into a JSON tree */
|
||||
bool has_kvm; /* If KVM is available. */
|
||||
};
|
||||
|
||||
@@ -86,7 +87,7 @@ static int write_cache_query_kvm (guestfs_h *g, const struct qemu_data *data, co
|
||||
static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *filename);
|
||||
static int write_cache_qemu_stat (guestfs_h *g, const struct qemu_data *data, const char *filename);
|
||||
static void parse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version);
|
||||
-static void parse_json (guestfs_h *g, const char *, json_t **);
|
||||
+static void parse_json (guestfs_h *g, const char *, json_object **);
|
||||
static void parse_has_kvm (guestfs_h *g, const char *, bool *);
|
||||
static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len);
|
||||
static int generic_read_cache (guestfs_h *g, const char *filename, char **strp);
|
||||
@@ -442,20 +443,24 @@ parse_qemu_version (guestfs_h *g, const char *qemu_help,
|
||||
* is not possible.
|
||||
*/
|
||||
static void
|
||||
-parse_json (guestfs_h *g, const char *json, json_t **treep)
|
||||
+parse_json (guestfs_h *g, const char *json, json_object **treep)
|
||||
{
|
||||
- json_error_t err;
|
||||
+ json_tokener *tok;
|
||||
+ enum json_tokener_error err;
|
||||
|
||||
if (!json)
|
||||
return;
|
||||
|
||||
- *treep = json_loads (json, 0, &err);
|
||||
- if (*treep == NULL) {
|
||||
- if (strlen (err.text) > 0)
|
||||
- debug (g, "QMP parse error: %s (ignored)", err.text);
|
||||
- else
|
||||
- debug (g, "QMP unknown parse error (ignored)");
|
||||
- }
|
||||
+ tok = json_tokener_new ();
|
||||
+ json_tokener_set_flags (tok,
|
||||
+ JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8);
|
||||
+ *treep = json_tokener_parse_ex (tok, json, strlen (json));
|
||||
+ err = json_tokener_get_error (tok);
|
||||
+ if (err != json_tokener_success)
|
||||
+ debug (g, "QMP parse error: %s (ignored)", json_tokener_error_desc (err));
|
||||
+ json_tokener_free (tok);
|
||||
+
|
||||
+ /* Caller should do json_object_put (*treep) */
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -469,37 +474,35 @@ parse_json (guestfs_h *g, const char *json, json_t **treep)
|
||||
static void
|
||||
parse_has_kvm (guestfs_h *g, const char *json, bool *ret)
|
||||
{
|
||||
- CLEANUP_JSON_T_DECREF json_t *tree = NULL;
|
||||
- json_error_t err;
|
||||
- json_t *return_node, *enabled_node;
|
||||
+ CLEANUP_JSON_OBJECT_PUT json_object *tree = NULL;
|
||||
+ json_tokener *tok;
|
||||
+ enum json_tokener_error err;
|
||||
+ json_object *return_node, *enabled_node;
|
||||
|
||||
*ret = true; /* Assume KVM is enabled. */
|
||||
|
||||
if (!json)
|
||||
return;
|
||||
|
||||
- tree = json_loads (json, 0, &err);
|
||||
- if (tree == NULL) {
|
||||
- if (strlen (err.text) > 0)
|
||||
- debug (g, "QMP parse error: %s (ignored)", err.text);
|
||||
- else
|
||||
- debug (g, "QMP unknown parse error (ignored)");
|
||||
+ tok = json_tokener_new ();
|
||||
+ json_tokener_set_flags (tok,
|
||||
+ JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8);
|
||||
+ tree = json_tokener_parse_ex (tok, json, strlen (json));
|
||||
+ err = json_tokener_get_error (tok);
|
||||
+ if (err != json_tokener_success) {
|
||||
+ debug (g, "QMP parse error: %s (ignored)", json_tokener_error_desc (err));
|
||||
+ json_tokener_free (tok);
|
||||
return;
|
||||
}
|
||||
+ json_tokener_free (tok);
|
||||
|
||||
- return_node = json_object_get (tree, "return");
|
||||
- if (!json_is_object (return_node)) {
|
||||
+ return_node = json_object_object_get (tree, "return");
|
||||
+ if (json_object_get_type (return_node) != json_type_object) {
|
||||
debug (g, "QMP query-kvm: no \"return\" node (ignored)");
|
||||
return;
|
||||
}
|
||||
- enabled_node = json_object_get (return_node, "enabled");
|
||||
- /* Note that json_is_boolean will check that enabled_node != NULL. */
|
||||
- if (!json_is_boolean (enabled_node)) {
|
||||
- debug (g, "QMP query-kvm: no \"enabled\" node or not a boolean (ignored)");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- *ret = json_is_true (enabled_node);
|
||||
+ enabled_node = json_object_object_get (return_node, "enabled");
|
||||
+ *ret = json_object_get_boolean (enabled_node);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -975,7 +978,7 @@ guestfs_int_free_qemu_data (struct qemu_data *data)
|
||||
free (data->qemu_devices);
|
||||
free (data->qmp_schema);
|
||||
free (data->query_kvm);
|
||||
- json_decref (data->qmp_schema_tree);
|
||||
+ json_object_put (data->qmp_schema_tree);
|
||||
free (data);
|
||||
}
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,68 @@
|
||||
From 9255abee029e35dd5c6783b8b6037eb71104650c Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 22 Oct 2024 15:22:18 +0100
|
||||
Subject: [PATCH] build: Remove Jansson dependency
|
||||
|
||||
After previous changes, this library is no longer used. We have
|
||||
switched to json-c, for better compatibility with libvirt.
|
||||
|
||||
(cherry picked from
|
||||
guestfs-tools commit e6dcf7e3a7e9170978e57ce6df1b34f92fac5ae3)
|
||||
---
|
||||
docs/guestfs-building.pod | 4 ----
|
||||
lib/Makefile.am | 2 --
|
||||
m4/guestfs-libraries.m4 | 3 ---
|
||||
3 files changed, 9 deletions(-)
|
||||
|
||||
diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
|
||||
index de175aaff..aef716ffc 100644
|
||||
--- a/docs/guestfs-building.pod
|
||||
+++ b/docs/guestfs-building.pod
|
||||
@@ -185,10 +185,6 @@ I<Required>.
|
||||
|
||||
I<Required>.
|
||||
|
||||
-=item Jansson E<ge> 2.7
|
||||
-
|
||||
-I<Required>.
|
||||
-
|
||||
=item json-c E<ge> 0.14
|
||||
|
||||
I<Required>.
|
||||
diff --git a/lib/Makefile.am b/lib/Makefile.am
|
||||
index 60567b04b..6949884d5 100644
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -138,7 +138,6 @@ libguestfs_la_CFLAGS = \
|
||||
$(PCRE2_CFLAGS) \
|
||||
$(LIBVIRT_CFLAGS) \
|
||||
$(LIBXML2_CFLAGS) \
|
||||
- $(JANSSON_CFLAGS) \
|
||||
$(JSON_C_CFLAGS)
|
||||
|
||||
libguestfs_la_LIBADD = \
|
||||
@@ -150,7 +149,6 @@ libguestfs_la_LIBADD = \
|
||||
$(PCRE2_LIBS) \
|
||||
$(LIBVIRT_LIBS) $(LIBXML2_LIBS) \
|
||||
$(SELINUX_LIBS) \
|
||||
- $(JANSSON_LIBS) \
|
||||
$(JSON_C_LIBS) \
|
||||
../gnulib/lib/libgnu.la \
|
||||
$(LIBSOCKET) \
|
||||
diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
|
||||
index ee406d273..515651717 100644
|
||||
--- a/m4/guestfs-libraries.m4
|
||||
+++ b/m4/guestfs-libraries.m4
|
||||
@@ -301,9 +301,6 @@ LIBS="$LIBS $LIBXML2_LIBS"
|
||||
AC_CHECK_FUNCS([xmlBufferDetach])
|
||||
LIBS="$old_LIBS"
|
||||
|
||||
-dnl Check for Jansson JSON library (required).
|
||||
-PKG_CHECK_MODULES([JANSSON], [jansson >= 2.7])
|
||||
-
|
||||
dnl Check for JSON-C library (required).
|
||||
PKG_CHECK_MODULES([JSON_C], [json-c >= 0.14])
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -0,0 +1,26 @@
|
||||
From 4ea26a26557e0e648477526bae2313275e975f20 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 22 Oct 2024 17:44:06 +0100
|
||||
Subject: [PATCH] website: Fix link to latest development version
|
||||
|
||||
Fixes: commit 0edaea8f91bf08025651eeff32f53b9335003842
|
||||
---
|
||||
website/index.html.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/website/index.html.in b/website/index.html.in
|
||||
index 2a0d32217..13c5ff25f 100644
|
||||
--- a/website/index.html.in
|
||||
+++ b/website/index.html.in
|
||||
@@ -183,7 +183,7 @@ git clone <a href="https://github.com/libguestfs/libguestfs">https://github.com/
|
||||
<p class="latest">
|
||||
<em><small>
|
||||
<!--
|
||||
-LATEST-URL: http://libguestfs.org/download/1.53-development/libguestfs-@PACKAGE_VERSION@.tar.gz
|
||||
+LATEST-URL: http://libguestfs.org/download/1.55-development/libguestfs-@PACKAGE_VERSION@.tar.gz
|
||||
LATEST-VERSION: @PACKAGE_VERSION@
|
||||
-->
|
||||
<a href="download/1.55-development/">Latest development version: <strong>@PACKAGE_VERSION@</strong></a> (released <strong>@RELEASE_DATE@</strong>).<br/>
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 5efb2b2ab438f7621897e0da8602cf6d81a03ce2 Mon Sep 17 00:00:00 2001
|
||||
From c508b3390245bbecfa8acf785b7d7bfd215859ae Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 29 Jul 2013 14:47:56 +0100
|
||||
Subject: [PATCH] RHEL: Disable unsupported remote drive protocols
|
Loading…
Reference in new issue