]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/pve/0048-vma-don-t-use-O_DIRECT-on-pipes.patch
bump version to 2.9.0-1~rc2+5
[pve-qemu-kvm.git] / debian / patches / pve / 0048-vma-don-t-use-O_DIRECT-on-pipes.patch
CommitLineData
adeb0c7a
WB
1From 40846f73aea36b4ef66cce152321208f7d820222 Mon Sep 17 00:00:00 2001
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Thu, 30 Mar 2017 16:05:34 +0200
4Subject: [PATCH 48/48] vma: don't use O_DIRECT on pipes
5
6It puts them in packet mode which potentially discards data.
7---
8 vma-writer.c | 10 ++++------
9 1 file changed, 4 insertions(+), 6 deletions(-)
10
11diff --git a/vma-writer.c b/vma-writer.c
12index 70dcca0..9001cbd 100644
13--- a/vma-writer.c
14+++ b/vma-writer.c
15@@ -283,9 +283,8 @@ VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp)
16 }
17 vmaw->fd = fileno(vmaw->cmd);
18
19- /* try to use O_NONBLOCK and O_DIRECT */
20+ /* try to use O_NONBLOCK */
21 fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_NONBLOCK);
22- fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_DIRECT);
23
24 } else {
25 struct stat st;
26@@ -293,19 +292,18 @@ VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp)
27 const char *tmp_id_str;
28
29 if ((stat(filename, &st) == 0) && S_ISFIFO(st.st_mode)) {
30- oflags = O_NONBLOCK|O_DIRECT|O_WRONLY;
31+ oflags = O_NONBLOCK|O_WRONLY;
32 vmaw->fd = qemu_open(filename, oflags, 0644);
33 } else if (strstart(filename, "/dev/fdset/", &tmp_id_str)) {
34- oflags = O_NONBLOCK|O_DIRECT|O_WRONLY;
35+ oflags = O_NONBLOCK|O_WRONLY;
36 vmaw->fd = qemu_open(filename, oflags, 0644);
37 } else if (strstart(filename, "/dev/fdname/", &tmp_id_str)) {
38 vmaw->fd = monitor_get_fd(cur_mon, tmp_id_str, errp);
39 if (vmaw->fd < 0) {
40 goto err;
41 }
42- /* try to use O_NONBLOCK and O_DIRECT */
43+ /* try to use O_NONBLOCK */
44 fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_NONBLOCK);
45- fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_DIRECT);
46 } else {
47 oflags = O_NONBLOCK|O_DIRECT|O_WRONLY|O_CREAT|O_EXCL;
48 vmaw->fd = qemu_open(filename, oflags, 0644);
49--
502.1.4
51