Statistics
| Branch: | Revision:

root / block-migration.c @ 7fee199c

History | View | Annotate | Download (19.8 kB)

# Date Author Comment
ff5c52a3 04/27/2011 03:36 pm Avishay Traeger

Improve accuracy of block migration bandwidth calculation

block_mig_state.total_time is currently the sum of the read request
latencies. This is not very accurate because block migration uses aio and
so several requests can be submitted at once. Bandwidth should be computed...

155eb9aa 04/07/2011 02:51 pm Avishay Traeger

Fix integer overflow in block migration bandwidth calculation

block_mig_state.reads is an int, and multiplying by BLOCK_SIZE yielded a
negative number, resulting in a negative bandwidth (running on a 32-bit
machine). Change order to avoid.

Signed-off-by: Avishay Traeger <>...

8f794c55 02/07/2011 01:51 pm Marcelo Tosatti

block-migration: actually disable dirty tracking on cleanup

Call to set_dirty_tracking() is misplaced.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Kevin Wolf <>

f48905d4 02/07/2011 01:51 pm Marcelo Tosatti

block-migration: add reference to target DriveInfo

So that ejection of attached device by guest does not free data
in use by block migration instance.

Signed-off-by: Marcelo Tosatti <>
CC: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

8591675f 02/07/2011 01:51 pm Marcelo Tosatti

block: enable in_use flag

Set block device in use during block migration, disallow drive_del and
bdrv_truncate for in use devices.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Kevin Wolf <>

77358b59 01/24/2011 05:41 pm Pierre Riteau

Fix block migration when the device size is not a multiple of 1 MB

b02bea3a85cc939f09aa674a3f1e4f36d418c007 added a check on the return
value of bdrv_write and aborts migration when it fails. However, if the
size of the block device to migrate is not a multiple of BLOCK_SIZE...

8b6b2afc 01/24/2011 12:08 pm Pierre Riteau

Avoid divide by zero when there is no block device to migrate

When block migration is requested and no read-write block device is
present, a divide by zero exception is triggered because
total_sector_sum equals zero.

Signed-off-by: Pierre Riteau <>...

62155e2b 11/24/2010 06:31 pm Marcelo Tosatti

block migration: do not submit multiple AIOs for same sector (v2)

An old version of this patch was applied to master, so this contains the
differences between v1 and v2.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Kevin Wolf <>

33656af7 11/21/2010 05:16 pm Marcelo Tosatti

block migration: do not submit multiple AIOs for same sector

Block migration can submit multiple AIO reads for the same sector/chunk, but
completion of such reads can happen out of order:

migration guest
- get_dirty(N)
- aio_read(N)
- clear_dirty(N)...

bd0858bb 08/03/2010 04:57 pm Yoshiaki Tamura

block migration: replace tabs by spaces.

Signed-off-by: Yoshiaki Tamura <>
Signed-off-by: Kevin Wolf <>

b02bea3a 07/26/2010 02:39 pm Yoshiaki Tamura

block migration: propagate return value when bdrv_write() returns < 0

Currently block_load() doesn't check return value of bdrv_write(), and
even the destination weren't prepared to execute block migration, it
proceeds and guest boots on the target. This patch fix this issue....

31f54f24 07/13/2010 06:48 pm Shahar Havivi

Block migration fail, ignore error from bdrv_getlength

When there is no block driver associate with BlockDriverState bdrv_getlength
returns -ENOMEDIUM that cause block migration to fail

Signed-off-by: Shahar Havivi <>
Signed-off-by: Kevin Wolf <>

5efb397f 07/06/2010 06:48 pm Anthony Liguori

Merge remote branch 'kwolf/for-anthony' into staging

0be71e32 07/06/2010 06:36 pm Alex Williamson

savevm: Add DeviceState param

When available, we'd like to be able to access the DeviceState
when registering a savevm. For buses with a get_dev_path()
function, this will allow us to create more unique savevm
id strings.

Signed-off-by: Alex Williamson <>...

d246673d 07/06/2010 06:05 pm Markus Armbruster

block migration: Fix test for read-only drive

init_blk_migration_it() skips drives with type hint BDRV_TYPE_CDROM.
The intention is to skip read-only drives. However, BDRV_TYPE_CDROM
is only a hint. It is currently sufficent for read-only. But it's
not necessary, and it may not remain sufficient....

b66460e4 04/23/2010 05:21 pm Stefan Hajnoczi

block: Do not export bdrv_first

The bdrv_first linked list of BlockDriverStates is currently extern so
that block migration can iterate the list. However, since there is
already a bdrv_iterate() function there is no need to expose bdrv_first.

Signed-off-by: Stefan Hajnoczi <>...

d76cac7d 02/10/2010 12:56 am Liran Schour

Tranfer dirty blocks during iterative phase

Start transfer dirty blocks during the iterative stage. That will
reduce the time that the guest will be suspended

