Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
xen.5575
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.5575
--- tools/qemu-xen-dir-remote/block.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) Index: xen-4.5.2-testing/tools/qemu-xen-dir-remote/block.c =================================================================== --- xen-4.5.2-testing.orig/tools/qemu-xen-dir-remote/block.c +++ xen-4.5.2-testing/tools/qemu-xen-dir-remote/block.c @@ -2592,6 +2592,8 @@ static int bdrv_check_byte_request(Block return 0; len = bdrv_getlength(bs); + if (len < 0) + return -EIO; if (offset < 0) return -EIO; @@ -4891,7 +4893,7 @@ static void coroutine_fn bdrv_discard_co */ #define MAX_DISCARD_DEFAULT 32768 -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) { int max_discard; @@ -4962,6 +4964,26 @@ int coroutine_fn bdrv_co_discard(BlockDr return 0; } +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