aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-cluster.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@amazon.com>2013-10-11 09:29:58 -0700
committerAnthony Liguori <aliguori@amazon.com>2013-10-11 09:29:58 -0700
commit33c6cae44eccea5e627c2dc5cbf31456db90fc38 (patch)
tree26f994c9f78144b2a6f12da686a2235d0df1dd21 /block/qcow2-cluster.c
parent39c153b80f890dc5f02465dc59992e195abd5f40 (diff)
parent34eeb82de65ce9f83081a3357b0afe80a6a1d86a (diff)
Merge remote-tracking branch 'kwolf/for-anthony' into staging
# By Max Reitz (30) and others # Via Kevin Wolf * kwolf/for-anthony: (61 commits) qemu-iotests: Add test for inactive L2 overlap qemu-io: Let "open" pass options to block driver vmdk: Fix vmdk_parse_extents blockdev: blockdev_init() error conversion blockdev: Don't disable COR automatically with blockdev-add blockdev: Remove 'media' parameter from blockdev_init() qemu-iotests: Check autodel behaviour for device_del blockdev: Remove IF_* check for read-only blockdev_init blockdev: Move virtio-blk device creation to drive_init blockdev: Move bus/unit/index processing to drive_init blockdev: Move parsing of 'boot' option to drive_init blockdev: Moving parsing of geometry options to drive_init blockdev: Move parsing of 'if' option to drive_init blockdev: Move parsing of 'media' option to drive_init blockdev: Pass QDict to blockdev_init() blockdev: Separate ID generation from DriveInfo creation blockdev: 'blockdev-add' QMP command blockdev: Introduce DriveInfo.enable_auto_del qapi-types/visit.py: Inheritance for structs qapi-types/visit.py: Pass whole expr dict for structs ... Message-id: 1381503951-27985-1-git-send-email-kwolf@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'block/qcow2-cluster.c')
-rw-r--r--block/qcow2-cluster.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 0fd26bb4cc..0348b971b1 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -83,8 +83,8 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
/* the L1 position has not yet been updated, so these clusters must
* indeed be completely free */
- ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT,
- new_l1_table_offset, new_l1_size2);
+ ret = qcow2_pre_write_overlap_check(bs, 0, new_l1_table_offset,
+ new_l1_size2);
if (ret < 0) {
goto fail;
}
@@ -160,8 +160,7 @@ int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index)
buf[i] = cpu_to_be64(s->l1_table[l1_start_index + i]);
}
- ret = qcow2_pre_write_overlap_check(bs,
- QCOW2_OL_DEFAULT & ~QCOW2_OL_ACTIVE_L1,
+ ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_ACTIVE_L1,
s->l1_table_offset + 8 * l1_start_index, sizeof(buf));
if (ret < 0) {
return ret;
@@ -396,7 +395,7 @@ static int coroutine_fn copy_sectors(BlockDriverState *bs,
&s->aes_encrypt_key);
}
- ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT,
+ ret = qcow2_pre_write_overlap_check(bs, 0,
cluster_offset + n_start * BDRV_SECTOR_SIZE, n * BDRV_SECTOR_SIZE);
if (ret < 0) {
goto out;
@@ -1604,8 +1603,7 @@ static int expand_zero_clusters_in_l1(BlockDriverState *bs, uint64_t *l1_table,
}
}
- ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT,
- offset, s->cluster_size);
+ ret = qcow2_pre_write_overlap_check(bs, 0, offset, s->cluster_size);
if (ret < 0) {
if (!preallocated) {
qcow2_free_clusters(bs, offset, s->cluster_size,
@@ -1661,8 +1659,8 @@ static int expand_zero_clusters_in_l1(BlockDriverState *bs, uint64_t *l1_table,
}
} else {
if (l2_dirty) {
- ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT &
- ~(QCOW2_OL_INACTIVE_L2 | QCOW2_OL_ACTIVE_L2), l2_offset,
+ ret = qcow2_pre_write_overlap_check(bs,
+ QCOW2_OL_INACTIVE_L2 | QCOW2_OL_ACTIVE_L2, l2_offset,
s->cluster_size);
if (ret < 0) {
goto fail;