Skip to contentSkip to conversation

fix savevm command without id or tag

PATCH Applied Marcelo Tosatti 3 participants 3 messages Jan 20, 2010 – Jan 26, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix savevm command without id or tag

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>)

savevm.c +1 -1
index b3bb909..2fd3de6 100644
@@ -1718,7 +1718,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 */
-    if (del_existing_snapshots(mon, name) < 0) {
+    if (name && del_existing_snapshots(mon, name) < 0) {
         goto the_end;
     }
 
Acked-by on v1 1/1
#1 lore raw

Am 20.01.2010 17:26, schrieb Marcelo Tosatti:

Quoted 6 lines

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>,

Quoted 6 lines
    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>)

Quoted 17 lines
savevm.c +1 -1
index b3bb909..2fd3de6 100644
@@ -1718,7 +1718,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 */
-    if (del_existing_snapshots(mon, name) < 0) {
+    if (name && del_existing_snapshots(mon, name) < 0) {
         goto the_end;
     }
 
#2 lore raw
In reply to Marcelo Tosatti

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 30 lines · Marcelo Tosatti

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>)

savevm.c +1 -1
index b3bb909..2fd3de6 100644
@@ -1718,7 +1718,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 */
-    if (del_existing_snapshots(mon, name)<  0) {
+    if (name&&  del_existing_snapshots(mon, name)<  0) {
          goto the_end;
      }