]> xenbits.xensource.com Git - xen.git/commit
libxenguest: support zstd compressed kernels
authorJan Beulich <jbeulich@suse.com>
Tue, 26 Jan 2021 13:16:34 +0000 (14:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 26 Jan 2021 13:16:34 +0000 (14:16 +0100)
commit8169f82049efb5b2044b33aa482ba3a136b7804d
tree0ff72a40bd8ebcb8b9a423541069540a982fe9f3
parentd8099d94dfaa3573bd86ebfc457cbc8f70a3ecda
libxenguest: support zstd compressed kernels

This follows the logic used for other decompression methods utilizing an
external library, albeit here we can't ignore the 32-bit size field
appended to the compressed image - its presence causes decompression to
fail. Leverage the field instead to allocate the output buffer in one
go, i.e. without incrementally realloc()ing.

As far as configure.ac goes, I'm pretty sure there is a better (more
"standard") way of using PKG_CHECK_MODULES(). The construct also gets
put next to the other decompression library checks, albeit I think they
all ought to be x86-specific (e.g. placed in the existing case block a
few lines down).

Note that, where possible, instead of #ifdef-ing xen/*.h inclusions,
they get removed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wl@xen.org>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 files changed:
README
tools/configure
tools/configure.ac
tools/libs/guest/Makefile
tools/libs/guest/xg_dom_bzimageloader.c
tools/libs/guest/xg_dom_decompress_unsafe.h
tools/libs/guest/xg_dom_decompress_unsafe_zstd.c [new file with mode: 0644]
xen/common/zstd/decompress.c
xen/common/zstd/error_private.h
xen/common/zstd/fse.h
xen/common/zstd/fse_decompress.c
xen/common/zstd/huf.h
xen/common/zstd/huf_decompress.c
xen/common/zstd/mem.h
xen/common/zstd/zstd_internal.h
xen/include/xen/unaligned.h
xen/lib/xxhash64.c