[5/6] Remove duplicated code

Submitted by Pierre Riteau on Nov. 26, 2009, 6:44 p.m.

Details

Message ID 1259261046-32650-6-git-send-email-Pierre.Riteau@irisa.fr
State New
Headers show

Commit Message

Pierre Riteau Nov. 26, 2009, 6:44 p.m.
Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>
---
 block-migration.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/block-migration.c b/block-migration.c
index aff4c20..e09db78 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -313,7 +313,8 @@  static void blk_mig_save_dirty_blocks(QEMUFile *f)
     int len;
 
     QSIMPLEQ_FOREACH(bmds, &block_mig_state->bmds_list, entries) {
-        for (sector = 0; sector < bmds->cur_sector;) {
+        for (sector = 0; sector < bmds->cur_sector;
+                sector += block_mig_state->sectors_per_block) {
 
             if (bdrv_get_dirty(bmds->bs, sector)) {
 
@@ -337,10 +338,6 @@  static void blk_mig_save_dirty_blocks(QEMUFile *f)
                 bdrv_reset_dirty(bmds->bs, sector,
                                  block_mig_state->sectors_per_block);
 
-                sector += block_mig_state->sectors_per_block;
-            } else {
-                /* sector is clean */
-                sector += block_mig_state->sectors_per_block;
             }
         }
     }