[libvirt] [PATCH] snapshot: use correct qmp monitor command

To date, disk snapshots worked by accident, as they were always using hmp fallback due to a typo in commit e702b5b not picking up on the (intentional) difference in command names between the two monitor protocols. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot): Spell QMP command correctly. Reported by Luiz Capitulino. --- How embarrassing. http://wiki.qemu.org/Features/Snapshots even called out the difference in naming. src/qemu/qemu_monitor_json.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 3d383c8..18d1c9f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2960,7 +2960,7 @@ qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon, const char *device, virJSONValuePtr cmd; virJSONValuePtr reply = NULL; - cmd = qemuMonitorJSONMakeCommand("snapshot-blkdev-sync", + cmd = qemuMonitorJSONMakeCommand("blockdev-snapshot-sync", "s:device", device, "s:snapshot-file", file, NULL); @@ -2972,7 +2972,7 @@ qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon, const char *device, if (qemuMonitorJSONHasError(reply, "CommandNotFound") && qemuMonitorCheckHMP(mon, "snapshot_blkdev")) { - VIR_DEBUG("snapshot-blkdev-sync command not found, trying HMP"); + VIR_DEBUG("blockdev-snapshot-sync command not found, trying HMP"); ret = qemuMonitorTextDiskSnapshot(mon, device, file); goto cleanup; } -- 1.7.4.4

On Mon, Oct 10, 2011 at 03:35:42PM -0600, Eric Blake wrote:
To date, disk snapshots worked by accident, as they were always using hmp fallback due to a typo in commit e702b5b not picking up on the (intentional) difference in command names between the two monitor protocols.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot): Spell QMP command correctly. Reported by Luiz Capitulino. ---
How embarrassing. http://wiki.qemu.org/Features/Snapshots even called out the difference in naming.
src/qemu/qemu_monitor_json.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 3d383c8..18d1c9f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2960,7 +2960,7 @@ qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon, const char *device, virJSONValuePtr cmd; virJSONValuePtr reply = NULL;
- cmd = qemuMonitorJSONMakeCommand("snapshot-blkdev-sync", + cmd = qemuMonitorJSONMakeCommand("blockdev-snapshot-sync", "s:device", device, "s:snapshot-file", file, NULL); @@ -2972,7 +2972,7 @@ qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon, const char *device,
if (qemuMonitorJSONHasError(reply, "CommandNotFound") && qemuMonitorCheckHMP(mon, "snapshot_blkdev")) { - VIR_DEBUG("snapshot-blkdev-sync command not found, trying HMP"); + VIR_DEBUG("blockdev-snapshot-sync command not found, trying HMP"); ret = qemuMonitorTextDiskSnapshot(mon, device, file); goto cleanup; }
Whoops :-) ACK ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 10/10/2011 11:53 PM, Daniel Veillard wrote:
On Mon, Oct 10, 2011 at 03:35:42PM -0600, Eric Blake wrote:
To date, disk snapshots worked by accident, as they were always using hmp fallback due to a typo in commit e702b5b not picking up on the (intentional) difference in command names between the two monitor protocols.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot): Spell QMP command correctly. Reported by Luiz Capitulino.
- VIR_DEBUG("snapshot-blkdev-sync command not found, trying HMP"); + VIR_DEBUG("blockdev-snapshot-sync command not found, trying HMP"); ret = qemuMonitorTextDiskSnapshot(mon, device, file); goto cleanup; }
Whoops :-) ACK !
Pushed. I still need to test what happens when both QMP and HMP commands are missing, to make sure libvirt issues a sane error message (yesterday, I attempted to fake this with gdb to cause a failure, and got the dreaded 'unknown error' message, but think I botched my test, so I'll feel better once I repeat the test with a real qemu rather than gdb). -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel Veillard
-
Eric Blake