8c721a87ae
- Remove deprecated patch "work-around-SA_RESTART-race" (boo#982208) - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.6 * Patches dropped: 0002-XXX-work-around-SA_RESTART-race-wit.patch 0003-qemu-0.9.0.cvs-binfmt.patch 0004-qemu-cvs-alsa_bitfield.patch 0005-qemu-cvs-alsa_ioctl.patch 0006-qemu-cvs-alsa_mmap.patch 0007-qemu-cvs-gettimeofday.patch 0008-qemu-cvs-ioctl_debug.patch 0009-qemu-cvs-ioctl_nodirection.patch 0010-block-vmdk-Support-creation-of-SCSI.patch 0011-linux-user-add-binfmt-wrapper-for-a.patch 0012-PPC-KVM-Disable-mmu-notifier-check.patch 0013-linux-user-fix-segfault-deadlock.patch 0014-linux-user-binfmt-support-host-bina.patch 0015-linux-user-Ignore-broken-loop-ioctl.patch 0016-linux-user-lock-tcg.patch 0017-linux-user-Run-multi-threaded-code-.patch 0018-linux-user-lock-tb-flushing-too.patch 0019-linux-user-Fake-proc-cpuinfo.patch 0020-linux-user-implement-FS_IOC_GETFLAG.patch 0021-linux-user-implement-FS_IOC_SETFLAG.patch 0022-linux-user-XXX-disable-fiemap.patch 0023-slirp-nooutgoing.patch 0024-vnc-password-file-and-incoming-conn.patch 0025-linux-user-add-more-blk-ioctls.patch 0026-linux-user-use-target_ulong.patch 0027-block-Add-support-for-DictZip-enabl.patch 0028-block-Add-tar-container-format.patch OBS-URL: https://build.opensuse.org/request/show/408549 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=305
57 lines
1.7 KiB
Diff
57 lines
1.7 KiB
Diff
From adc543748b20def826281f9e6fda52f026dc099d Mon Sep 17 00:00:00 2001
|
|
From: Olaf Hering <olaf@aepfle.de>
|
|
Date: Thu, 24 Mar 2016 14:32:39 +0100
|
|
Subject: [PATCH] block: split large discard requests from block frontend
|
|
|
|
Large discard requests lead to sign expansion errors in qemu.
|
|
Since there is no API to tell a guest about the limitations qmeu
|
|
has to split a large request itself.
|
|
|
|
[bsc#964427]
|
|
|
|
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
|
---
|
|
block/io.c | 22 +++++++++++++++++++++-
|
|
1 file changed, 21 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/block/io.c b/block/io.c
|
|
index a7dbf85..560fa4c 100644
|
|
--- a/block/io.c
|
|
+++ b/block/io.c
|
|
@@ -2487,7 +2487,7 @@ static void coroutine_fn bdrv_discard_co_entry(void *opaque)
|
|
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)
|
|
{
|
|
BdrvTrackedRequest req;
|
|
@@ -2569,6 +2569,26 @@ out:
|
|
return ret;
|
|
}
|
|
|
|
+int coroutine_fn bdrv_co_discard(BlockDriverState *bs, int64_t sector_num,
|
|
+ int nb_sectors)
|
|
+{
|
|
+ int num, ret;
|
|
+ int limit = BDRV_REQUEST_MAX_SECTORS;
|
|
+ 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;
|