]> Git Repo - qemu.git/commitdiff
fix savevm command without id or tag
authorMarcelo Tosatti <[email protected]>
Wed, 20 Jan 2010 16:26:34 +0000 (14:26 -0200)
committerAnthony Liguori <[email protected]>
Tue, 26 Jan 2010 21:45:06 +0000 (15:45 -0600)
savevm without id or tag segfaults in:

(gdb) bt
#0  0x00007f600a83bf8a in __strcmp_sse42 () from /lib64/libc.so.6
#1  0x00000000004745b6 in bdrv_snapshot_find (bs=<value optimized out>,
    sn_info=0x7fff996be280, name=0x0) at savevm.c:1631
#2  0x0000000000475c80 in del_existing_snapshots (name=<value optimized out>,
    mon=<value optimized out>) at savevm.c:1654
#3  do_savevm (name=<value optimized out>, mon=<value optimized out>)

Signed-off-by: Marcelo Tosatti <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
savevm.c

index 829f735bd48a63768db8d4adc6f86f10c3dbe023..4b5866396035fcc55eb94f47a704d335c0301779 100644 (file)
--- a/savevm.c
+++ b/savevm.c
@@ -1695,7 +1695,7 @@ void do_savevm(Monitor *mon, const QDict *qdict)
     sn->vm_clock_nsec = qemu_get_clock(vm_clock);
 
     /* Delete old snapshots of the same name */
     sn->vm_clock_nsec = qemu_get_clock(vm_clock);
 
     /* Delete old snapshots of the same name */
-    if (del_existing_snapshots(mon, name) < 0) {
+    if (name && del_existing_snapshots(mon, name) < 0) {
         goto the_end;
     }
 
         goto the_end;
     }
 
This page took 0.02941 seconds and 4 git commands to generate.