Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu.611
0060-vmdk-Implement-.bdrv_write_compress.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0060-vmdk-Implement-.bdrv_write_compress.patch of Package qemu.611
From 495a530d84393e152f319668adb015d6541c700e Mon Sep 17 00:00:00 2001 From: Fam Zheng <famz@redhat.com> Date: Tue, 6 May 2014 21:08:44 +0800 Subject: [PATCH] vmdk: Implement .bdrv_write_compressed Add a wrapper function to support "compressed" path in qemu-img convert. Only support streamOptimized subformat case for now (num_extents == 1 and extent compression is true). Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit ba0ad89e2c3316ce26ca6576a3c5051f91bfc0fe) [BR: FATE#317741] Signed-off-by: Bruce Rogers <brogers@suse.com> --- block/vmdk.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index db0d23f..6b1d8fd 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1495,6 +1495,19 @@ static coroutine_fn int vmdk_co_write(BlockDriverState *bs, int64_t sector_num, return ret; } +static int vmdk_write_compressed(BlockDriverState *bs, + int64_t sector_num, + const uint8_t *buf, + int nb_sectors) +{ + BDRVVmdkState *s = bs->opaque; + if (s->num_extents == 1 && s->extents[0].compressed) { + return vmdk_write(bs, sector_num, buf, nb_sectors, false, false); + } else { + return -ENOTSUP; + } +} + static int coroutine_fn vmdk_co_write_zeroes(BlockDriverState *bs, int64_t sector_num, int nb_sectors, @@ -2123,6 +2136,7 @@ static BlockDriver bdrv_vmdk = { .bdrv_reopen_prepare = vmdk_reopen_prepare, .bdrv_read = vmdk_co_read, .bdrv_write = vmdk_co_write, + .bdrv_write_compressed = vmdk_write_compressed, .bdrv_co_write_zeroes = vmdk_co_write_zeroes, .bdrv_close = vmdk_close, .bdrv_create = vmdk_create,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor