From 0f28a21bb63fa7194a1c84e086a1ab7772d59c7e Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Mon, 30 Apr 2012 22:55:22 -0700 Subject: [PATCH] qemu: allow snapshotting of sheepdog and rbd disks Signed-off-by: Josh Durgin (cherry picked from commit b57e01532a1691897e27f20eccfd667a46ee374e) --- src/qemu/qemu_driver.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 38aada6667..617cbd0972 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9587,12 +9587,18 @@ qemuDomainSnapshotIsAllowed(virDomainObjPtr vm) * that succeed as well */ for (i = 0; i < vm->def->ndisks; i++) { - if ((vm->def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_LUN) || - (vm->def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK && - STRNEQ_NULLABLE(vm->def->disks[i]->driverType, "qcow2"))) { + virDomainDiskDefPtr disk = vm->def->disks[i]; + if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK && + (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, _("Disk '%s' does not support snapshotting"), - vm->def->disks[i]->src); + disk->src); return false; } }