1 From 47d2445ffc83bba6066beb67fa34075d75b5b4c2 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Thu, 30 Mar 2017 16:05:34 +0200
4 Subject: [PATCH 48/49] vma: don't use O_DIRECT on pipes
6 It puts them in packet mode which potentially discards data.
9 vma-writer.c | 10 ++++------
10 1 file changed, 4 insertions(+), 6 deletions(-)
12 diff --git a/vma-writer.c b/vma-writer.c
13 index 70dcca0771..9001cbdd2b 100644
16 @@ -283,9 +283,8 @@ VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp)
18 vmaw->fd = fileno(vmaw->cmd);
20 - /* try to use O_NONBLOCK and O_DIRECT */
21 + /* try to use O_NONBLOCK */
22 fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_NONBLOCK);
23 - fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_DIRECT);
27 @@ -293,19 +292,18 @@ VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp)
28 const char *tmp_id_str;
30 if ((stat(filename, &st) == 0) && S_ISFIFO(st.st_mode)) {
31 - oflags = O_NONBLOCK|O_DIRECT|O_WRONLY;
32 + oflags = O_NONBLOCK|O_WRONLY;
33 vmaw->fd = qemu_open(filename, oflags, 0644);
34 } else if (strstart(filename, "/dev/fdset/", &tmp_id_str)) {
35 - oflags = O_NONBLOCK|O_DIRECT|O_WRONLY;
36 + oflags = O_NONBLOCK|O_WRONLY;
37 vmaw->fd = qemu_open(filename, oflags, 0644);
38 } else if (strstart(filename, "/dev/fdname/", &tmp_id_str)) {
39 vmaw->fd = monitor_get_fd(cur_mon, tmp_id_str, errp);
43 - /* try to use O_NONBLOCK and O_DIRECT */
44 + /* try to use O_NONBLOCK */
45 fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_NONBLOCK);
46 - fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_DIRECT);
48 oflags = O_NONBLOCK|O_DIRECT|O_WRONLY|O_CREAT|O_EXCL;
49 vmaw->fd = qemu_open(filename, oflags, 0644);