migration/next for 20170614

-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJZQQz1AAoJEPSH7xhYctcjnEoP/29qBRwb5dIJuKAYRup3YD9j
 q5kf1JjDYXzZ5S5YbF+cePptILyrzrzsAOuE3eQECgWD3mSnmNUv8FqxpcHhIn0R
 grTerdXkedlkrywO1CCJPzbHccWbCvIVTmHTMuF5C4I+vPe7DC3duoDI7yiVQ3lS
 GYNyE575/cdVClQ0rR5SRQLOm7K9r9mIOwz8B4musUoErIIOdgp7MzWHBfc1hZyN
 71hSE01FRs1nLLYEwqjrJOM/vBDIRGIPN9QEq5Pt7nJJh4mF1fj1lrltKaJOncmr
 8FCFZZSrBp+JSTQP+UJfa7lUYbPh0CkA6C8RdhkkdmwsU5/eoornr9n41O2H2ice
 6GtDVmXDKinU7FaJN3pQe9pwQmb6QL7K8t51bOkI58tqklB92FEeBQSJrI14Bu7w
 H0du8UAQatp4ElvZFCDwpQY5ieagSGIih63+h5ubGMzNTphYwxFbQtkIisuuZvlY
 WNpgY523QD11618BSdEHEfcXwEeqjre7mG2Q03eH3jmz4EuURVW9HQ873Y/lBGua
 yQlH4/OFQuCDeNGG/1B1VZryO/pe/dpGnbJBrXDIsbSGPhZdogh+JXJ2PZwtaAVP
 4jvNQdFGer25y7XLF1vAGMoovzqzV+t7xQ/XXPXvPZgyiXEpzREpRZytXyvFKqs5
 OWI1fWs+tXJP8yc+omhX
 =w3JL
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170614' into staging

migration/next for 20170614

# gpg: Signature made Wed 14 Jun 2017 11:16:21 BST
# gpg:                using RSA key 0xF487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>"
# gpg:                 aka "Juan Quintela <quintela@trasno.org>"
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* remotes/juanquintela/tags/migration/20170614:
  migration: Don't create decompression threads if not enabled
  migration: Test for disabled features on reception
  migration: Remove unneeded includes
  migration: fix incorrect enable return path
  migration: Fix compilation with older compilers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-06-15 09:43:12 +01:00
commit 73aa4692ec
17 changed files with 30 additions and 44 deletions

View File

@ -14,9 +14,6 @@
#define QEMU_COLO_H
#include "qemu-common.h"
#include "qemu/coroutine_int.h"
#include "qemu/thread.h"
#include "qemu/main-loop.h"
bool colo_supported(void);
void colo_info_init(void);

View File

@ -14,6 +14,8 @@
#ifndef MIGRATION_MISC_H
#define MIGRATION_MISC_H
#include "qemu/notify.h"
/* migration/ram.c */
void ram_mig_init(void);

View File

