[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 13/32] raw-posix: Use qemu_dup
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 13/32] raw-posix: Use qemu_dup |
Date: |
Fri, 8 Jul 2016 19:21:25 +0200 |
From: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/raw-posix.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index c979ac3..d1c3bd8 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -639,15 +639,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
if ((raw_s->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) {
/* dup the original fd */
- /* TODO: use qemu fcntl wrapper */
-#ifdef F_DUPFD_CLOEXEC
- raw_s->fd = fcntl(s->fd, F_DUPFD_CLOEXEC, 0);
-#else
- raw_s->fd = dup(s->fd);
- if (raw_s->fd != -1) {
- qemu_set_cloexec(raw_s->fd);
- }
-#endif
+ raw_s->fd = qemu_dup(s->fd);
if (raw_s->fd >= 0) {
ret = fcntl_setfl(raw_s->fd, raw_s->open_flags);
if (ret) {
--
1.8.3.1
- [Qemu-block] [PULL 00/32] Block layer patches, Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 01/32] stream: Fix prototype of stream_start(), Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 02/32] blockjob: Update description of the 'id' field, Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 03/32] blockjob: Add block_job_get(), Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 04/32] block: Use block_job_get() in find_block_job(), Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 07/32] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup', Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 12/32] osdep: Introduce qemu_dup, Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 13/32] raw-posix: Use qemu_dup,
Kevin Wolf <=
- [Qemu-block] [PULL 08/32] stream: Add 'job-id' parameter to 'block-stream', Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 05/32] blockjob: Add 'job_id' parameter to block_job_create(), Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 06/32] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror', Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 14/32] coroutine: use QSIMPLEQ instead of QTAILQ, Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 09/32] commit: Add 'job-id' parameter to 'block-commit', Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 10/32] qemu-img: Set the ID of the block job in img_commit(), Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 11/32] blockjob: Update description of the 'device' field in the QMP API, Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 18/32] block/qdev: Allow configuring WCE with qdev properties, Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 17/32] block/qdev: Allow node name for drive properties, Kevin Wolf, 2016/07/08
- [Qemu-block] [PULL 15/32] test-coroutine: prepare for the next patch, Kevin Wolf, 2016/07/08