On 07/10/2014 01:15 AM, Hong-Hua.Yin(a)freescale.com wrote:
Hi,
What's the difference between QEMU snapshot and libvirt snapshot?
# qemu-img create -f qcow2 disk.img 512
Formatting 'disk.img', fmt=qcow2 size=512 encryption=off cluster_size=65536
lazy_refcounts=off
This created an offline internal snapshot. You can do the same with
libvirt (which basically calls qemu-img under the hood for an offline
guest).
Is there any special qemu command options or kernel configurations to allow libvirt
create snapshot?
No, if you are using libvirt to create the snapshot, then it should just
work, provided you used libvirt correctly.
I got the error as below:
virsh # snapshot-create snap
error: unsupported configuration: internal snapshots and checkpoints require all disks to
be selected for snapshot
This says to create a default snapshot of the domain named 'snap'; since
you didn't specify any xml file, that default implies an internal
snapshot. Is your guest running or offline at the time you attempted this?
# cat sdk.xml
<domain type='kvm'>
...
<devices>
<emulator>/usr/bin/qemu-system-ppc</emulator>
<controller type='usb' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
What? No <disk> element? You have to have a qcow2 disk associated with
your domain before you can create an internal snapshot, regardless of
whether the guest is online or offline.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org