From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B3C2CC6B10 for ; Tue, 13 Oct 2026 07:53:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xGXK1-00021i-PW; Tue, 13 Oct 2026 03:53:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xGXK1-00021X-AX for qemu-trivial@nongnu.org; Tue, 13 Oct 2026 03:53:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xGXJz-0002YA-Nf for qemu-trivial@nongnu.org; Tue, 13 Oct 2026 03:53:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791877995; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XLB3L+I+q9Qod+AMzEBwjRytE8KoH0VDpmVYMWPuBdE=; b=aH9OWUHKsxUwL3nkG0wkN0rdR752xlNARyanycGpKiTYVWC9rAS7AKJyBGxpAtKNvkGIXX gGGRvpwiQNSIPgMkf2WUsQbIyNOqGq93X2Ba+HTGeBsH4vtAyrP13EhrzV5Ej8vu34idzL l4rrvT+Fp/qV1D+eqSjUe6q+ALEPqi0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-259-EjmdCesiOXKiDzuovxM_0g-1; Tue, 13 Oct 2026 07:53:04 +0000 X-MC-Unique: EjmdCesiOXKiDzuovxM_0g-1 X-Mimecast-MFC-AGG-ID: EjmdCesiOXKiDzuovxM_0g_1791877983 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7AF9C195422F; Tue, 13 Oct 2026 07:53:02 +0000 (UTC) Received: from redhat.com (headnet03.pony-001.prod.iad2.dc.redhat.com [10.2.32.114]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7ADF9180034F; Tue, 13 Oct 2026 07:52:59 +0000 (UTC) Date: Tue, 13 Oct 2026 08:52:56 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Filip Hejsek Cc: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , qemu-devel@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Michael Tokarev , Laurent Vivier , qemu-trivial@nongnu.org Subject: Re: [PATCH TRIVIAL] treewide: use qemu_dup() instead of dup() Message-ID: References: <20261012-use-qemu-dup-v1-1-03d94852a6c8@gmail.com> <90fe897aa35405fbada7a440c3fab848d81ea2b0.camel@gmail.com> MIME-Version: 1.0 In-Reply-To: <90fe897aa35405fbada7a440c3fab848d81ea2b0.camel@gmail.com> User-Agent: Mutt/2.4.2 (2026-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: RQVMKuCt0c1YWqWC8tXIR4DbcZ8y29qy4SJwpUpor7A_1791877983 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-trivial-bounces+qemu-trivial=archiver.kernel.org@nongnu.org Sender: qemu-trivial-bounces+qemu-trivial=archiver.kernel.org@nongnu.org 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 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 > > > > 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 :|