bool reuse = (*flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
bool atomic = (*flags & VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC) != 0;
bool found_internal = false;
+ bool forbid_internal = false;
int external = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
break;
case VIR_DOMAIN_SNAPSHOT_LOCATION_NONE:
+ /* Remember seeing a disk that has snapshot disabled */
+ if (!dom_disk->readonly)
+ forbid_internal = true;
break;
case VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT:
}
}
- /* internal snapshot requires a disk image to store the memory image to */
- if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL &&
- !found_internal) {
+ /* internal snapshot requires a disk image to store the memory image to, and
+ * also disks can't be excluded from an internal snapshot*/
+ if ((def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && !found_internal) ||
+ (found_internal && forbid_internal)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("internal checkpoints require at least "
- "one disk to be selected for snapshot"));
+ _("internal snapshots and checkpoints require all "
+ "disks to be selected for snapshot"));
goto cleanup;
}