Patchwork [15/41] block-migration: remove variables that are never read

login
register
mail settings
Submitter Paolo Bonzini
Date Feb. 15, 2013, 5:46 p.m.
Message ID <1360950433-17106-16-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/220796/
State New
Headers show

Comments

Paolo Bonzini - Feb. 15, 2013, 5:46 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block-migration.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)
Orit Wasserman - Feb. 18, 2013, 10:54 a.m.
On 02/15/2013 07:46 PM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block-migration.c |   13 -------------
>  1 files changed, 0 insertions(+), 13 deletions(-)
> 
> diff --git a/block-migration.c b/block-migration.c
> index e6c917d..e72f322 100644
> --- a/block-migration.c
> +++ b/block-migration.c
> @@ -50,7 +50,6 @@ typedef struct BlkMigDevState {
>      int64_t cur_dirty;
>      int64_t completed_sectors;
>      int64_t total_sectors;
> -    int64_t dirty;
>      QSIMPLEQ_ENTRY(BlkMigDevState) entry;
>      unsigned long *aio_bitmap;
>  } BlkMigDevState;
> @@ -78,7 +77,6 @@ typedef struct BlkMigState {
>      int64_t total_sector_sum;
>      int prev_progress;
>      int bulk_completed;
> -    long double prev_time_offset;
>  } BlkMigState;
>  
>  static BlkMigState block_mig_state;
> @@ -179,13 +177,10 @@ static void alloc_aio_bitmap(BlkMigDevState *bmds)
>  
>  static void blk_mig_read_cb(void *opaque, int ret)
>  {
> -    long double curr_time = qemu_get_clock_ns(rt_clock);
>      BlkMigBlock *blk = opaque;
>  
>      blk->ret = ret;
>  
> -    block_mig_state.prev_time_offset = curr_time;
> -
>      QSIMPLEQ_INSERT_TAIL(&block_mig_state.blk_list, blk, entry);
>      bmds_set_aio_inflight(blk->bmds, blk->sector, blk->nr_sectors, 0);
>  
> @@ -236,10 +231,6 @@ static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds)
>      blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
>      qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);
>  
> -    if (block_mig_state.submitted == 0) {
> -        block_mig_state.prev_time_offset = qemu_get_clock_ns(rt_clock);
> -    }
> -
>      blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov,
>                                  nr_sectors, blk_mig_read_cb, blk);
>      block_mig_state.submitted++;
> @@ -382,10 +373,6 @@ static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds,
>                  blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
>                  qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);
>  
> -                if (block_mig_state.submitted == 0) {
> -                    block_mig_state.prev_time_offset = qemu_get_clock_ns(rt_clock);
> -                }
> -
>                  blk->aiocb = bdrv_aio_readv(bmds->bs, sector, &blk->qiov,
>                                              nr_sectors, blk_mig_read_cb, blk);
>                  block_mig_state.submitted++;
> 

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Juan Quintela - Feb. 22, 2013, 10:50 a.m.
Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

Patch

diff --git a/block-migration.c b/block-migration.c
index e6c917d..e72f322 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -50,7 +50,6 @@  typedef struct BlkMigDevState {
     int64_t cur_dirty;
     int64_t completed_sectors;
     int64_t total_sectors;
-    int64_t dirty;
     QSIMPLEQ_ENTRY(BlkMigDevState) entry;
     unsigned long *aio_bitmap;
 } BlkMigDevState;
@@ -78,7 +77,6 @@  typedef struct BlkMigState {
     int64_t total_sector_sum;
     int prev_progress;
     int bulk_completed;
-    long double prev_time_offset;
 } BlkMigState;
 
 static BlkMigState block_mig_state;
@@ -179,13 +177,10 @@  static void alloc_aio_bitmap(BlkMigDevState *bmds)
 
 static void blk_mig_read_cb(void *opaque, int ret)
 {
-    long double curr_time = qemu_get_clock_ns(rt_clock);
     BlkMigBlock *blk = opaque;
 
     blk->ret = ret;
 
-    block_mig_state.prev_time_offset = curr_time;
-
     QSIMPLEQ_INSERT_TAIL(&block_mig_state.blk_list, blk, entry);
     bmds_set_aio_inflight(blk->bmds, blk->sector, blk->nr_sectors, 0);
 
@@ -236,10 +231,6 @@  static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds)
     blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
     qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);
 
-    if (block_mig_state.submitted == 0) {
-        block_mig_state.prev_time_offset = qemu_get_clock_ns(rt_clock);
-    }
-
     blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov,
                                 nr_sectors, blk_mig_read_cb, blk);
     block_mig_state.submitted++;
@@ -382,10 +373,6 @@  static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds,
                 blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
                 qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);
 
-                if (block_mig_state.submitted == 0) {
-                    block_mig_state.prev_time_offset = qemu_get_clock_ns(rt_clock);
-                }
-
                 blk->aiocb = bdrv_aio_readv(bmds->bs, sector, &blk->qiov,
                                             nr_sectors, blk_mig_read_cb, blk);
                 block_mig_state.submitted++;