[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/20] block/dmg: Declare a type definition for DMG uncompress fun
From: |
Stefan Hajnoczi |
Subject: |
[PULL 09/20] block/dmg: Declare a type definition for DMG uncompress function |
Date: |
Thu, 20 Apr 2023 08:09:37 -0400 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Introduce the BdrvDmgUncompressFunc type defintion. To emphasis
dmg_uncompress_bz2 and dmg_uncompress_lzfse are pointer to functions,
declare them using this new typedef.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230320152610.32052-1-philmd@linaro.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/dmg.h | 8 ++++----
block/dmg.c | 7 ++-----
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/block/dmg.h b/block/dmg.h
index e488601b62..dcd6165e63 100644
--- a/block/dmg.h
+++ b/block/dmg.h
@@ -51,10 +51,10 @@ typedef struct BDRVDMGState {
z_stream zstream;
} BDRVDMGState;
-extern int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
- char *next_out, unsigned int avail_out);
+typedef int BdrvDmgUncompressFunc(char *next_in, unsigned int avail_in,
+ char *next_out, unsigned int avail_out);
-extern int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
- char *next_out, unsigned int avail_out);
+extern BdrvDmgUncompressFunc *dmg_uncompress_bz2;
+extern BdrvDmgUncompressFunc *dmg_uncompress_lzfse;
#endif
diff --git a/block/dmg.c b/block/dmg.c
index e10b9a2ba5..2769900359 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -31,11 +31,8 @@
#include "qemu/memalign.h"
#include "dmg.h"
-int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
- char *next_out, unsigned int avail_out);
-
-int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
- char *next_out, unsigned int avail_out);
+BdrvDmgUncompressFunc *dmg_uncompress_bz2;
+BdrvDmgUncompressFunc *dmg_uncompress_lzfse;
enum {
/* Limit chunk sizes to prevent unreasonable amounts of memory being used
--
2.39.2
- [PULL 00/20] Block patches, Stefan Hajnoczi, 2023/04/20
- [PULL 01/20] block/block-common: add zoned device structs, Stefan Hajnoczi, 2023/04/20
- [PULL 02/20] block/file-posix: introduce helper functions for sysfs attributes, Stefan Hajnoczi, 2023/04/20
- [PULL 03/20] block/block-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls, Stefan Hajnoczi, 2023/04/20
- [PULL 04/20] block/raw-format: add zone operations to pass through requests, Stefan Hajnoczi, 2023/04/20
- [PULL 06/20] iotests: test new zone operations, Stefan Hajnoczi, 2023/04/20
- [PULL 07/20] block: add some trace events for new block layer APIs, Stefan Hajnoczi, 2023/04/20
- [PULL 05/20] block: add zoned BlockDriver check to block layer, Stefan Hajnoczi, 2023/04/20
- [PULL 09/20] block/dmg: Declare a type definition for DMG uncompress function,
Stefan Hajnoczi <=
- [PULL 10/20] tracetool: use relative paths for '#line' preprocessor directives, Stefan Hajnoczi, 2023/04/20
- [PULL 12/20] block: introduce zone append write for zoned devices, Stefan Hajnoczi, 2023/04/20
- [PULL 14/20] block: add some trace events for zone append, Stefan Hajnoczi, 2023/04/20
- [PULL 15/20] include: update virtio_blk headers to v6.3-rc1, Stefan Hajnoczi, 2023/04/20
- [PULL 20/20] tracing: install trace events file only if necessary, Stefan Hajnoczi, 2023/04/20
- [PULL 08/20] docs/zoned-storage: add zoned device documentation, Stefan Hajnoczi, 2023/04/20
- [PULL 18/20] virtio-blk: add some trace events for zoned emulation, Stefan Hajnoczi, 2023/04/20
- [PULL 11/20] file-posix: add tracking of the zone write pointers, Stefan Hajnoczi, 2023/04/20
- [PULL 13/20] qemu-iotests: test zone append operation, Stefan Hajnoczi, 2023/04/20
- [PULL 16/20] virtio-blk: add zoned storage emulation for zoned devices, Stefan Hajnoczi, 2023/04/20