[PATCH] eal/unix: support ZSTD compression for firmwares
Bruce Richardson
bruce.richardson at intel.com
Wed May 8 12:50:02 CEST 2024
On Wed, May 08, 2024 at 11:52:14AM +0200, David Marchand wrote:
> Ubuntu 24.04 started to compress firmwares with ZSTD compression.
>
> Bugzilla ID: 1437
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> lib/eal/unix/eal_firmware.c | 42 +++++++++++++++++++++++++++++--------
> 1 file changed, 33 insertions(+), 9 deletions(-)
>
> diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c
> index 1d47e879c8..065e251f9d 100644
> --- a/lib/eal/unix/eal_firmware.c
> +++ b/lib/eal/unix/eal_firmware.c
> @@ -16,6 +16,21 @@
> #include "eal_firmware.h"
> #include "eal_private.h"
>
> +#ifndef RTE_HAS_LIBARCHIVE
> +/* Fake definitions for the compression_algorithms array below. */
> +struct archive;
> +extern int archive_read_support_filter_xz(struct archive *a);
> +extern int archive_read_support_filter_zstd(struct archive *a);
> +#endif
> +
Do these not lead to unresolved symbols on link?
> +static struct {
> + const char *suffix;
> + int (*support_callback)(struct archive *a);
> +} compression_algorithms[] = {
> + { "xz", archive_read_support_filter_xz, },
> + { "zst", archive_read_support_filter_zstd, },
> +};
> +
Rather than defining stubs for these functions from libarchive, can you
just have an empty list if no libarchive?
struct archive; /* may need to be #ifdef'ed perhaps? */
static struct {
const char *suffix;
int (*support_callback)(struct archive *a);
} compression_algorithms[] = {
#ifdef RTE_HAS_LIBARCHIVE
{ "xz", archive_read_support_filter_xz, },
{ "zst", archive_read_support_filter_zstd, },
#endif
};
> #ifdef RTE_HAS_LIBARCHIVE
>
<snip>
More information about the dev
mailing list