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
66 lines
2.0 KiB
Diff
66 lines
2.0 KiB
Diff
From 43fdf04d426f4738aec0d349662a780906268590 Mon Sep 17 00:00:00 2001
|
|
From: Bruce Rogers <brogers@suse.com>
|
|
Date: Wed, 9 Mar 2016 15:18:11 -0700
|
|
Subject: [PATCH] xen_disk: Add suse specific flush disable handling and map to
|
|
QEMU equiv
|
|
|
|
Add code to read the suse specific suse-diskcache-disable-flush flag out
|
|
of xenstore, and set the equivalent flag within QEMU.
|
|
|
|
Patch taken from Xen's patch queue, Olaf Hering being the original author.
|
|
[bsc#879425]
|
|
|
|
Signed-off-by: Bruce Rogers <brogers@suse.com>
|
|
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
|
---
|
|
hw/block/xen_disk.c | 15 +++++++++++++++
|
|
1 file changed, 15 insertions(+)
|
|
|
|
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
|
|
index d4ce380..9100862 100644
|
|
--- a/hw/block/xen_disk.c
|
|
+++ b/hw/block/xen_disk.c
|
|
@@ -112,6 +112,7 @@ struct XenBlkDev {
|
|
int requests_inflight;
|
|
int requests_finished;
|
|
|
|
+ gboolean cache_unsafe;
|
|
/* Persistent grants extension */
|
|
gboolean feature_discard;
|
|
gboolean feature_persistent;
|
|
@@ -793,6 +794,16 @@ static void blk_parse_discard(struct XenBlkDev *blkdev)
|
|
}
|
|
}
|
|
|
|
+static void blk_parse_cache_unsafe(struct XenBlkDev *blkdev)
|
|
+{
|
|
+ int enable;
|
|
+
|
|
+ blkdev->cache_unsafe = false;
|
|
+
|
|
+ if (xenstore_read_be_int(&blkdev->xendev, "suse-diskcache-disable-flush", &enable) == 0)
|
|
+ blkdev->cache_unsafe = !!enable;
|
|
+}
|
|
+
|
|
static int blk_init(struct XenDevice *xendev)
|
|
{
|
|
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
|
|
@@ -864,6 +875,7 @@ static int blk_init(struct XenDevice *xendev)
|
|
xenstore_write_be_int(&blkdev->xendev, "info", info);
|
|
|
|
blk_parse_discard(blkdev);
|
|
+ blk_parse_cache_unsafe(blkdev);
|
|
|
|
g_free(directiosafe);
|
|
return 0;
|
|
@@ -906,6 +918,9 @@ static int blk_connect(struct XenDevice *xendev)
|
|
qflags |= BDRV_O_UNMAP;
|
|
}
|
|
|
|
+ if (blkdev->cache_unsafe)
|
|
+ qflags |= BDRV_O_NO_FLUSH;
|
|
+
|
|
/* init qemu block driver */
|
|
index = (blkdev->xendev.dev - 202 * 256) / 16;
|
|
blkdev->dinfo = drive_get(IF_XEN, 0, index);
|