Signed-off-by: Claudio Fontana <cfontana(a)suse.de>
---
src/qemu/qemu_saveimage.c | 19 ++++++++++++++++++-
src/qemu/qemu_saveimage.h | 5 +++--
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c
index 35a75069e8..c0920c5baa 100644
--- a/src/qemu/qemu_saveimage.c
+++ b/src/qemu/qemu_saveimage.c
@@ -67,6 +67,23 @@ VIR_ENUM_IMPL(qemuSaveCompression,
"lzop",
);
+typedef enum {
+ QEMU_SAVE_MULTIFD_COMP_NONE = 0,
+ QEMU_SAVE_MULTIFD_COMP_ZLIB = 1,
+ QEMU_SAVE_MULTIFD_COMP_ZSTD = 2,
+
+ /* used for the on-disk format, do not change/re-use numbers */
+ QEMU_SAVE_MULTIFD_COMP_LAST
+} virQEMUSaveMultiFdComp;
+
+VIR_ENUM_DECL(qemuSaveMultiFdComp);
+VIR_ENUM_IMPL(qemuSaveMultiFdComp,
+ QEMU_SAVE_MULTIFD_COMP_LAST,
+ "none",
+ "zlib",
+ "zstd",
+);
+
static inline void
qemuSaveImageBswapHeader(virQEMUSaveHeader *hdr)
{
@@ -882,7 +899,7 @@ qemuSaveImageStartVM(virConnectPtr conn,
virDomainXMLOptionGetSaveCookie(driver->xmlopt)) <
0)
goto cleanup;
- if ((header->version == 2) &&
+ if ((header->version >= 2) &&
(header->compressed != QEMU_SAVE_FORMAT_RAW)) {
if (!(cmd = qemuSaveImageGetCompressionCommand(header->compressed)))
goto cleanup;
diff --git a/src/qemu/qemu_saveimage.h b/src/qemu/qemu_saveimage.h
index ae7b3faa17..eb0734101e 100644
--- a/src/qemu/qemu_saveimage.h
+++ b/src/qemu/qemu_saveimage.h
@@ -30,7 +30,7 @@
*/
#define QEMU_SAVE_MAGIC "LibvirtQemudSave"
#define QEMU_SAVE_PARTIAL "LibvirtQemudPart"
-#define QEMU_SAVE_VERSION 2
+#define QEMU_SAVE_VERSION 3
G_STATIC_ASSERT(sizeof(QEMU_SAVE_MAGIC) == sizeof(QEMU_SAVE_PARTIAL));
@@ -42,7 +42,8 @@ struct _virQEMUSaveHeader {
uint32_t was_running;
uint32_t compressed;
uint32_t cookieOffset;
- uint32_t unused[14];
+ uint32_t multifd_comp;
+ uint32_t unused[13];
};
--
2.35.3