[libvirt] [PATCH] snapshot: detect when qemu lacks disk-snapshot support
Eric Blake
eblake at redhat.com
Tue Oct 18 21:55:47 UTC 2011
On 10/18/2011 03:51 PM, Eric Blake wrote:
> Noticed when testing new libvirt against old qemu that lacked the
> snapshot_blkdev HMP command. Libvirt was mistakenly treating the
> command as successful, and re-writing the domain XML to use the
> just-created 0-byte file, rendering the domain broken on restart.
>
> * src/qemu/qemu_monitor_text.c (qemuMonitorTextDiskSnapshot):
> Notice another possible error message.
> ---
> src/qemu/qemu_monitor_text.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
Phooey - testing reveals that this fixes the main problem (the command
now fails with a nice error without corrupting the domain xml:
# virsh snapshot-create --disk-only dom
error: operation failed: Failed to take snapshot: unknown command:
'snapshot_blkdev'
), but isn't quite perfect (the 0-byte file is still left behind). v2
coming up soon.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
More information about the libvir-list
mailing list