@@ -1220,7 +1220,7 @@ static void migrate_error_free(MigrationState *s)
1220
1220
}
1221
1221
}
1222
1222
1223
- void migrate_fd_error (MigrationState * s , const Error * error )
1223
+ static void migrate_fd_error (MigrationState * s , const Error * error )
1224
1224
{
1225
1225
trace_migrate_fd_error (error_get_pretty (error ));
1226
1226
assert (s -> to_dst_file == NULL );
@@ -1637,6 +1637,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
1637
1637
bool has_inc , bool inc , bool has_detach , bool detach ,
1638
1638
bool has_resume , bool resume , Error * * errp )
1639
1639
{
1640
+ bool resume_requested ;
1640
1641
Error * local_err = NULL ;
1641
1642
MigrationState * s = migrate_get_current ();
1642
1643
const char * p = NULL ;
@@ -1646,13 +1647,14 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
1646
1647
return ;
1647
1648
}
1648
1649
1650
+ resume_requested = has_resume && resume ;
1649
1651
if (!migrate_prepare (s , has_blk && blk , has_inc && inc ,
1650
- has_resume && resume , errp )) {
1652
+ resume_requested , errp )) {
1651
1653
/* Error detected, put into errp */
1652
1654
return ;
1653
1655
}
1654
1656
1655
- if (!( has_resume && resume ) ) {
1657
+ if (!resume_requested ) {
1656
1658
if (!yank_register_instance (MIGRATION_YANK_INSTANCE , errp )) {
1657
1659
return ;
1658
1660
}
@@ -1671,7 +1673,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
1671
1673
} else if (strstart (uri , "fd:" , & p )) {
1672
1674
fd_start_outgoing_migration (s , p , & local_err );
1673
1675
} else {
1674
- if (!( has_resume && resume ) ) {
1676
+ if (!resume_requested ) {
1675
1677
yank_unregister_instance (MIGRATION_YANK_INSTANCE );
1676
1678
}
1677
1679
error_setg (errp , QERR_INVALID_PARAMETER_VALUE , "uri" ,
@@ -1683,7 +1685,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
1683
1685
}
1684
1686
1685
1687
if (local_err ) {
1686
- if (!( has_resume && resume ) ) {
1688
+ if (!resume_requested ) {
1687
1689
yank_unregister_instance (MIGRATION_YANK_INSTANCE );
1688
1690
}
1689
1691
migrate_fd_error (s , local_err );
0 commit comments