diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-03-28 11:10:36 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-03-28 11:10:36 +0100 |
commit | 142b9ca51d7260d20f6e87bd7f2020ac0a7d95d9 (patch) | |
tree | d3d32d9abbc93a6c4a4c65dc84569a567efddeaa | |
parent | 8c9ee217f0ee2a99d8aafa8a1db7f76176c18c99 (diff) | |
parent | dc62da88b5d17477227a3563a6ad466129d416d6 (diff) |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Tue 28 Mar 2017 11:07:02 BST
# gpg: using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request:
parallels: wrong call to bdrv_truncate
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | block/parallels.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/parallels.c b/block/parallels.c index 6bf93753e8..4173b3fb9d 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -687,7 +687,8 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, if (local_err != NULL) { goto fail_options; } - if (!bdrv_has_zero_init(bs->file->bs) || + + if (!(flags & BDRV_O_RESIZE) || !bdrv_has_zero_init(bs->file->bs) || bdrv_truncate(bs->file, bdrv_getlength(bs->file->bs)) != 0) { s->prealloc_mode = PRL_PREALLOC_MODE_FALLOCATE; } |