Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
xen.8005
qemu-xen-upstream-allow-every-discard-range.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File qemu-xen-upstream-allow-every-discard-range.patch of Package xen.8005
References: bsc#964427 --- tools/qemu-xen-dir-remote/block.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) Index: xen-4.4.3-testing/tools/qemu-xen-dir-remote/block.c =================================================================== --- xen-4.4.3-testing.orig/tools/qemu-xen-dir-remote/block.c +++ xen-4.4.3-testing/tools/qemu-xen-dir-remote/block.c @@ -2147,6 +2147,8 @@ static int bdrv_check_byte_request(Block return 0; len = bdrv_getlength(bs); + if (len < 0) + return -EIO; if (offset < 0) return -EIO; @@ -4165,7 +4167,7 @@ static void coroutine_fn bdrv_discard_co rwco->ret = bdrv_co_discard(rwco->bs, rwco->sector_num, rwco->nb_sectors); } -int coroutine_fn bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, +static int __bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors) { if (!bs->drv) { @@ -4206,6 +4208,26 @@ int coroutine_fn bdrv_co_discard(BlockDr } } +int coroutine_fn bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, + int nb_sectors) +{ + int num, ret; + int limit = (INT_MAX / BDRV_SECTOR_SIZE) - 1; + int remaining = nb_sectors; + int64_t sector_offset = sector_num; + + do { + num = remaining > limit ? limit : remaining; + ret = __bdrv_co_discard(bs, sector_offset, num); + if (ret < 0) + break; + remaining -= num; + sector_offset += num; + } while (remaining > 0); + + return ret; +} + int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors) { Coroutine *co;
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