[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/13] block: Fix is_allocated_above with resized fi
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 02/13] block: Fix is_allocated_above with resized files |
Date: |
Fri, 1 Feb 2013 15:27:53 +0100 |
From: Vishvananda Ishaya <address@hidden>
In an image chain, if the base image is smaller than the current
image, we need to make sure to use the current images count of
unallocated blocks once we get to the end of the base image. Without
this change the code will return 0 blocks when it gets to the end
of the base image and mirror_run will fail its assertion.
Signed-off-by: Vishvananda Ishaya <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index ba67c0d..50dab8e 100644
--- a/block.c
+++ b/block.c
@@ -2800,7 +2800,9 @@ int coroutine_fn
bdrv_co_is_allocated_above(BlockDriverState *top,
*
* [sector_num+x, nr_sectors] allocated.
*/
- if (n > pnum_inter) {
+ if (n > pnum_inter &&
+ (intermediate == top ||
+ sector_num + pnum_inter < intermediate->total_sectors)) {
n = pnum_inter;
}
--
1.8.1
- [Qemu-devel] [PULL for-1.4 00/13] Block patches, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 01/13] qemu-iotests: Add regression test for b7ab0fea, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 02/13] block: Fix is_allocated_above with resized files,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 03/13] block: Adds mirroring tests for resized images, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 04/13] vmdk: Allow selecting SCSI adapter in image creation, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 05/13] sheepdog: pass vdi_id to sheep daemon for sd_close(), Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 07/13] cloop: Fix bdrv_open() error handling, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 06/13] bochs: Fix bdrv_open() error handling, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 09/13] dmg: Fix bdrv_open() error handling, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 08/13] vpc: Fix bdrv_open() error handling, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 10/13] dmg: Use g_free instead of free, Stefan Hajnoczi, 2013/02/01
- [Qemu-devel] [PATCH 11/13] parallels: Fix bdrv_open() error handling, Stefan Hajnoczi, 2013/02/01