]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: snapshot: Skip empty drives with internal snapshots
authorPeter Krempa <pkrempa@redhat.com>
Fri, 7 Apr 2017 14:56:49 +0000 (16:56 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 13 Apr 2017 10:17:17 +0000 (12:17 +0200)
The code that validates whether an internal snapshot is possible would
reject an empty but not-readonly drive. Since floppies can have this
property, add a check for emptiness.

src/qemu/qemu_driver.c

index 388af4f6fd769d5052be702feae515b282835c00..e39de625db086c4fb10d58ba245db467fd4ea3a8 100644 (file)
@@ -13825,7 +13825,8 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
 
         case VIR_DOMAIN_SNAPSHOT_LOCATION_NONE:
             /* Remember seeing a disk that has snapshot disabled */
-            if (!dom_disk->src->readonly)
+            if (!virStorageSourceIsEmpty(dom_disk->src) &&
+                !dom_disk->src->readonly)
                 forbid_internal = true;
             break;