On Wed, Nov 20, 2024 at 18:48:41 +0300, Nikolai Barybin via Devel wrote:
In qcow2 header data file is represented by incompitible feature bit
and its path is saved to header extension table.
Thus, we implement here the logic similar to backing file probing.
Signed-off-by: Nikolai Barybin <nikolai.barybin(a)virtuozzo.com>
---
src/storage_file/storage_file_probe.c | 46 ++++++++++++++++++++++++---
1 file changed, 42 insertions(+), 4 deletions(-)
[...]
+static int
+qcow2GetDataFile(char **res,
+ virBitmap *features,
+ char *buf,
+ size_t buf_size)
+{
+ *res = NULL;
+
+ if (buf_size < QCOW2v3_HDR_FEATURES_INCOMPATIBLE + 8)
+ return 0;
+
+ if (features && virBitmapIsBitSet(features,
VIR_STORAGE_FILE_FEATURE_DATA_FILE)) {
+ if (qcow2GetExtensions(buf, buf_size, NULL, res) < 0)
+ return 0;
This should be 'return -1'
+ }
+
+ return 0;
+}
+
+
static int
vmdk4GetBackingStore(char **res,
int *format,
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>