@ -14,9 +14,6 @@
#ifndef MIGRATION_REGISTER_H
#define MIGRATION_REGISTER_H
typedef void SaveStateHandler(QEMUFile *f, void *opaque);
typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
typedef struct SaveVMHandlers {
/* This runs inside the iothread lock. */
SaveStateHandler *save_state;

View File

@ -29,7 +29,6 @@
#include "migration/qjson.h"
typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
typedef struct VMStateInfo VMStateInfo;
typedef struct VMStateDescription VMStateDescription;
typedef struct VMStateField VMStateField;

View File

@ -96,5 +96,7 @@ typedef struct uWireSlave uWireSlave;
typedef struct VirtIODevice VirtIODevice;
typedef struct Visitor Visitor;
typedef struct node_info NodeInfo;
typedef void SaveStateHandler(QEMUFile *f, void *opaque);
typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
#endif /* QEMU_TYPEDEFS_H */

View File

@ -15,19 +15,13 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "block/block.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "hw/hw.h"
#include "qemu/cutils.h"
#include "qemu/queue.h"
#include "qemu/timer.h"
#include "block.h"
#include "migration/misc.h"
#include "migration.h"
#include "migration/register.h"
#include "sysemu/blockdev.h"
#include "qemu-file.h"
#include "migration/vmstate.h"
#include "sysemu/block-backend.h"

View File

@ -13,6 +13,8 @@
#include "qemu/osdep.h"
#include "migration/colo.h"
#include "migration/failover.h"
#include "qemu/main-loop.h"
#include "migration.h"
#include "qmp-commands.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"

View File

@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
#include "qemu/timer.h"
#include "sysemu/sysemu.h"
#include "qemu-file-channel.h"
#include "migration.h"
@ -22,7 +21,6 @@
#include "io/channel-buffer.h"
#include "trace.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "migration/failover.h"
#include "replication.h"
#include "qmp-commands.h"

View File

@ -19,10 +19,8 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "channel.h"
#include "exec.h"
#include "migration.h"
#include "io/channel-command.h"
#include "trace.h"

View File

@ -16,10 +16,8 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "channel.h"
#include "fd.h"
#include "migration.h"
#include "monitor/monitor.h"
#include "io/channel-util.h"
#include "trace.h"

View File

@ -17,7 +17,6 @@
#include "qapi/util.h"
#include "migration/global_state.h"
#include "migration/vmstate.h"
#include "sysemu/sysemu.h"
#include "trace.h"
typedef struct {

View File

@ -16,7 +16,6 @@
#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "migration/blocker.h"
#include "exec.h"
#include "fd.h"
@ -30,11 +29,9 @@
#include "qemu-file-channel.h"
#include "qemu-file.h"
#include "migration/vmstate.h"
#include "sysemu/sysemu.h"
#include "block/block.h"
#include "qapi/qmp/qerror.h"
#include "qapi/util.h"
#include "qemu/sockets.h"
#include "qemu/rcu.h"
#include "block.h"
#include "postcopy-ram.h"
@ -42,9 +39,6 @@
#include "qmp-commands.h"
#include "trace.h"
#include "qapi-event.h"
#include "qom/cpu.h"
#include "exec/memory.h"
#include "exec/address-spaces.h"
#include "exec/target_page.h"
#include "io/channel-buffer.h"
#include "migration/colo.h"
@ -1814,7 +1808,11 @@ static void *migration_thread(void *opaque)
qemu_savevm_state_header(s->to_dst_file);
if (s->to_dst_file) {
/*
* If we opened the return path, we need to make sure dst has it
* opened as well.
*/
if (s->rp_state.from_dst_file) {
/* Now tell the dest that it should open its end so it can reply */
qemu_savevm_send_open_return_path(s->to_dst_file);

View File

@ -14,10 +14,8 @@
#ifndef QEMU_MIGRATION_H
#define QEMU_MIGRATION_H
#include "qapi/qmp/qdict.h"
#include "qemu-common.h"
#include "qemu/thread.h"
#include "qemu/notify.h"
#include "qapi-types.h"
#include "exec/cpu-common.h"
#include "qemu/coroutine_int.h"

View File

@ -17,8 +17,6 @@
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "exec/target_page.h"
#include "migration.h"
#include "qemu-file.h"

View File

@ -26,8 +26,6 @@
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/iov.h"
#include "qemu/sockets.h"
#include "qemu/coroutine.h"
#include "migration.h"
#include "qemu-file.h"
#include "trace.h"

View File

@ -26,14 +26,12 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "cpu.h"
#include <zlib.h>
#include "qapi-event.h"
#include "qemu/cutils.h"
#include "qemu/bitops.h"
#include "qemu/bitmap.h"
#include "qemu/timer.h"
#include "qemu/main-loop.h"
#include "xbzrle.h"
#include "ram.h"
@ -41,9 +39,7 @@
#include "migration/register.h"
#include "migration/misc.h"
#include "qemu-file.h"
#include "migration/vmstate.h"
#include "postcopy-ram.h"
#include "exec/address-spaces.h"
#include "migration/page_cache.h"
#include "qemu/error-report.h"
#include "trace.h"
@ -2238,6 +2234,9 @@ void migrate_decompress_threads_create(void)
{
int i, thread_count;
if (!migrate_use_compression()) {
return;
}
thread_count = migrate_decompress_threads();
decompress_threads = g_new0(QemuThread, thread_count);
decomp_param = g_new0(DecompressParam, thread_count);
@ -2259,6 +2258,9 @@ void migrate_decompress_threads_join(void)
{
int i, thread_count;
if (!migrate_use_compression()) {
return;
}
thread_count = migrate_decompress_threads();
for (i = 0; i < thread_count; i++) {
qemu_mutex_lock(&decomp_param[i].mutex);
@ -2459,7 +2461,7 @@ static int ram_load_postcopy(QEMUFile *f)
static int ram_load(QEMUFile *f, void *opaque, int version_id)
{
int flags = 0, ret = 0;
int flags = 0, ret = 0, invalid_flags = 0;
static uint64_t seq_iter;
int len = 0;
/*
@ -2476,6 +2478,9 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
ret = -EINVAL;
}
if (!migrate_use_compression()) {
invalid_flags |= RAM_SAVE_FLAG_COMPRESS_PAGE;
}
/* This RCU critical section can be very long running.
* When RCU reclaims in the code start to become numerous,
* it will be necessary to reduce the granularity of this
@ -2496,6 +2501,15 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
flags = addr & ~TARGET_PAGE_MASK;
addr &= TARGET_PAGE_MASK;
if (flags & invalid_flags) {
if (flags & invalid_flags & RAM_SAVE_FLAG_COMPRESS_PAGE) {
error_report("Received an unexpected compressed page");
}
ret = -EINVAL;
break;
}
if (flags & (RAM_SAVE_FLAG_ZERO | RAM_SAVE_FLAG_PAGE |
RAM_SAVE_FLAG_COMPRESS_PAGE | RAM_SAVE_FLAG_XBZRLE)) {
RAMBlock *block = ram_block_from_stream(f, flags);

View File

@ -28,12 +28,8 @@
#include "qemu/osdep.h"
#include "hw/boards.h"
#include "hw/hw.h"
#include "hw/qdev.h"
#include "hw/xen/xen.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "qemu/timer.h"
#include "migration.h"
#include "migration/snapshot.h"
#include "migration/misc.h"
@ -46,13 +42,11 @@
#include "postcopy-ram.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "qemu/queue.h"
#include "sysemu/cpus.h"
#include "exec/memory.h"
#include "exec/target_page.h"
#include "qmp-commands.h"
#include "trace.h"
#include "qemu/bitops.h"
#include "qemu/iov.h"
#include "block/snapshot.h"
#include "qemu/cutils.h"