]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storagefile: set size field of ploop to 8
authorJán Tomko <jtomko@redhat.com>
Wed, 18 May 2022 13:59:36 +0000 (15:59 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 22 Jun 2022 13:29:44 +0000 (15:29 +0200)
For all file formats, the length of the size field is assumed
and hardcoded to be 8 bytes.

Fix the length for the ploop format - since we specify the offset,
we read 8 bytes of the length, not 0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/storage_file/storage_file_probe.c

index 54e095ffd36c223ca595e903722230d6619cff05..9465af5d96ce354b9a9ea7b6a0cf00540363e87b 100644 (file)
@@ -296,7 +296,7 @@ static struct FileTypeInfo const fileTypeInfo[] = {
     [VIR_STORAGE_FILE_VHD] = { 0, NULL, LV_LITTLE_ENDIAN,
                                -1, 0, {0}, 0, 0, 0, NULL, NULL, NULL, NULL },
     [VIR_STORAGE_FILE_PLOOP] = { 0, "WithouFreSpacExt", LV_LITTLE_ENDIAN,
-                                 -2, 0, {0}, PLOOP_IMAGE_SIZE_OFFSET, 0,
+                                 -2, 0, {0}, PLOOP_IMAGE_SIZE_OFFSET, 8,
                                  PLOOP_SIZE_MULTIPLIER, NULL, NULL, NULL, NULL },
 
     /* All formats with a backing store probe below here */