qemu: snapshot: Skip empty drives with internal snapshots

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)
This commit is contained in:
Peter Krempa 2017-04-07 16:56:49 +02:00 committed by Cole Robinson
parent e62d61e7f8
commit 2c59352638

View 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;