]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Support only raw volumes in qemuDomainBlockPeek
authorPeter Krempa <pkrempa@redhat.com>
Fri, 12 May 2017 14:00:27 +0000 (16:00 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 11 Jul 2017 15:07:04 +0000 (17:07 +0200)
The API documents that it peeks into the VM disk. We can't do that
currently for non raw images so report an error.

src/qemu/qemu_driver.c

index d976826d70b04a8adb008627476fa99b9b5d0361..a7019c53ccdcc7a7d911dfc80eb8db6a60ba575b 100644 (file)
@@ -11328,6 +11328,12 @@ qemuDomainBlockPeek(virDomainPtr dom,
         goto cleanup;
     }
 
+    if (disk->src->format != VIR_STORAGE_FILE_RAW) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("peeking is supported only for RAW disks"));
+        goto cleanup;
+    }
+
     if (qemuDomainStorageFileInit(driver, vm, disk->src) < 0)
         goto cleanup;