-----BEGIN PGP SIGNATURE-----

Version: GnuPG v1
 
 iQIcBAABAgAGBQJWDYNJAAoJEL2+eyfA3jBXYlkP/j9U3cmhwpf0+nF+ogDzc+GW
 1wxFu/BaxY2Yvl140AtEbG0OkpQT9PX46jonWHk4VYOfUsEuMRus7UwgABQIapTh
 1Dn3TIBg9KvwL5Tc7kq4h6b5uwF5YrvIJg9U03CGD06IC6igwYppULDlmUutsGBL
 znhVL2LqIyfrRS/+xfEZQAzmtj/EQEbCTUgZGO4IYFZERXwrH+iGq0jdTdIiHXqE
 JCbaze3AXpNCEGGPqdEvIA8rbjF9BnWVew03w+qy69QCYV29tkLM4V2LgoEcFYQh
 uBqIL+j/cKI8D6LsmAhPapkrOJjcWyPR6RYA3E+eTl4GfDF9rcbyX0T0tqTHVH0y
 TgetOS2qeyNebRH9pBv+n3frZ9dodk2q0XDaDjm9mlmfnpMt2cfpfE6ZYiN9DKwn
 iN8n/aoifivrW7DPEas2KQ19k5412nYkdktyAr8TUcmEfSNCAPpFkUzXr0cy7Hrc
 39dVQzSEIfika3Mr8/ZJl6+yKYKtTh0dgTS3FStDIZpErBFsBmzmTJebbkaVzGfI
 KCrhKg3ds9UqnDV8uo+AMCL0vFXi6xNrUN/ELdI2kOPqKBtef1R0TzH2OLQJgsN/
 FxExRStpNL+BZTXnTsbD/cxPd5ozxp1RU6xJfkeXKBorTXsskYdIXNIIhyzfTlkg
 9NEQPST9K/0+EZXJPWfg
 =EIu7
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into 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>
This commit is contained in:
Peter Maydell 2015-10-02 11:01:18 +01:00
commit ff770b07f3
1 changed files with 3 additions and 1 deletions

View File

@ -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,
@ -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;