[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 17/41] block-migration: document usage of state
From: |
Orit Wasserman |
Subject: |
Re: [Qemu-devel] [PATCH 17/41] block-migration: document usage of state across threads |
Date: |
Mon, 18 Feb 2013 15:50:12 +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>
> ---
> block-migration.c | 23 ++++++++++++++++++-----
> 1 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/block-migration.c b/block-migration.c
> index fe3c040..21842b2 100644
> --- a/block-migration.c
> +++ b/block-migration.c
> @@ -43,18 +43,24 @@
> #endif
>
> typedef struct BlkMigDevState {
> + /* Written during setup phase. Can be read without a lock. */
> BlockDriverState *bs;
> - int bulk_completed;
> int shared_base;
> - int64_t cur_sector;
> - int64_t cur_dirty;
> - int64_t completed_sectors;
> int64_t total_sectors;
> QSIMPLEQ_ENTRY(BlkMigDevState) entry;
> +
> + /* Only used by migration thread. Does not need a lock. */
> + int bulk_completed;
> + int64_t cur_sector;
> + int64_t cur_dirty;
> +
> + /* Protected by iothread lock. */
> unsigned long *aio_bitmap;
> + int64_t completed_sectors;
> } BlkMigDevState;
>
> typedef struct BlkMigBlock {
> + /* Only used by migration thread. */
> uint8_t *buf;
> BlkMigDevState *bmds;
> int64_t sector;
> @@ -62,19 +68,26 @@ typedef struct BlkMigBlock {
> struct iovec iov;
> QEMUIOVector qiov;
> BlockDriverAIOCB *aiocb;
> +
> + /* Protected by iothread lock. */
> int ret;
> QSIMPLEQ_ENTRY(BlkMigBlock) entry;
> } BlkMigBlock;
>
> typedef struct BlkMigState {
> + /* Written during setup phase. Can be read without a lock. */
> int blk_enable;
> int shared_base;
> QSIMPLEQ_HEAD(bmds_list, BlkMigDevState) bmds_list;
> + int64_t total_sector_sum;
> +
> + /* Protected by iothread lock. */
> QSIMPLEQ_HEAD(blk_list, BlkMigBlock) blk_list;
> int submitted;
> int read_done;
> +
> + /* Only used by migration thread. Does not need a lock. */
> int transferred;
> - int64_t total_sector_sum;
> int prev_progress;
> int bulk_completed;
> } BlkMigState;
>
Maybe update the commit message of the code movements.
Reviewed-by: Orit Wasserman <address@hidden>
- [Qemu-devel] [PATCH 30/41] qemu-file: fsync a writable stdio QEMUFile, (continued)
- [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
- [Qemu-devel] [PATCH 36/41] migration: use qemu_ftell to compute bandwidth, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 38/41] migration: move rate limiting to QEMUFile, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 41/41] migration: inline migrate_fd_close, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 40/41] migration: eliminate s->migration_file, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 17/41] block-migration: document usage of state across threads, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 13/41] migration: prepare to access s->state outside critical sections, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 16/41] block-migration: small preparatory changes for locking, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 19/41] migration: reorder SaveVMHandlers members, Paolo Bonzini, 2013/02/15