diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-19 16:36:51 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-19 16:43:46 +0100 |
commit | 14c1f7deb43ec0e1a7f2eabfe652bfad1124392d (patch) | |
tree | ce122bd7827f2bcc9120e28fb1bf63b498f18fd4 /include | |
parent | 56821559f0ba682fe6b367815572e6f974d329ab (diff) | |
parent | 46d702b106d20beda2fcd0f96ddc44855ba262b3 (diff) | |
download | qemu-14c1f7deb43ec0e1a7f2eabfe652bfad1124392d.zip qemu-14c1f7deb43ec0e1a7f2eabfe652bfad1124392d.tar.gz qemu-14c1f7deb43ec0e1a7f2eabfe652bfad1124392d.tar.bz2 |
Merge remote-tracking branch 'quintela/tags/migration/20170518' into staging
migration/next for 20170518
# gpg: Signature made Thu 18 May 2017 06:23:26 PM 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
* quintela/tags/migration/20170518:
migration: Make savevm.c target independent
exec: Create include for target_page_size()
migration: migration.h was not needed
migration: Remove vmstate.h from migration.h
migration: Remove qemu-file.h from vmstate.h
migration: Split vmstate-types.c from vmstate.c
migration: Move qjson.h to migration/
migration: Remove migration.h from colo.h
migration: Export qemu-file-channel.c functions in its own file
migration: Split migration/channel.c for channel operations
migration: Create migration/xbzrle.h
block migration: Allow compile time disable
migration: Remove old MigrationParams
migration: Remove use of old MigrationParams
migration: Create block capability
hmp: Use visitor api for hmp_migrate_set_parameter()
postcopy: Require RAMBlocks that are whole pages
migration: Fix non-multiple of page size migration
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/target_page.h | 21 | ||||
-rw-r--r-- | include/hw/hw.h | 1 | ||||
-rw-r--r-- | include/migration/block.h | 24 | ||||
-rw-r--r-- | include/migration/colo.h | 1 | ||||
-rw-r--r-- | include/migration/migration.h | 30 | ||||
-rw-r--r-- | include/migration/qemu-file.h | 4 | ||||
-rw-r--r-- | include/migration/qjson.h | 29 | ||||
-rw-r--r-- | include/migration/vmstate.h | 4 | ||||
-rw-r--r-- | include/qemu/typedefs.h | 1 | ||||
-rw-r--r-- | include/sysemu/sysemu.h | 4 |
10 files changed, 56 insertions, 63 deletions
diff --git a/include/exec/target_page.h b/include/exec/target_page.h new file mode 100644 index 0000000..96726c3 --- /dev/null +++ b/include/exec/target_page.h @@ -0,0 +1,21 @@ +/* + * Target page sizes and friends for non target files + * + * Copyright (c) 2017 Red Hat Inc + * + * Authors: + * David Alan Gilbert <dgilbert@redhat.com> + * Juan Quintela <quintela@redhat.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef EXEC_TARGET_PAGE_H +#define EXEC_TARGET_PAGE_H + +size_t qemu_target_page_size(void); +int qemu_target_page_bits(void); +int qemu_target_page_bits_min(void); + +#endif diff --git a/include/hw/hw.h b/include/hw/hw.h index e22d4ce..af9eae1 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -11,6 +11,7 @@ #include "exec/memory.h" #include "hw/irq.h" #include "migration/vmstate.h" +#include "migration/qemu-file.h" #include "qemu/module.h" #include "sysemu/reset.h" diff --git a/include/migration/block.h b/include/migration/block.h index 41a1ac8..28cff53 100644 --- a/include/migration/block.h +++ b/include/migration/block.h @@ -14,10 +14,34 @@ #ifndef MIGRATION_BLOCK_H #define MIGRATION_BLOCK_H +#ifdef CONFIG_LIVE_BLOCK_MIGRATION void blk_mig_init(void); int blk_mig_active(void); uint64_t blk_mig_bytes_transferred(void); uint64_t blk_mig_bytes_remaining(void); uint64_t blk_mig_bytes_total(void); +#else +static inline void blk_mig_init(void) { } +static inline int blk_mig_active(void) +{ + return false; +} +static inline uint64_t blk_mig_bytes_transferred(void) +{ + return 0; +} + +static inline uint64_t blk_mig_bytes_remaining(void) +{ + return 0; +} + +static inline uint64_t blk_mig_bytes_total(void) +{ + return 0; +} +#endif /* CONFIG_LIVE_BLOCK_MIGRATION */ + +void migrate_set_block_enabled(bool value, Error **errp); #endif /* MIGRATION_BLOCK_H */ diff --git a/include/migration/colo.h b/include/migration/colo.h index 2bbff9e..ba0bb6e 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -14,7 +14,6 @@ #define QEMU_COLO_H #include "qemu-common.h" -#include "migration/migration.h" #include "qemu/coroutine_int.h" #include "qemu/thread.h" #include "qemu/main-loop.h" diff --git a/include/migration/migration.h b/include/migration/migration.h index 49ec501..0e807b6 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -18,7 +18,7 @@ #include "qemu-common.h" #include "qemu/thread.h" #include "qemu/notify.h" -#include "migration/vmstate.h" +#include "io/channel.h" #include "qapi-types.h" #include "exec/cpu-common.h" #include "qemu/coroutine_int.h" @@ -38,11 +38,6 @@ #define QEMU_VM_COMMAND 0x08 #define QEMU_VM_SECTION_FOOTER 0x7e -struct MigrationParams { - bool blk; - bool shared; -}; - /* Messages sent on the return path from destination to source */ enum mig_rp_message_type { MIG_RP_MSG_INVALID = 0, /* Must be 0 */ @@ -110,12 +105,10 @@ struct MigrationState QEMUBH *cleanup_bh; QEMUFile *to_dst_file; - /* New style params from 'migrate-set-parameters' */ + /* params from 'migrate-set-parameters' */ MigrationParameters parameters; int state; - /* Old style params from 'migrate' command */ - MigrationParams params; /* State related to return path */ struct { @@ -153,6 +146,9 @@ struct MigrationState /* The last error that occurred */ Error *error; + /* Do we have to clean up -b/-i from old migrate parameters */ + /* This feature is deprecated and will be removed */ + bool must_remove_block_options; }; void migrate_set_state(int *state, int old_state, int new_state); @@ -161,17 +157,10 @@ void migration_fd_process_incoming(QEMUFile *f); void qemu_start_incoming_migration(const char *uri, Error **errp); -void migration_channel_process_incoming(MigrationState *s, - QIOChannel *ioc); - void migration_tls_channel_process_incoming(MigrationState *s, QIOChannel *ioc, Error **errp); -void migration_channel_connect(MigrationState *s, - QIOChannel *ioc, - const char *hostname); - void migration_tls_channel_connect(MigrationState *s, QIOChannel *ioc, const char *hostname, @@ -205,7 +194,7 @@ void migrate_fd_connect(MigrationState *s); void add_migration_state_change_notifier(Notifier *notify); void remove_migration_state_change_notifier(Notifier *notify); -MigrationState *migrate_init(const MigrationParams *params); +MigrationState *migrate_init(void); bool migration_is_blocked(Error **errp); bool migration_in_setup(MigrationState *); bool migration_is_idle(void); @@ -255,16 +244,15 @@ bool migrate_zero_blocks(void); bool migrate_auto_converge(void); -int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen, - uint8_t *dst, int dlen); -int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int dlen); - int migrate_use_xbzrle(void); int64_t migrate_xbzrle_cache_size(void); bool migrate_colo_enabled(void); int64_t xbzrle_cache_resize(int64_t new_size); +bool migrate_use_block(void); +bool migrate_use_block_incremental(void); + bool migrate_use_compression(void); int migrate_compress_level(void); int migrate_compress_threads(void); diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index 0cd648a..b5ac800 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -27,8 +27,6 @@ #include "qemu-common.h" #include "exec/cpu-common.h" -#include "io/channel.h" - /* Read a chunk of data from a file at the given position. The pos argument * can be ignored if the file is only be used for streaming. The number of @@ -119,8 +117,6 @@ typedef struct QEMUFileHooks { } QEMUFileHooks; QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops); -QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc); -QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc); void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks); int qemu_get_fd(QEMUFile *f); int qemu_fclose(QEMUFile *f); diff --git a/include/migration/qjson.h b/include/migration/qjson.h deleted file mode 100644 index 2978b5f..0000000 --- a/include/migration/qjson.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * QEMU JSON writer - * - * Copyright Alexander Graf - * - * Authors: - * Alexander Graf <agraf@suse.de> - * - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. - * See the COPYING.LIB file in the top-level directory. - * - */ -#ifndef QEMU_QJSON_H -#define QEMU_QJSON_H - -typedef struct QJSON QJSON; - -QJSON *qjson_new(void); -void qjson_destroy(QJSON *json); -void json_prop_str(QJSON *json, const char *name, const char *str); -void json_prop_int(QJSON *json, const char *name, int64_t val); -void json_end_array(QJSON *json); -void json_start_array(QJSON *json, const char *name); -void json_end_object(QJSON *json); -void json_start_object(QJSON *json, const char *name); -const char *qjson_get_str(QJSON *json); -void qjson_finish(QJSON *json); - -#endif /* QEMU_QJSON_H */ diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 8489659..f97411d 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -27,9 +27,6 @@ #ifndef QEMU_VMSTATE_H #define QEMU_VMSTATE_H -#ifndef CONFIG_USER_ONLY -#include "migration/qemu-file.h" -#endif #include "migration/qjson.h" typedef void SaveStateHandler(QEMUFile *f, void *opaque); @@ -37,7 +34,6 @@ typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id); typedef struct SaveVMHandlers { /* This runs inside the iothread lock. */ - void (*set_params)(const MigrationParams *params, void * opaque); SaveStateHandler *save_state; void (*cleanup)(void *opaque); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 7d85057..33a6aa1 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -49,7 +49,6 @@ typedef struct MemoryRegion MemoryRegion; typedef struct MemoryRegionCache MemoryRegionCache; typedef struct MemoryRegionSection MemoryRegionSection; typedef struct MigrationIncomingState MigrationIncomingState; -typedef struct MigrationParams MigrationParams; typedef struct MigrationState MigrationState; typedef struct Monitor Monitor; typedef struct MonitorDef MonitorDef; diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 83c1ceb..ed8fe3b 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -67,7 +67,6 @@ int qemu_reset_requested_get(void); void qemu_system_killed(int signal, pid_t pid); void qemu_system_reset(bool report); void qemu_system_guest_panicked(GuestPanicInformation *info); -size_t qemu_target_page_size(void); void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify); @@ -102,8 +101,7 @@ enum qemu_vm_cmd { #define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24) bool qemu_savevm_state_blocked(Error **errp); -void qemu_savevm_state_begin(QEMUFile *f, - const MigrationParams *params); +void qemu_savevm_state_begin(QEMUFile *f); void qemu_savevm_state_header(QEMUFile *f); int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); void qemu_savevm_state_cleanup(void); |