On Mon, Apr 30, 2012 at 10:55:22PM -0700, Josh Durgin wrote:
> Signed-off-by: Josh Durgin <josh.dur...@dreamhost.com>
> ---
>  src/qemu/qemu_driver.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 78899a4..86e82d6 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -9605,12 +9605,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;
>          }
>      }

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to