mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
Migration pull for 9.0-rc2
- Avihai's two fixes on error paths -----BEGIN PGP SIGNATURE----- iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCZgmsOxIccGV0ZXJ4QHJl ZGhhdC5jb20ACgkQO1/MzfOr1waYKQD9G/B4c5u94Puhkr4o+K4M3FZ3J1pSpYRd nMAlrCWYLHQBAKV5q8DvgXbRNzT/Q+1UX7psxIsjyaqljxyJoZ+dIgAD =hucV -----END PGP SIGNATURE----- Merge tag 'migration-20240331-pull-request' of https://gitlab.com/peterx/qemu into staging Migration pull for 9.0-rc2 - Avihai's two fixes on error paths # -----BEGIN PGP SIGNATURE----- # # iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCZgmsOxIccGV0ZXJ4QHJl # ZGhhdC5jb20ACgkQO1/MzfOr1waYKQD9G/B4c5u94Puhkr4o+K4M3FZ3J1pSpYRd # nMAlrCWYLHQBAKV5q8DvgXbRNzT/Q+1UX7psxIsjyaqljxyJoZ+dIgAD # =hucV # -----END PGP SIGNATURE----- # gpg: Signature made Sun 31 Mar 2024 19:32:27 BST # gpg: using EDDSA key B9184DC20CC457DACF7DD1A93B5FCCCDF3ABD706 # gpg: issuer "peterx@redhat.com" # gpg: Good signature from "Peter Xu <xzpeter@gmail.com>" [marginal] # gpg: aka "Peter Xu <peterx@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: B918 4DC2 0CC4 57DA CF7D D1A9 3B5F CCCD F3AB D706 * tag 'migration-20240331-pull-request' of https://gitlab.com/peterx/qemu: migration/postcopy: Ensure postcopy_start() sets errp if it fails migration: Set migration error in migration_completion() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
6af9d12c88
1 changed files with 18 additions and 0 deletions
|
@ -2510,6 +2510,8 @@ static int postcopy_start(MigrationState *ms, Error **errp)
|
||||||
migration_wait_main_channel(ms);
|
migration_wait_main_channel(ms);
|
||||||
if (postcopy_preempt_establish_channel(ms)) {
|
if (postcopy_preempt_establish_channel(ms)) {
|
||||||
migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED);
|
migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED);
|
||||||
|
error_setg(errp, "%s: Failed to establish preempt channel",
|
||||||
|
__func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2525,17 +2527,22 @@ static int postcopy_start(MigrationState *ms, Error **errp)
|
||||||
|
|
||||||
ret = migration_stop_vm(ms, RUN_STATE_FINISH_MIGRATE);
|
ret = migration_stop_vm(ms, RUN_STATE_FINISH_MIGRATE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
error_setg_errno(errp, -ret, "%s: Failed to stop the VM", __func__);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = migration_maybe_pause(ms, &cur_state,
|
ret = migration_maybe_pause(ms, &cur_state,
|
||||||
MIGRATION_STATUS_POSTCOPY_ACTIVE);
|
MIGRATION_STATUS_POSTCOPY_ACTIVE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
error_setg_errno(errp, -ret, "%s: Failed in migration_maybe_pause()",
|
||||||
|
__func__);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = bdrv_inactivate_all();
|
ret = bdrv_inactivate_all();
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
error_setg_errno(errp, -ret, "%s: Failed in bdrv_inactivate_all()",
|
||||||
|
__func__);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
restart_block = true;
|
restart_block = true;
|
||||||
|
@ -2612,6 +2619,7 @@ static int postcopy_start(MigrationState *ms, Error **errp)
|
||||||
|
|
||||||
/* Now send that blob */
|
/* Now send that blob */
|
||||||
if (qemu_savevm_send_packaged(ms->to_dst_file, bioc->data, bioc->usage)) {
|
if (qemu_savevm_send_packaged(ms->to_dst_file, bioc->data, bioc->usage)) {
|
||||||
|
error_setg(errp, "%s: Failed to send packaged data", __func__);
|
||||||
goto fail_closefb;
|
goto fail_closefb;
|
||||||
}
|
}
|
||||||
qemu_fclose(fb);
|
qemu_fclose(fb);
|
||||||
|
@ -2799,6 +2807,7 @@ static void migration_completion(MigrationState *s)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int current_active_state = s->state;
|
int current_active_state = s->state;
|
||||||
|
Error *local_err = NULL;
|
||||||
|
|
||||||
if (s->state == MIGRATION_STATUS_ACTIVE) {
|
if (s->state == MIGRATION_STATUS_ACTIVE) {
|
||||||
ret = migration_completion_precopy(s, ¤t_active_state);
|
ret = migration_completion_precopy(s, ¤t_active_state);
|
||||||
|
@ -2832,6 +2841,15 @@ static void migration_completion(MigrationState *s)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
if (qemu_file_get_error_obj(s->to_dst_file, &local_err)) {
|
||||||
|
migrate_set_error(s, local_err);
|
||||||
|
error_free(local_err);
|
||||||
|
} else if (ret) {
|
||||||
|
error_setg_errno(&local_err, -ret, "Error in migration completion");
|
||||||
|
migrate_set_error(s, local_err);
|
||||||
|
error_free(local_err);
|
||||||
|
}
|
||||||
|
|
||||||
migration_completion_failed(s, current_active_state);
|
migration_completion_failed(s, current_active_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue