Compare commits
10 Commits
73bd0ce91f
...
2627294ea7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2627294ea7 | ||
|
|
47b59fae45 | ||
|
|
0f90c6d555 | ||
|
|
a4614f322c | ||
|
|
73300eee05 | ||
|
|
8bd1276107 | ||
|
|
09304abc48 | ||
|
|
b5e9a4c655 | ||
|
|
e67399d2b1 | ||
|
|
7d800487af |
145
0001-tests-Use-explicit-backing-format-for-all-backing-di.patch
Normal file
145
0001-tests-Use-explicit-backing-format-for-all-backing-di.patch
Normal file
@ -0,0 +1,145 @@
|
||||
From 815eab8a66ba6ae5bea7445abb0fa8b54e01e158 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 6 Feb 2020 15:47:54 +0000
|
||||
Subject: [PATCH] tests: Use explicit backing format for all backing disks.
|
||||
|
||||
Libvirt 6.0 now requires that every disk in the backing chain has an
|
||||
explicit backing format. For example this will be rejected by
|
||||
libvirt:
|
||||
|
||||
qemu-img create -f qcow2 -b backing-disk disk.qcow2
|
||||
|
||||
with the error:
|
||||
|
||||
Original error from libvirt: Requested operation is not valid:
|
||||
format of backing image 'backing-disk' of image 'disk.qcow2' was not
|
||||
specified in the image metadata (See
|
||||
https://libvirt.org/kbase/backing_chains.html for troubleshooting)
|
||||
[code=55 int1=-1]
|
||||
|
||||
Instead you have to use the -F option to specify the format, eg:
|
||||
|
||||
qemu-img create -f qcow2 -b backing-disk -F raw disk.qcow2
|
||||
---
|
||||
customize/test-virt-customize.sh | 2 +-
|
||||
test-data/blank-disks/Makefile.am | 2 +-
|
||||
tests/relative-paths/test-relative-paths.sh | 30 ++++++++++-----------
|
||||
3 files changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/customize/test-virt-customize.sh b/customize/test-virt-customize.sh
|
||||
index 0c5231b4e..7817e67d4 100755
|
||||
--- a/customize/test-virt-customize.sh
|
||||
+++ b/customize/test-virt-customize.sh
|
||||
@@ -27,7 +27,7 @@ f=$top_builddir/test-data/phony-guests/fedora.img
|
||||
fq=test-virt-customize-img.qcow
|
||||
out=test-virt-customize.out
|
||||
rm -f $fq $out
|
||||
-qemu-img create -f qcow2 -b $f $fq
|
||||
+qemu-img create -f qcow2 -b $f -F raw $fq
|
||||
|
||||
# Add --no-network so UML works.
|
||||
$VG virt-customize --format qcow2 -a $fq --no-network \
|
||||
diff --git a/test-data/blank-disks/Makefile.am b/test-data/blank-disks/Makefile.am
|
||||
index da5692da3..6dd42bc1f 100644
|
||||
--- a/test-data/blank-disks/Makefile.am
|
||||
+++ b/test-data/blank-disks/Makefile.am
|
||||
@@ -50,4 +50,4 @@ blank-disk-1M.qcow2:
|
||||
qemu-img create -f qcow2 -o preallocation=metadata $@ 1M
|
||||
|
||||
blank-disk-with-backing.qcow2: blank-disk-1M.raw
|
||||
- qemu-img create -f qcow2 -b $^ $@
|
||||
+ qemu-img create -f qcow2 -b $^ -F raw $@
|
||||
diff --git a/tests/relative-paths/test-relative-paths.sh b/tests/relative-paths/test-relative-paths.sh
|
||||
index 379225903..ed9aa80d8 100755
|
||||
--- a/tests/relative-paths/test-relative-paths.sh
|
||||
+++ b/tests/relative-paths/test-relative-paths.sh
|
||||
@@ -36,63 +36,63 @@ mkdir -p dir1/dir2
|
||||
# Regular overlay files.
|
||||
|
||||
qemu-img create -f qcow2 backing1 10M
|
||||
-qemu-img create -f qcow2 -b $(pwd)/backing1 overlay1
|
||||
+qemu-img create -f qcow2 -b $(pwd)/backing1 -F qcow2 overlay1
|
||||
|
||||
qemu-img create -f qcow2 backing2 10M
|
||||
-qemu-img create -f qcow2 -b backing2 overlay2
|
||||
+qemu-img create -f qcow2 -b backing2 -F qcow2 overlay2
|
||||
|
||||
qemu-img create -f qcow2 backing3 10M
|
||||
-qemu-img create -f qcow2 -b ./backing3 overlay3
|
||||
+qemu-img create -f qcow2 -b ./backing3 -F qcow2 overlay3
|
||||
|
||||
qemu-img create -f qcow2 backing4 10M
|
||||
-qemu-img create -f qcow2 -b ../../tests/relative-paths/backing4 overlay4
|
||||
+qemu-img create -f qcow2 -b ../../tests/relative-paths/backing4 -F qcow2 overlay4
|
||||
|
||||
qemu-img create -f qcow2 backing5 10M
|
||||
pushd dir1
|
||||
-qemu-img create -f qcow2 -b ../backing5 overlay5
|
||||
+qemu-img create -f qcow2 -b ../backing5 -F qcow2 overlay5
|
||||
popd
|
||||
|
||||
qemu-img create -f qcow2 backing6 10M
|
||||
pushd dir1/dir2
|
||||
-qemu-img create -f qcow2 -b ../../backing6 overlay6
|
||||
+qemu-img create -f qcow2 -b ../../backing6 -F qcow2 overlay6
|
||||
popd
|
||||
|
||||
qemu-img create -f qcow2 dir1/backing7 10M
|
||||
-qemu-img create -f qcow2 -b dir1/backing7 overlay7
|
||||
+qemu-img create -f qcow2 -b dir1/backing7 -F qcow2 overlay7
|
||||
|
||||
qemu-img create -f qcow2 dir1/dir2/backing8 10M
|
||||
-qemu-img create -f qcow2 -b dir1/dir2/backing8 overlay8
|
||||
+qemu-img create -f qcow2 -b dir1/dir2/backing8 -F qcow2 overlay8
|
||||
|
||||
qemu-img create -f qcow2 dir1/dir2/backing9 10M
|
||||
pushd dir1
|
||||
-qemu-img create -f qcow2 -b dir2/backing9 overlay9
|
||||
+qemu-img create -f qcow2 -b dir2/backing9 -F qcow2 overlay9
|
||||
popd
|
||||
|
||||
qemu-img create -f qcow2 dir1/backing10 10M
|
||||
pushd dir1/dir2
|
||||
-qemu-img create -f qcow2 -b ../backing10 overlay10
|
||||
+qemu-img create -f qcow2 -b ../backing10 -F qcow2 overlay10
|
||||
popd
|
||||
|
||||
qemu-img create -f qcow2 dir1/backing11 10M
|
||||
pushd dir1
|
||||
-qemu-img create -f qcow2 -b backing11 overlay11
|
||||
+qemu-img create -f qcow2 -b backing11 -F qcow2 overlay11
|
||||
popd
|
||||
|
||||
# Symbolic links.
|
||||
|
||||
qemu-img create -f qcow2 backing12 10M
|
||||
-qemu-img create -f qcow2 -b backing12 overlay12
|
||||
+qemu-img create -f qcow2 -b backing12 -F qcow2 overlay12
|
||||
ln -s overlay12 link12
|
||||
|
||||
qemu-img create -f qcow2 dir1/backing13 10M
|
||||
pushd dir1
|
||||
-qemu-img create -f qcow2 -b backing13 overlay13
|
||||
+qemu-img create -f qcow2 -b backing13 -F qcow2 overlay13
|
||||
popd
|
||||
ln -s dir1/overlay13 link13
|
||||
|
||||
qemu-img create -f qcow2 dir1/dir2/backing14 10M
|
||||
pushd dir1
|
||||
-qemu-img create -f qcow2 -b dir2/backing14 overlay14
|
||||
+qemu-img create -f qcow2 -b dir2/backing14 -F qcow2 overlay14
|
||||
popd
|
||||
pushd dir1/dir2
|
||||
ln -s ../overlay14 link14
|
||||
@@ -100,7 +100,7 @@ popd
|
||||
|
||||
qemu-img create -f qcow2 dir1/backing15 10M
|
||||
pushd dir1/dir2
|
||||
-qemu-img create -f qcow2 -b ../backing15 overlay15
|
||||
+qemu-img create -f qcow2 -b ../backing15 -F qcow2 overlay15
|
||||
popd
|
||||
pushd dir1
|
||||
ln -s dir2/overlay15 link15
|
||||
--
|
||||
2.27.0
|
||||
|
||||
28
Fix-defaut-function-compare-error.patch
Normal file
28
Fix-defaut-function-compare-error.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From cc4ecbe236914f9b391ecf3815008547472632f8 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 2 Mar 2021 10:39:15 +0000
|
||||
Subject: [PATCH] mlstdutils/std_utils.ml: Fix for OCaml 4.12.
|
||||
|
||||
We were using a default function from somewhere called "compare"
|
||||
instead of the actual function (Pervasives.compare / Stdlib.compare).
|
||||
Since the wrong default function was used it had a different type from
|
||||
what we expected:
|
||||
File "std_utils.ml", line 312, characters 36-37:
|
||||
312 | | (y, y') :: _ when cmp x y = 0 -> y'
|
||||
|
||||
Error: This expression has type int but an expression was expected of type
|
||||
'weak1 list -> int
|
||||
|
||||
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
|
||||
index 70156d1..3cacf36 100644
|
||||
--- a/common/mlstdutils/std_utils.ml
|
||||
+++ b/common/mlstdutils/std_utils.ml
|
||||
@@ -305,7 +305,7 @@ module List = struct
|
||||
| x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs
|
||||
| _ -> invalid_arg "combine3"
|
||||
|
||||
- let rec assoc_lbl ?(cmp = compare) ~default x = function
|
||||
+ let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function
|
||||
| [] -> default
|
||||
| (y, y') :: _ when cmp x y = 0 -> y'
|
||||
| _ :: ys -> assoc_lbl ~cmp ~default x ys
|
||||
39
Fix-verbose-error.patch
Normal file
39
Fix-verbose-error.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From 1941593585574849dd72c458535cd80b4d858266 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 10 Dec 2021 10:20:34 +0000
|
||||
Subject: [PATCH] Disable OCaml warning 6 completely
|
||||
|
||||
Warning 6 "labels-omitted" is not useful. It's fine to omit labels on
|
||||
positional arguments.
|
||||
|
||||
Example:
|
||||
|
||||
File "perl_edit.ml", line 30, characters 2-13:
|
||||
30 | c_edit_file (verbose ()) g (Guestfs.c_pointer g) file expr
|
||||
^^^^^^^^^^^
|
||||
Warning 6 [labels-omitted]: label verbose was omitted in the application of this function.
|
||||
|
||||
The function is specified as:
|
||||
|
||||
external c_edit_file : verbose:bool -> Guestfs.t -> int64 -> string -> string -> unit
|
||||
|
||||
The complaint is that the verbose: label has been omitted from the
|
||||
first argument when the function is called, but IMO this is a
|
||||
stylistic thing, not a bug.
|
||||
|
||||
(cherry picked from
|
||||
guestfs-tools commit 577f7aee4b1c720f4c4826115b49a0c3870b149e)
|
||||
|
||||
diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4
|
||||
index 3c504ce..5604574 100644
|
||||
--- a/m4/guestfs-ocaml.m4
|
||||
+++ b/m4/guestfs-ocaml.m4
|
||||
@@ -222,7 +222,7 @@ AS_IF([test "x$have_Hivex_OPEN_UNSAFE" = "xno"],[
|
||||
AC_SUBST([HIVEX_OPEN_UNSAFE_FLAG])
|
||||
|
||||
dnl Flags we want to pass to every OCaml compiler call.
|
||||
-OCAML_WARN_ERROR="-warn-error CDEFLMPSUVYZX+52-3"
|
||||
+OCAML_WARN_ERROR="-warn-error CDEFLMPSUVYZX+52-3 -w -6"
|
||||
AC_SUBST([OCAML_WARN_ERROR])
|
||||
OCAML_FLAGS="-g -annot $safe_string_option"
|
||||
AC_SUBST([OCAML_FLAGS])
|
||||
20
add-some-package-to-fix-run-error.patch
Normal file
20
add-some-package-to-fix-run-error.patch
Normal file
@ -0,0 +1,20 @@
|
||||
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
|
||||
index 8d2e9d4..6df9de9 100644
|
||||
--- a/appliance/packagelist.in
|
||||
+++ b/appliance/packagelist.in
|
||||
@@ -276,6 +276,15 @@ util-linux
|
||||
util-linux-ng
|
||||
xfsprogs
|
||||
zerofree
|
||||
+jansson
|
||||
+augeas
|
||||
+hivex
|
||||
+libcap
|
||||
+libldm
|
||||
+libtirpc
|
||||
+pcre
|
||||
+libselinux
|
||||
+yara
|
||||
|
||||
dnl tools needed by virt-dib
|
||||
ifelse(REDHAT,1,
|
||||
45
lib-Autodetect-backing-format-for-qemu-img-create-b.patch
Normal file
45
lib-Autodetect-backing-format-for-qemu-img-create-b.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 45de287447bb18d59749fbfc1ec5072413090109 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 31 Aug 2021 08:27:15 +0100
|
||||
Subject: [PATCH] lib: Autodetect backing format for qemu-img create -b
|
||||
|
||||
qemu 6.1 has decided to change qemu-img create so that a backing
|
||||
format (-F) is required if a backing file (-b) is specified. Since we
|
||||
don't want to change the libguestfs API to force callers to specify
|
||||
this because that would be an API break, autodetect it.
|
||||
|
||||
This is similar to commit c8c181e8d9 ("launch: libvirt: Autodetect
|
||||
backing format for readonly drive overlays").
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1998820
|
||||
---
|
||||
lib/create.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/lib/create.c b/lib/create.c
|
||||
index 44a7df25fc..75a4d3a280 100644
|
||||
--- a/lib/create.c
|
||||
+++ b/lib/create.c
|
||||
@@ -255,6 +255,7 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
|
||||
const struct guestfs_disk_create_argv *optargs)
|
||||
{
|
||||
const char *backingformat = NULL;
|
||||
+ CLEANUP_FREE char *backingformat_free = NULL;
|
||||
const char *preallocation = NULL;
|
||||
const char *compat = NULL;
|
||||
int clustersize = -1;
|
||||
@@ -270,6 +271,14 @@ disk_create_qcow2 (guestfs_h *g, const char *filename, int64_t size,
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+ else if (backingfile) {
|
||||
+ /* Since qemu 6.1, qemu-img create has requires a backing format (-F)
|
||||
+ * parameter if backing file (-b) is used (RHBZ#1998820).
|
||||
+ */
|
||||
+ backingformat = backingformat_free = guestfs_disk_format (g, backingfile);
|
||||
+ if (!backingformat)
|
||||
+ return -1;
|
||||
+ }
|
||||
if (optargs->bitmask & GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK) {
|
||||
if (STREQ (optargs->preallocation, "off") ||
|
||||
STREQ (optargs->preallocation, "sparse"))
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
Name: libguestfs
|
||||
Version: 1.40.2
|
||||
Release: 15
|
||||
Release: 20
|
||||
Epoch: 1
|
||||
Summary: A set of tools for accessing and modifying virtual machine (VM) disk images
|
||||
License: LGPLv2+
|
||||
@ -16,6 +16,11 @@ Patch0000: 0001-libguestfs-PYTHON_LIBS-is-not-set-in-Python-3.8.patch
|
||||
Patch0001: 0002-fts-remove-NOSTAT_LEAF_OPTIMIZATION.patch
|
||||
Patch0002: 0003-port-to-php-8.0.0.patch
|
||||
Patch0003: fix-not-striped.patch
|
||||
Patch0004: Fix-defaut-function-compare-error.patch
|
||||
Patch0005: Fix-verbose-error.patch
|
||||
Patch0006: 0001-tests-Use-explicit-backing-format-for-all-backing-di.patch
|
||||
Patch0007: add-some-package-to-fix-run-error.patch
|
||||
Patch0008: lib-Autodetect-backing-format-for-qemu-img-create-b.patch
|
||||
|
||||
BuildRequires: gcc-c++, rpcgen, libtirpc-devel, supermin-devel >= 5.1.18, hivex-devel >= 1.2.7-7, ocaml-hivex-devel, perl(Pod::Simple), perl(Pod::Man)
|
||||
BuildRequires: /usr/bin/pod2text, po4a, augeas-devel >= 1.7.0, readline-devel, genisoimage, libxml2-devel, createrepo, glibc-static, libselinux-utils
|
||||
@ -28,7 +33,7 @@ BuildRequires: perl(Module::Build), perl(ExtUtils::CBuilder), perl(Locale::TextD
|
||||
BuildRequires: libvirt-python3, ruby-devel, rubygem-rake, rubygem(json), rubygem(rdoc), rubygem(test-unit), ruby-irb, java-1.8.0-openjdk, java-1.8.0-openjdk-devel
|
||||
BuildRequires: jpackage-utils, php-devel, gobject-introspection-devel, gjs, acl, attr, augeas-libs, bash, binutils, btrfs-progs, lzop, mdadm, nilfs-utils
|
||||
BuildRequires: bzip2, coreutils, cpio, cryptsetup, debootstrap, dhclient, diffutils, dosfstools, e2fsprogs, file, findutils, gawk, gdisk, gfs2-utils
|
||||
BuildRequires: grep, gzip, hivex, iproute, iputils, jfsutils, kernel, kmod, kpartx, less, libcap, libldm, libselinux, libxml2, lsof, lsscsi, lvm2, strace
|
||||
BuildRequires: grep, gzip, hivex, iproute, iputils, jfsutils, kmod, kpartx, less, libcap, libldm, libselinux, libxml2, lsof, lsscsi, lvm2, strace
|
||||
BuildRequires: openssh-clients, parted, pciutils, pcre, policycoreutils, procps, psmisc, qemu-img, reiserfs-utils, rsync, scrub, sed, sleuthkit, squashfs-tools
|
||||
BuildRequires: systemd, tar, udev, util-linux, vim-minimal, which, xfsprogs, yajl, zerofree, hfsplus-tools, ntfs-3g, ntfsprogs gettext-devel binutils
|
||||
%ifarch x86_64
|
||||
@ -269,6 +274,10 @@ install -m 0644 utils/boot-analysis/boot-analysis.1 $RPM_BUILD_ROOT%{_mandir}/ma
|
||||
install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/man1/libguestfs-boot-benchmark.1
|
||||
%endif
|
||||
|
||||
%ifarch sw_64
|
||||
chmod 644 %{buildroot}%{_libdir}/perl5/vendor_perl/auto/Sys/Guestfs/Guestfs.so
|
||||
%endif
|
||||
|
||||
%find_lang %{name}
|
||||
|
||||
%files -f %{name}.lang
|
||||
@ -316,8 +325,10 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/
|
||||
%files -n ocaml-%{name}-devel
|
||||
%doc ocaml/examples/*.ml ocaml/html
|
||||
%{_libdir}/ocaml/guestfs/*.a
|
||||
%ifnarch loongarch64 sw_64
|
||||
%{_libdir}/ocaml/guestfs/*.cmxa
|
||||
%{_libdir}/ocaml/guestfs/*.cmx
|
||||
%endif
|
||||
%{_libdir}/ocaml/guestfs/*.mli
|
||||
|
||||
%files -n perl-Sys-Guestfs
|
||||
@ -368,6 +379,22 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/
|
||||
%exclude %{_mandir}/man1/virt-tar.1*
|
||||
|
||||
%changelog
|
||||
* Tue Dec 5 2023 yuxiating <yuxiating@xfusion.com> - 1:1.40.2-20
|
||||
- Autodetect backing format for qemu-img create -b
|
||||
|
||||
* Mon Aug 14 2023 suwei <suwei@kylinsec.com.cn> - - 1.40.2-19
|
||||
- Add loongarch64 and sw_64 support
|
||||
|
||||
* Tue Dec 13 2022 wulei <wulei80@h-partners.com> - 1:1.40.2-18
|
||||
- add some packages to fix libguestfs-test-tool error
|
||||
|
||||
* Thu Aug 18 2022 liyanan <liyanan32@h-partners.com> - 1:1.40.2-17
|
||||
- Fix build error of libguestfs
|
||||
- Remove unnecessary dependency of kernel package
|
||||
|
||||
* Mon Jan 24 2022 xu_ping <xuping33@huawei.com> - 1:1.40.2-16
|
||||
- Use actual function Pervasives.compare to instead of default compare and omit the labels on positional arguments.
|
||||
|
||||
* Thu Sep 09 2021 sunguoshuai <sunguoshuai@huawei.com> - 1:1.40.2-15
|
||||
- Fix not striped in some binaries
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user