From 772c6212d2bcdb6adcb2a0d906745b42903b2ecf Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Fri, 29 Mar 2019 17:57:13 +0800 Subject: migration: comment VMSTATE_UNUSED*() properly It is error prone to use VMSTATE_UNUSED*() sometimes especially when the size of the migration stream of the field is not the same as the size of the structure (boolean is one example). Comment it well so people will be aware of this when people want to use it. Signed-off-by: Peter Xu Message-Id: <20190329095713.14177-1-peterx@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/vmstate.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index a668ec7..9224370 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -1035,6 +1035,20 @@ extern const VMStateInfo vmstate_info_qtailq; #define VMSTATE_BUFFER_UNSAFE(_field, _state, _version, _size) \ VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, vmstate_info_buffer, _size) +/* + * These VMSTATE_UNUSED*() macros can be used to fill in the holes + * when some of the vmstate fields are obsolete to be compatible with + * migrations between new/old binaries. + * + * CAUTION: when using any of the VMSTATE_UNUSED*() macros please be + * sure that the size passed in is the size that was actually *sent* + * rather than the size of the *structure*. One example is the + * boolean type - the size of the structure can vary depending on the + * definition of boolean, however the size we actually sent is always + * 1 byte (please refer to implementation of VMSTATE_BOOL_V and + * vmstate_info_bool). So here we should always pass in size==1 + * rather than size==sizeof(bool). + */ #define VMSTATE_UNUSED_V(_v, _size) \ VMSTATE_UNUSED_BUFFER(NULL, _v, _size) -- cgit v1.1 From c0913d1dfd0456a54f412a63c60659b72eb7093b Mon Sep 17 00:00:00 2001 From: Zhang Chen Date: Fri, 26 Apr 2019 17:07:28 +0800 Subject: migration/colo.c: Remove redundant input parameter The colo_do_failover no need the input parameter. Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-2-chen.zhang@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/colo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/migration/colo.h b/include/migration/colo.h index 99ce17a..ddebe0a 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -37,7 +37,7 @@ bool migration_incoming_in_colo_state(void); COLOMode get_colo_mode(void); /* failover */ -void colo_do_failover(MigrationState *s); +void colo_do_failover(void); void colo_checkpoint_notify(void *opaque); #endif -- cgit v1.1 From 9c16abcb9264e62e4c24875a2208fba90032b789 Mon Sep 17 00:00:00 2001 From: Zhang Chen Date: Fri, 26 Apr 2019 17:07:29 +0800 Subject: migration/colo.h: Remove obsolete codes Signed-off-by: Zhang Chen Message-Id: <20190426090730.2691-3-chen.zhang@intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/colo.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/migration/colo.h b/include/migration/colo.h index ddebe0a..f6fbe23 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -22,8 +22,6 @@ enum colo_event { COLO_EVENT_FAILOVER, }; -void colo_info_init(void); - void migrate_start_colo_process(MigrationState *s); bool migration_in_colo_state(void); -- cgit v1.1