mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 21:15:22 +00:00
qemu: allow snapshotting of sheepdog and rbd disks
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
(cherry picked from commit b57e01532a
)
This commit is contained in:
parent
45e60ff0f1
commit
0f28a21bb6
@ -9587,12 +9587,18 @@ qemuDomainSnapshotIsAllowed(virDomainObjPtr vm)
|
|||||||
* that succeed as well
|
* that succeed as well
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < vm->def->ndisks; i++) {
|
for (i = 0; i < vm->def->ndisks; i++) {
|
||||||
if ((vm->def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_LUN) ||
|
virDomainDiskDefPtr disk = vm->def->disks[i];
|
||||||
(vm->def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK &&
|
if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
|
||||||
STRNEQ_NULLABLE(vm->def->disks[i]->driverType, "qcow2"))) {
|
(disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG ||
|
||||||
|
disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_RBD))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) ||
|
||||||
|
(disk->device == VIR_DOMAIN_DISK_DEVICE_DISK &&
|
||||||
|
STRNEQ_NULLABLE(disk->driverType, "qcow2"))) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("Disk '%s' does not support snapshotting"),
|
_("Disk '%s' does not support snapshotting"),
|
||||||
vm->def->disks[i]->src);
|
disk->src);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user