Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' i…
Browse files Browse the repository at this point in the history
…nto staging

# gpg: Signature made Thu 01 Oct 2015 20:02:33 BST using RSA key ID C0DE3057
# gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
# gpg:                 aka "Jeffrey Cody <jeff@codyprime.org>"
# gpg:                 aka "Jeffrey Cody <codyprime@gmail.com>"

* remotes/cody/tags/block-pull-request:
  block: mirror - fix full sync mode when target does not support zero init

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Oct 2, 2015
2 parents 5250ced + 5279efe commit ff770b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion block/mirror.c
Expand Up @@ -455,6 +455,8 @@ static void coroutine_fn mirror_run(void *opaque)
if (!s->is_none_mode) {
/* First part, loop on the sectors and initialize the dirty bitmap. */
BlockDriverState *base = s->base;
bool mark_all_dirty = s->base == NULL && !bdrv_has_zero_init(s->target);

for (sector_num = 0; sector_num < end; ) {
/* Just to make sure we are not exceeding int limit. */
int nb_sectors = MIN(INT_MAX >> BDRV_SECTOR_BITS,
Expand All @@ -477,7 +479,7 @@ static void coroutine_fn mirror_run(void *opaque)
}

assert(n > 0);
if (ret == 1) {
if (ret == 1 || mark_all_dirty) {
bdrv_set_dirty_bitmap(s->dirty_bitmap, sector_num, n);
}
sector_num += n;
Expand Down

0 comments on commit ff770b0

Please sign in to comment.