Statistics
| Branch: | Revision:

root / block / mirror.c @ cc84d90f

History | View | Annotate | Download (18.8 kB)

# Date Author Comment
34b5d2c6 09/12/2013 11:12 am Max Reitz

block: Error parameter for open functions

Add an Error ** parameter to bdrv_open, bdrv_file_open and associated
functions to allow more specific error messages.

Signed-off-by: Max Reitz <>

4f578637 09/06/2013 04:25 pm Paolo Bonzini

block: remove bdrv_is_allocated_above/bdrv_co_is_allocated_above distinction

Now that bdrv_is_allocated detects coroutine context, the two can
use the same code.

Reviewed-by: Eric Blake <>
Signed-off-by: Paolo Bonzini <>...

4f6fd349 09/06/2013 04:25 pm Fam Zheng

block: make bdrv_delete() static

Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no
longer public and should be called by bdrv_unref() if refcnt is
decreased to 0.

This is an identical change because effectively, there's no multiple
reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets...

7483d1e5 08/22/2013 08:14 pm Alex Bligh

aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API

Convert block_job_sleep_ns and co_sleep_ns to use the new timer
API.

Signed-off-by: Alex Bligh <>
Signed-off-by: Stefan Hajnoczi <>

bc72ad67 08/22/2013 08:14 pm Alex Bligh

aio / timers: Switch entire codebase to the new timer API

This is an autogenerated patch using scripts/switch-timer-api.

Switch the entire code base to using the new timer API.

Note this patch may introduce some line length issues.

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

f59fee8d 06/28/2013 10:20 am Kevin Wolf

block: Make BlockJobTypes const

Signed-off-by: Kevin Wolf <>

dacc26aa 06/17/2013 06:01 pm Luiz Capitulino

block: mirror_complete(): use error_setg_file_open()

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Stefan Hajnoczi <>
Acked-by: Kevin Wolf <>

31ca6d07 04/22/2013 11:27 am Kevin Wolf

block: Add driver-specific options for backing files

Options starting in "backing." are passed to the backing file now. If
you don't need to specify the filename for the backing file, you can add
it on the command line instead of in the image file:

$ qemu-nbd -t /tmp/test.img...

402a4741 01/25/2013 07:18 pm Paolo Bonzini

mirror: support more than one in-flight AIO operation

With AIO support in place, we can start copying more than one chunk
in parallel. This patch introduces the required infrastructure for
this: the buffer is split into multiple granularity-sized chunks,...

884fea4e 01/25/2013 07:18 pm Paolo Bonzini

mirror: support arbitrarily-sized iterations

Yet another optimization is to extend the mirroring iteration to include more
adjacent dirty blocks. This limits the number of I/O operations and makes
mirroring efficient even with a small granularity. Most of the infrastructure...

88ff0e48 01/25/2013 07:18 pm Paolo Bonzini

mirror: do nothing on zero-sized disk

On a zero-sized disk we need to break out of the job successfully
before bdrv_dirty_iter_init is called, otherwise you will get an
assertion failure with the next patch.

Signed-off-by: Paolo Bonzini <>...

50717e94 01/25/2013 07:18 pm Paolo Bonzini

block: allow customizing the granularity of the dirty bitmap

Reviewed-by: Eric Blake <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

eee13dfe 01/25/2013 07:18 pm Paolo Bonzini

mirror: allow customizing the granularity

The desired granularity may be very different depending on the kind of
operation (e.g. continuous replication vs. collapse-to-raw) and whether
the VM is expected to perform lots of I/O while mirroring is in progress....

bd48bde8 01/25/2013 07:18 pm Paolo Bonzini

mirror: switch mirror_iteration to AIO

There is really no change in the behavior of the job here, since
there is still a maximum of one in-flight I/O operation between
the source and the target. However, this patch already introduces
the AIO callbacks (which are unmodified in the next patch)...

08e4ed6c 01/25/2013 07:18 pm Paolo Bonzini

mirror: add buf-size argument to drive-mirror

This makes sense when the next commit starts using the extra buffer space
to perform many I/O operations asynchronously.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

8f0720ec 01/25/2013 07:18 pm Paolo Bonzini

block: implement dirty bitmap using HBitmap

This actually uses the dirty bitmap in the block layer, and converts
mirroring to use an HBitmapIter.

Reviewed-by: Laszlo Ersek <> (except block/mirror.c parts)
Reviewed-by: Eric Blake <>...

b812f671 01/25/2013 07:18 pm Paolo Bonzini

mirror: perform COW if the cluster size is bigger than the granularity

When mirroring runs, the backing files for the target may not yet be
ready. However, this means that a copy-on-write operation on the target
would fill the missing sectors with zeros. Copy-on-write only happens...

acc906c6 01/25/2013 07:18 pm Paolo Bonzini

block: return count of dirty sectors, not chunks

Reviewed-by: Laszlo Ersek <>
Reviewed-by: Eric Blake <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

7191bf31 01/15/2013 06:28 pm Markus Armbruster

block: Fix how mirror_run() frees its buffer

It allocates with qemu_blockalign(), therefore it must free with
qemu_vfree(), not g_free().

Signed-off-by: Markus Armbruster <>
Signed-off-by: Stefan Hajnoczi <>

737e150e 12/19/2012 09:31 am Paolo Bonzini

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

c57b6656 12/11/2012 12:04 pm Kevin Wolf

aio: Get rid of qemu_aio_flush()

There are no remaining users, and new users should probably be
using bdrv_drain_all() in the first place.

Signed-off-by: Kevin Wolf <>

d63ffd87 10/24/2012 11:26 am Paolo Bonzini

mirror: implement completion

Switching to the target of the migration is done mostly asynchronously,
and reported to management via the BLOCK_JOB_COMPLETED event; the only
synchronous phase is opening the backing files. bdrv_open_backing_file
can always be done, even for migration of the full image (aka sync:...

b952b558 10/24/2012 11:26 am Paolo Bonzini

mirror: add support for on-source-error/on-target-error

Error management is important for mirroring; otherwise, an error on the
target (even something as "innocent" as ENOSPC) requires to start again
with a full copy. Similar to on_read_error/on_write_error, two separate...

893f7eba 10/24/2012 11:26 am Paolo Bonzini

mirror: introduce mirror job

This patch adds the implementation of a new job that mirrors a disk to
a new image while letting the guest continue using the old image.
The target is treated as a "black box" and data is copied from the
source to the target in the background. This can be used for several...