[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/42] migration: simplify while loop
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 01/42] migration: simplify while loop |
Date: |
Fri, 22 Feb 2013 17:36:07 +0100 |
Unify the goto around the loop, with the exit condition at the end of it.
Both can be expressed as "while (ret >= 0)".
Signed-off-by: Paolo Bonzini <address@hidden>
---
migration.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/migration.c b/migration.c
index 11725ae..ba8b647 100644
--- a/migration.c
+++ b/migration.c
@@ -666,14 +666,9 @@ static void *buffered_file_thread(void *opaque)
qemu_mutex_lock_iothread();
DPRINTF("beginning savevm\n");
ret = qemu_savevm_state_begin(s->file, &s->params);
- if (ret < 0) {
- DPRINTF("failed, %d\n", ret);
- qemu_mutex_unlock_iothread();
- goto out;
- }
qemu_mutex_unlock_iothread();
- while (true) {
+ while (ret >= 0) {
int64_t current_time;
uint64_t pending_size;
@@ -754,12 +749,8 @@ static void *buffered_file_thread(void *opaque)
sleep_time += qemu_get_clock_ms(rt_clock) - current_time;
}
ret = buffered_flush(s);
- if (ret < 0) {
- break;
- }
}
-out:
if (ret < 0) {
migrate_fd_error(s);
}
--
1.8.1.2
- [Qemu-devel] [PATCH v2 00/42] Migration cleanups and latency improvements, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 01/42] migration: simplify while loop,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 04/42] migration: push qemu_savevm_state_cancel out of qemu_savevm_state_*, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 05/42] block-migration: remove useless calls to blk_mig_cleanup, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 02/42] migration: always use vm_stop_force_state, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 06/42] qemu-file: pass errno from qemu_fflush via f->last_error, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 08/42] qemu-file: temporarily expose qemu_file_set_error and qemu_fflush, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 03/42] migration: move more error handling to migrate_fd_cleanup, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 11/42] migration: simplify error handling, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 09/42] migration: flush all data to fd when buffered_flush is called, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 16/42] block-migration: remove variables that are never read, Paolo Bonzini, 2013/02/22
- [Qemu-devel] [PATCH 13/42] migration: add migrate_set_state tracepoint, Paolo Bonzini, 2013/02/22