On 11/06/2011 09:14 PM, MATSUDA, Daiki wrote:
> I made the patch for the problem to take the snapshot but qcow2. It use
> the 'qemu-img' command, I know that it is not essential solution. But I
> think it is better than to link qemu's libraries.
>
> Regards
> @@ -9002,6 +9021,13 @@ qemuDomainSnapshotCreateSingleDiskActive
> return -1;
> }
>
> + ret = qemuDomainSnapshotCheckSrcQcow2(src->disk);
> + if (ret) {
> + qemuReportError(VIR_ERR_INTERNAL_ERROR,
> + "%s", _("src image is not qcow2
format"));
> + return ret;
> + }
NACK. There is nothing inherently wrong with the source file not being
a qcow2 file. The whole point of creating a runtime snapshot is that
the original file (of _any_ format) becomes the backing file of a new
qcow2 file, so that the original file now serves as the snapshot.
Forbidding a live snapshot of a raw source file interferes with this intent.
I have some tested since you replied. Certainly other image file, e.g.
raw type, has no problem after snapshot is taken in qcow2 format.
But in the case that direct disk block, e.g. /dev/sdc, is given for the
guest OS, the same error occurs. It may not be accepted by qemu-kvm.
I do not understand which qemu-kvm or libvirt should be fixed. But at
least libvirt should be stop to take snapshot for block device with
following patch.
Regards
MATSUDA Daiki