--- libvirt-0.9.7.orig/src/qemu/qemu_driver.c 2011-11-03 23:48:23.000000000 +0900 +++ libvirt-0.9.7/src/qemu/qemu_driver.c 2011-11-14 12:56:51.870453885 +0900 @@ -9025,6 +9025,7 @@ qemuDomainSnapshotCreateSingleDiskActive char *origsrc = NULL; char *origdriver = NULL; bool need_unlink = false; + struct stat sb; if (snap->snapshot != VIR_DOMAIN_DISK_SNAPSHOT_EXTERNAL) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -9032,6 +9033,17 @@ qemuDomainSnapshotCreateSingleDiskActive return -1; } + if (stat(disk->src, &sb) < 0) { + virReportSystemError(errno, + _("unable to stat for disk %s"), + disk->src); + } + if (S_ISBLK(sb.st_mode)) { + qemuReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("src image is Block Device")); + return -1; + } + if (virAsprintf(&device, "drive-%s", disk->info.alias) < 0 || !(source = strdup(snap->file)) || (STRNEQ_NULLABLE(disk->driverType, "qcow2") &&