From 606fb3979ab4eee0fe121cdca952f18dbeb61faf Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 24 Apr 2020 11:17:55 +0200 Subject: [PATCH] util: qcow2GetExtensions: Remove support for 'data file' extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The implementation was never finished in libvirt. Remove it. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/util/virstoragefile.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index b92efc123d..ff9a6c6663 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -199,7 +199,6 @@ qedGetBackingStore(char **, int *, const char *, size_t); #define QCOW2_HDR_EXTENSION_END 0 #define QCOW2_HDR_EXTENSION_BACKING_FORMAT 0xE2792ACA -#define QCOW2_HDR_EXTENSION_DATA_FILE 0x44415441 #define QCOW2v3_HDR_FEATURES_INCOMPATIBLE (QCOW2_HDR_TOTAL_SIZE) #define QCOW2v3_HDR_FEATURES_COMPATIBLE (QCOW2v3_HDR_FEATURES_INCOMPATIBLE+8) @@ -426,8 +425,7 @@ cowGetBackingStore(char **res, static int qcow2GetExtensions(const char *buf, size_t buf_size, - int *backingFormat, - char **externalDataStoreRaw) + int *backingFormat) { size_t offset; size_t extension_start; @@ -517,19 +515,6 @@ qcow2GetExtensions(const char *buf, break; } - case QCOW2_HDR_EXTENSION_DATA_FILE: { - if (!externalDataStoreRaw) - break; - - if (VIR_ALLOC_N(*externalDataStoreRaw, len + 1) < 0) - return -1; - memcpy(*externalDataStoreRaw, buf + offset, len); - (*externalDataStoreRaw)[len] = '\0'; - VIR_DEBUG("parsed externalDataStoreRaw='%s'", - *externalDataStoreRaw); - break; - } - case QCOW2_HDR_EXTENSION_END: return 0; } @@ -579,7 +564,7 @@ qcowXGetBackingStore(char **res, memcpy(*res, buf + offset, size); (*res)[size] = '\0'; - if (qcow2GetExtensions(buf, buf_size, format, NULL) < 0) + if (qcow2GetExtensions(buf, buf_size, format) < 0) return BACKING_STORE_INVALID; return BACKING_STORE_OK; -- GitLab