Skip to contentSkip to conversation

Block patches

GIT PULL Applied Stefan Hajnoczi 2 participants 3 messages Mar 28, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

The following changes since commit eb06c9e2d3c8f026a206e8402b0ffa201060ec8e:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-03-27 17:34:50 +0100)

are available in the git repository at:

git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to dc62da88b5d17477227a3563a6ad466129d416d6:

parallels: wrong call to bdrv_truncate (2017-03-28 11:06:00 +0100)

----------------------------------------------------------------

----------------------------------------------------------------

Denis V. Lunev (1):
parallels: wrong call to bdrv_truncate

 block/parallels.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.3
#1 lore raw

[Qemu-devel] [PULL for-2.9 1/1] parallels: wrong call to bdrv_truncate

From: "Denis V. Lunev" <[email protected]>

Parallels driver should not call bdrv_truncate if the image was opened in the read-only mode. Without the patch
qemu-img check harddisk.hds
asserts with

    bdrv_truncate: Assertion `child->perm & BLK_PERM_RESIZE' failed.

Parameters used on the write path are not needed if the image is opened in the read-only mode.

Message-id: [email protected]

---
 block/parallels.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/parallels.c +2 -1
index 6bf9375..4173b3f 100644
@@ -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;
     }
Signature · 1 line
2.9.3
#2 lore raw
In reply to Stefan Hajnoczi
Quoted 14 lines · Stefan Hajnoczi

The following changes since commit eb06c9e2d3c8f026a206e8402b0ffa201060ec8e:

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-03-27 17:34:50 +0100)

are available in the git repository at:

git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to dc62da88b5d17477227a3563a6ad466129d416d6:

parallels: wrong call to bdrv_truncate (2017-03-28 11:06:00 +0100)

----------------------------------------------------------------

Quoted 7 lines

----------------------------------------------------------------

Denis V. Lunev (1):
parallels: wrong call to bdrv_truncate

 block/parallels.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

-- PMM