From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Filip Hejsek <filip.hejsek@gmail.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"Laurent Vivier" <laurent@vivier.eu>,
qemu-trivial@nongnu.org
Subject: Re: [PATCH TRIVIAL] treewide: use qemu_dup() instead of dup()
Date: Tue, 13 Oct 2026 08:52:56 +0100 [thread overview]
Message-ID: <as3jWHX-ukeyaR6j@redhat.com> (raw)
In-Reply-To: <90fe897aa35405fbada7a440c3fab848d81ea2b0.camel@gmail.com>
On Mon, Oct 12, 2026 at 10:12:34PM +0200, Filip Hejsek wrote:
> Hello,
>
> On Mon, 2026-10-12 at 23:54 +0400, Marc-André Lureau wrote:
> > Hi
> >
> > On Mon, Oct 12, 2026 at 11:44 PM Filip Hejsek <filip.hejsek@gmail.com> wrote:
> > >
> > > Make the use of qemu_dup() more consistent and eliminate the possibility
> > > of accidentally creating non-cloexec fds.
> > >
> >
> > Not so trivial, in my humble opinion, as there might have been some
> > reason it was avoided.
> >
>
> You're right, I shouldn't have tagged this as TRIVIAL.
>
> I've actually intentionally left some dup()s unchanged for exactly this
> reason. They are the ones in qemu-nbd.c, migration/cpr-exec.c, and
> under linux-user/ and bsd-user/. I also didn't touch the tests, as I
> didn't consider evaluating them to be worth the effort.
IMHO, everything must be switched to use qemu_dup. If a few callers
actually want the FD to remain open across execve, then they should
explicitly call qemu_clear_cloexec(). THis makes the intended
behaviour clear, as opposed to looking like a potential mistake.
>
> I should have put this info in the commit message...
>
> > > [...]
> >
> > After review I think these changes are valid. These changes shouldn't
> > impact the exec() code paths in qemu.
> >
> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
>
> Thanks for reviewing this.
>
> Filip
>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
prev parent reply other threads:[~2026-10-13 7:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 19:44 [PATCH TRIVIAL] treewide: use qemu_dup() instead of dup() Filip Hejsek
2026-10-12 19:54 ` Marc-André Lureau
2026-10-12 20:12 ` Filip Hejsek
2026-10-12 21:00 ` Filip Hejsek
2026-10-13 7:52 ` Daniel P. Berrangé [this message]
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=as3jWHX-ukeyaR6j@redhat.com \
--to=berrange@redhat.com \
--cc=filip.hejsek@gmail.com \
--cc=laurent@vivier.eu \
--cc=marcandre.lureau@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.