qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@samsung.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Ilya Maximets" <i.maximets@samsung.com>
Subject: [Qemu-devel] [PATCH v3 2/4] memfd: always check for MFD_CLOEXEC
Date: Mon, 11 Mar 2019 16:58:48 +0300	[thread overview]
Message-ID: <20190311135850.6537-3-i.maximets@samsung.com> (raw)
In-Reply-To: <20190311135850.6537-1-i.maximets@samsung.com>

QEMU always sets this flag unconditionally. We need to
check if it's supported.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 util/memfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/memfd.c b/util/memfd.c
index 8debd0d037..d74ce4d793 100644
--- a/util/memfd.c
+++ b/util/memfd.c
@@ -188,7 +188,7 @@ bool qemu_memfd_alloc_check(void)
 bool qemu_memfd_check(unsigned int flags)
 {
 #ifdef CONFIG_LINUX
-    int mfd = memfd_create("test", flags);
+    int mfd = memfd_create("test", flags | MFD_CLOEXEC);
 
     if (mfd >= 0) {
         close(mfd);
-- 
2.17.1

  parent reply	other threads:[~2019-03-11 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190311135911eucas1p2612665dccba27cc8b5d81b67a70480c6@eucas1p2.samsung.com>
2019-03-11 13:58 ` [Qemu-devel] [PATCH v3 0/4] memfd fixes Ilya Maximets
     [not found]   ` <CGME20190311135916eucas1p27b50ca29c84af5f7529d56fd43a2964d@eucas1p2.samsung.com>
2019-03-11 13:58     ` [Qemu-devel] [PATCH v3 1/4] hostmem-memfd: disable for systems wihtout sealing support Ilya Maximets
     [not found]   ` <CGME20190311135919eucas1p11c7fad66884a0303b2637cd2d2b05cad@eucas1p1.samsung.com>
2019-03-11 13:58     ` Ilya Maximets [this message]
     [not found]   ` <CGME20190311135922eucas1p2e131e72beea41ae584761ea5a62a948c@eucas1p2.samsung.com>
2019-03-11 13:58     ` [Qemu-devel] [PATCH v3 3/4] memfd: set up correct errno if not supported Ilya Maximets
     [not found]   ` <CGME20190311135925eucas1p21442eda0f28a7e6ae1f9a238ca0a4f0d@eucas1p2.samsung.com>
2019-03-11 13:58     ` [Qemu-devel] [PATCH v3 4/4] memfd: improve error messages Ilya Maximets

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311135850.6537-3-i.maximets@samsung.com \
    --to=i.maximets@samsung.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).