]> 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)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 May 2017 19:33:09 +0000 (15:33 -0400)
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.

(cherry picked from commit eee3b4b9493a0b4e5e5fb473893a55320b4f83b1)

src/qemu/qemu_driver.c

index 6b91750acff0ac4307eb2434a3b82bdcb7e7d409..0a95ad76f65ecefd48be772056a5ef350aa3fc1b 100644 (file)
@@ -13831,7 +13831,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;