]> Git Repo - qemu.git/commitdiff
vmdk: Support version=3 in VMDK descriptor files
authorSam Eiderman <[email protected]>
Thu, 14 Mar 2019 14:14:37 +0000 (16:14 +0200)
committerKevin Wolf <[email protected]>
Tue, 19 Mar 2019 14:49:29 +0000 (15:49 +0100)
Commit 509d39aa22909c0ed1aabf896865f19c81fb38a1 added support for read
only VMDKs of version 3.

This commit fixes the probe function to correctly handle descriptors of
version 3.

This commit has two effects:
    1. We no longer need to supply '-f vmdk' when pointing to descriptor
       files of version 3 in qemu/qemu-img command line arguments.
    2. This fixes the scenario where a VMDK points to a parent version 3
       descriptor file which is being probed as "raw" instead of "vmdk".

Reviewed-by: Arbel Moshe <[email protected]>
Reviewed-by: Mark Kanda <[email protected]>
Signed-off-by: Shmuel Eiderman <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/vmdk.c

index d8c0c503908b4b17512b368551e5430833fae03e..8dec6ef7677bc4f50960bf0bb0c5232c336d7cf8 100644 (file)
@@ -195,13 +195,15 @@ static int vmdk_probe(const uint8_t *buf, int buf_size, const char *filename)
             }
             if (end - p >= strlen("version=X\n")) {
                 if (strncmp("version=1\n", p, strlen("version=1\n")) == 0 ||
-                    strncmp("version=2\n", p, strlen("version=2\n")) == 0) {
+                    strncmp("version=2\n", p, strlen("version=2\n")) == 0 ||
+                    strncmp("version=3\n", p, strlen("version=3\n")) == 0) {
                     return 100;
                 }
             }
             if (end - p >= strlen("version=X\r\n")) {
                 if (strncmp("version=1\r\n", p, strlen("version=1\r\n")) == 0 ||
-                    strncmp("version=2\r\n", p, strlen("version=2\r\n")) == 0) {
+                    strncmp("version=2\r\n", p, strlen("version=2\r\n")) == 0 ||
+                    strncmp("version=3\r\n", p, strlen("version=3\r\n")) == 0) {
                     return 100;
                 }
             }
This page took 0.029081 seconds and 4 git commands to generate.