Signed-off-by: Liran Schour <>
Signed-off-by: Anthony Liguori <>

889ae39c 02/10/2010 12:56 am Liran Schour

Try not to exceed max downtime on stage3

Move to stage3 only when remaining work can be done below max downtime.
Use qemu_get_clock_ns for measuring read performance.

Signed-off-by: Liran Schour <>
Signed-off-by: Anthony Liguori <>

e970ec0b 02/10/2010 12:56 am Liran Schour

Remove unused code

blk_mig_save_bulked_block is never called with sync flag. Remove the sync
flag. Calculate bulk completion during blk_mig_save_bulked_block.
Remove unused constants.

Signed-off-by: Liran Schour <>
Signed-off-by: Anthony Liguori <>

d0f2c4c6 02/07/2010 01:03 am malc

Do not use dprintf

dprintf is already claimed by POSIX1, and on at least one system
is implemented as a macro

[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html

Signed-off-by: malc <>

792773b2 12/03/2009 07:45 pm Jan Kiszka

block migration: Skip zero-sized disks

No need to migrate emptiness (risking divide by zero later on).

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

01e61e2d 12/03/2009 06:48 pm Jan Kiszka

block migration: Add support for restore progress reporting

Inject progress report in percentage into the block live stream. This
can be read out and displayed easily on restore.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

b1d10856 12/03/2009 06:48 pm Jan Kiszka

block migration: Clean up use of total_sectors

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 <>
Signed-off-by: Anthony Liguori <>

57cce12d 12/03/2009 06:48 pm Jan Kiszka

block migration: Consolidate mig_read_device_bulk into mig_save_device_bulk

Both functions share a lot of code, so make them one.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

13f0b67f 12/03/2009 06:48 pm Jan Kiszka

block migration: Consolidate block transmission

Based on the original patch by Pierre Riteau: Use a common blk_send
function to transmit a block.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

4b640365 12/03/2009 06:48 pm Jan Kiszka

block migration: Add error handling/propagation

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

4ec7fcc7 12/03/2009 06:48 pm Jan Kiszka

live migration: Allow cleanup after cancellation or error

Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel a
live migration. This gives the involved subsystems a chance to clean up
dynamically allocated resources. Namely, the block migration layer can...

82801d8f 12/03/2009 06:48 pm Jan Kiszka

block migration: Report overall migration progress

So far progress reporting only works for the first block device. Fix
this by keeping an overall sum of sectors to be migratated, calculating
the sum of all processed sectors, and finally basing the progress...

f327aa0c 12/03/2009 06:48 pm Jan Kiszka

live migration: Propagate output monitor to callback handler

In order to allow proper progress reporting to the monitor that
initiated the migration, forward the monitor reference through the
migration layer down to SaveLiveStateHandler.

Signed-off-by: Jan Kiszka <>...

7184049e 12/03/2009 06:48 pm Jan Kiszka

block migration: Fix outgoing progress output

Report progress of an outgoing live migration to the monitor instead of
stdout.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

25f23643 12/03/2009 06:48 pm Jan Kiszka

block migration: Report progress also via info migration

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

a55eb92c 12/03/2009 06:48 pm Jan Kiszka

block migration: Fix coding style and whitespaces

No functional changes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

6ea44308 12/03/2009 06:48 pm Jan Kiszka

block migration: Rework constants API

Instead of duplicating the definition of constants or introducing
trivial retrieval functions move the SECTOR constants into the public
block API. This also obsoletes sector_per_block in BlkMigState.

Signed-off-by: Jan Kiszka <>...

575a58d7 12/03/2009 06:48 pm Jan Kiszka

block migration: Avoid large stack buffer

Move a potentially large buffer from stack to heap.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

d11ecd3d 12/03/2009 06:48 pm Jan Kiszka

block migration: Avoid indirection of block_mig_state

No need to push block_mig_state to the heap and, thus, establish an
indirection.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

3c095c3f 12/03/2009 06:48 pm Jan Kiszka

block migration: Drop dead code

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

5e5328be 12/03/2009 06:48 pm Jan Kiszka

block migration: Switch device and block lists to QSIMPLEQ

Based on the original patch by Pierre Riteau.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

69d63a97 12/03/2009 06:48 pm Jan Kiszka

block migration: Initialize remaining BlkMigState fields

In case we restart a migration, submitted, read_done, transferred, and
print_completion need to be reinitialized to 0.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

50035d3d 11/17/2009 11:00 pm Blue Swirl

Fix mingw32 build

Signed-off-by: Blue Swirl <>

c163b5ca 11/17/2009 04:49 pm lirans@il.ibm.com

Block live migration

This patch introduces block migration called during live migration. Block
are being copied to the destination in an async way. First the code will
transfer the whole disk and then transfer all dirty blocks accumulted during
the migration....