]> git.proxmox.com Git - qemu.git/blobdiff - savevm.c
qed: fix use-after-free during l2 cache commit
[qemu.git] / savevm.c
index 939845c82576faf69fea6a410b4ab2504d22b977..79db4cbd18b25b103bb8b3db1125174eb31145bc 100644 (file)
--- a/savevm.c
+++ b/savevm.c
@@ -194,7 +194,7 @@ static int socket_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)
     ssize_t len;
 
     do {
-        len = recv(s->fd, (void *)buf, size, 0);
+        len = qemu_recv(s->fd, buf, size, 0);
     } while (len == -1 && socket_error() == EINTR);
 
     if (len == -1)
@@ -2073,6 +2073,7 @@ int load_vmstate(const char *name)
         return -EINVAL;
     }
 
+    qemu_system_reset(VMRESET_SILENT);
     ret = qemu_loadvm_state(f);
 
     qemu_fclose(f);