@@ -1220,7 +1220,7 @@ static void migrate_error_free(MigrationState *s)
12201220 }
12211221}
12221222
1223- void migrate_fd_error (MigrationState * s , const Error * error )
1223+ static void migrate_fd_error (MigrationState * s , const Error * error )
12241224{
12251225 trace_migrate_fd_error (error_get_pretty (error ));
12261226 assert (s -> to_dst_file == NULL );
@@ -1637,6 +1637,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
16371637 bool has_inc , bool inc , bool has_detach , bool detach ,
16381638 bool has_resume , bool resume , Error * * errp )
16391639{
1640+ bool resume_requested ;
16401641 Error * local_err = NULL ;
16411642 MigrationState * s = migrate_get_current ();
16421643 const char * p = NULL ;
@@ -1646,13 +1647,14 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
16461647 return ;
16471648 }
16481649
1650+ resume_requested = has_resume && resume ;
16491651 if (!migrate_prepare (s , has_blk && blk , has_inc && inc ,
1650- has_resume && resume , errp )) {
1652+ resume_requested , errp )) {
16511653 /* Error detected, put into errp */
16521654 return ;
16531655 }
16541656
1655- if (!( has_resume && resume ) ) {
1657+ if (!resume_requested ) {
16561658 if (!yank_register_instance (MIGRATION_YANK_INSTANCE , errp )) {
16571659 return ;
16581660 }
@@ -1671,7 +1673,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
16711673 } else if (strstart (uri , "fd:" , & p )) {
16721674 fd_start_outgoing_migration (s , p , & local_err );
16731675 } else {
1674- if (!( has_resume && resume ) ) {
1676+ if (!resume_requested ) {
16751677 yank_unregister_instance (MIGRATION_YANK_INSTANCE );
16761678 }
16771679 error_setg (errp , QERR_INVALID_PARAMETER_VALUE , "uri" ,
@@ -1683,7 +1685,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
16831685 }
16841686
16851687 if (local_err ) {
1686- if (!( has_resume && resume ) ) {
1688+ if (!resume_requested ) {
16871689 yank_unregister_instance (MIGRATION_YANK_INSTANCE );
16881690 }
16891691 migrate_fd_error (s , local_err );
0 commit comments