[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 26/41] migration: detect error before sleeping
From: |
Orit Wasserman |
Subject: |
Re: [Qemu-devel] [PATCH 26/41] migration: detect error before sleeping |
Date: |
Thu, 21 Feb 2013 09:27:20 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 02/15/2013 07:46 PM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> migration.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/migration.c b/migration.c
> index 5e2077e..63ecab5 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -644,6 +644,10 @@ static void *migration_thread(void *opaque)
> }
> }
> }
> + if (qemu_file_get_error(s->file)) {
> + __sync_val_compare_and_swap(&s->state, MIG_STATE_ACTIVE,
> MIG_STATE_ERROR);
> + break;
> + }
> if (current_time >= initial_time + BUFFER_DELAY) {
> uint64_t transferred_bytes = s->bytes_xfer;
> uint64_t time_spent = current_time - initial_time;
> @@ -661,9 +665,6 @@ static void *migration_thread(void *opaque)
> /* usleep expects microseconds */
> g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
> }
> - if (qemu_file_get_error(s->file)) {
> - __sync_val_compare_and_swap(&s->state, MIG_STATE_ACTIVE,
> MIG_STATE_ERROR);
> - }
> }
>
> qemu_mutex_lock_iothread();
>
Reviewed-by: Orit Wasserman <address@hidden>
- [Qemu-devel] [PATCH 22/41] migration: yay, buffering is gone, (continued)
- [Qemu-devel] [PATCH 22/41] migration: yay, buffering is gone, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 27/41] migration: remove useless qemu_file_get_error check, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 25/41] migration: eliminate last_round, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 26/41] migration: detect error before sleeping, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 30/41] qemu-file: fsync a writable stdio QEMUFile, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 31/41] qemu-file: check exit status when closing a pipe QEMUFile, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 39/41] migration: move contents of migration_close to migrate_fd_cleanup, Paolo Bonzini, 2013/02/15