[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 32/32] osdep: Less restrictive F_SEFL in qemu_dup_fl
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 32/32] osdep: Less restrictive F_SEFL in qemu_dup_flags() |
Date: |
Wed, 24 Oct 2012 11:50:56 +0200 |
From: Corey Bryant <address@hidden>
qemu_dup_flags() currently limits the flags that can be set on the
fcntl() F_SETFL call to those that we currently know can be set with
fcntl() F_SETFL. The problem with this is that it will prevent use
of new flags in the future without a code update.
This patch relaxes the checking and lets fcntl() determine the flags
it can set.
Signed-off-by: Corey Bryant <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
osdep.c | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/osdep.c b/osdep.c
index 3b25297..c822a01 100644
--- a/osdep.c
+++ b/osdep.c
@@ -88,7 +88,6 @@ static int qemu_dup_flags(int fd, int flags)
int ret;
int serrno;
int dup_flags;
- int setfl_flags;
#ifdef F_DUPFD_CLOEXEC
ret = fcntl(fd, F_DUPFD_CLOEXEC, 0);
@@ -113,16 +112,7 @@ static int qemu_dup_flags(int fd, int flags)
}
/* Set/unset flags that we can with fcntl */
- setfl_flags = O_APPEND | O_ASYNC | O_NONBLOCK;
-#ifdef O_NOATIME
- setfl_flags |= O_NOATIME;
-#endif
-#ifdef O_DIRECT
- setfl_flags |= O_DIRECT;
-#endif
- dup_flags &= ~setfl_flags;
- dup_flags |= (flags & setfl_flags);
- if (fcntl(ret, F_SETFL, dup_flags) == -1) {
+ if (fcntl(ret, F_SETFL, flags) == -1) {
goto fail;
}
--
1.7.6.5
- [Qemu-devel] [PATCH 22/32] block: add block-job-complete, (continued)
- [Qemu-devel] [PATCH 22/32] block: add block-job-complete, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 16/32] block: add bdrv_query_info, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 18/32] block: add bdrv_open_backing_file, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 20/32] block: export dirty bitmap information in query-block, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 25/32] qmp: add drive-mirror command, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 24/32] mirror: introduce mirror job, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 23/32] block: introduce BLOCK_JOB_READY event, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 31/32] qemu-iotests: add testcases for mirroring on-source-error/on-target-error, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 29/32] mirror: add support for on-source-error/on-target-error, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 30/32] qmp: add pull_event function, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 32/32] osdep: Less restrictive F_SEFL in qemu_dup_flags(),
Kevin Wolf <=
- [Qemu-devel] [PATCH 27/32] qemu-iotests: add mirroring test case, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 26/32] mirror: implement completion, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 28/32] iostatus: forward block_job_iostatus_reset to block job, Kevin Wolf, 2012/10/24
- Re: [Qemu-devel] [PULL 00/32] Block patches, Anthony Liguori, 2012/10/29