[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/23] block migration: Clean up use of total_sector
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 12/23] block migration: Clean up use of total_sectors |
Date: |
Mon, 30 Nov 2009 18:21:20 +0100 |
User-agent: |
StGIT/0.14.3 |
We already save total_sectors in BlkMigDevState, let's use this value
during the migration and avoid to recalculate it needlessly.
Signed-off-by: Jan Kiszka <address@hidden>
---
block-migration.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index ec32ee2..2f89a4e 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -96,10 +96,10 @@ static int mig_read_device_bulk(QEMUFile *f, BlkMigDevState
*bms)
blk->buf = qemu_malloc(BLOCK_SIZE);
cur_sector = bms->cur_sector;
- total_sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS;
+ total_sectors = bms->total_sectors;
if (bms->shared_base) {
- while (cur_sector < bms->total_sectors &&
+ while (cur_sector < total_sectors &&
!bdrv_is_allocated(bms->bs, cur_sector,
MAX_IS_ALLOCATED_SEARCH, &nr_sectors)) {
cur_sector += nr_sectors;
@@ -165,7 +165,7 @@ static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState
*bmds)
cur_sector = bmds->cur_sector;
if (bmds->shared_base) {
- while (cur_sector < bmds->total_sectors &&
+ while (cur_sector < total_sectors &&
!bdrv_is_allocated(bmds->bs, cur_sector,
MAX_IS_ALLOCATED_SEARCH, &nr_sectors)) {
cur_sector += nr_sectors;
- [Qemu-devel] [PATCH 16/23] ram migration: Stop loading on error, (continued)
- [Qemu-devel] [PATCH 16/23] ram migration: Stop loading on error, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 05/23] block migration: Cleanup dirty tracking code, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 06/23] block migration: Avoid large stack buffer, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 19/23] live migration: Propagate output monitor to callback handler, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 21/23] block migration: Report progress also via info migration, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 01/23] migration: Fix use of file after release, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 08/23] block migration: Drop dead code, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 17/23] live migration: Allow cleanup after cancellation or error, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 03/23] block migration: Fix coding style and whitespaces, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 15/23] block migration: Add error handling/propagation, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 12/23] block migration: Clean up use of total_sectors,
Jan Kiszka <=
- [Qemu-devel] [PATCH 14/23] block migration: Consolidate block transmission, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 09/23] Import a simple queue implementation from NetBSD, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 18/23] block migration: Report overall migration progress, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 22/23] block migration: Add support for restore progress reporting, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 10/23] block migration: Switch device and block lists to QSIMPLEQ, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 07/23] block migration: Avoid indirection of block_mig_state, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 11/23] block migration: Initialize remaining BlkMigState fields, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 20/23] block migration: Fix outgoing progress output, Jan Kiszka, 2009/11/30
- [Qemu-devel] [PATCH 04/23] block migration: Rework constants API, Jan Kiszka, 2009/11/30
- Re: [Qemu-devel] [PATCH 00/23] block migration: Fixes, cleanups and speedups, Anthony Liguori, 2009/11/30