savevm.c (d410fe14) savevm.c (9af9e0fe)
1/*
2 * QEMU System Emulator
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 * Copyright (c) 2009-2015 Red Hat Inc
6 *
7 * Authors:
8 * Juan Quintela <quintela@redhat.com>

--- 1549 unchanged lines hidden (view full) ---

1558 if (length > MAX_VM_CMD_PACKAGED_SIZE) {
1559 error_report("Unreasonably large packaged state: %u", length);
1560 return -1;
1561 }
1562 buffer = g_malloc0(length);
1563 ret = qemu_get_buffer(mis->from_src_file, buffer, (int)length);
1564 if (ret != length) {
1565 g_free(buffer);
1/*
2 * QEMU System Emulator
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 * Copyright (c) 2009-2015 Red Hat Inc
6 *
7 * Authors:
8 * Juan Quintela <quintela@redhat.com>

--- 1549 unchanged lines hidden (view full) ---

1558 if (length > MAX_VM_CMD_PACKAGED_SIZE) {
1559 error_report("Unreasonably large packaged state: %u", length);
1560 return -1;
1561 }
1562 buffer = g_malloc0(length);
1563 ret = qemu_get_buffer(mis->from_src_file, buffer, (int)length);
1564 if (ret != length) {
1565 g_free(buffer);
1566 error_report("CMD_PACKAGED: Buffer receive fail ret=%d length=%d\n",
1567 ret, length);
1566 error_report("CMD_PACKAGED: Buffer receive fail ret=%d length=%d",
1567 ret, length);
1568 return (ret < 0) ? ret : -EAGAIN;
1569 }
1570 trace_loadvm_handle_cmd_packaged_received(ret);
1571
1572 /* Setup a dummy QEMUFile that actually reads from the buffer */
1573 qsb = qsb_create(buffer, length);
1574 g_free(buffer); /* Because qsb_create copies */
1575 if (!qsb) {

--- 611 unchanged lines hidden ---
1568 return (ret < 0) ? ret : -EAGAIN;
1569 }
1570 trace_loadvm_handle_cmd_packaged_received(ret);
1571
1572 /* Setup a dummy QEMUFile that actually reads from the buffer */
1573 qsb = qsb_create(buffer, length);
1574 g_free(buffer); /* Because qsb_create copies */
1575 if (!qsb) {

--- 611 unchanged lines hidden ---