From nobody Mon Feb 9 09:15:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647964948; cv=none; d=zohomail.com; s=zohoarc; b=CvSSmGn1TWvbtACx62B7vO7aRAaaRQz7eW0YEGVz05+dHAjhzmCdZvLuHgq3eScFTCpEbtH2mbeYB2L+wYTw5YcxCFzlwAn9BXhT+vcOkg0TrKzozO0UatRwWdzmd+nnCRhAQGfzetYVclLPtbtbZtsoIlmPc6AS1rXOW9M7pHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647964948; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kOPek/c0Vu2h2Rd0GQ8qA6mL08CW+C1APeXHYB0sZ7Q=; b=h0tHkqlaUTPoEOrmZTgLsEttNMvL4qEkzYReW2qnLeFsxWfw0JTFYcaxxxVUXYmd+MA1cir4s3UsMqnYqtoAKUI+q8MUpy8zMrSLUr3RZ3OqCKCYaAIZv1ERaMLLmAiv7r7YnQuhyBCUhncy4Xmu5mOS92dvXDKmf/I9IDKOhNY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1647964948291923.4779093569119; Tue, 22 Mar 2022 09:02:28 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-644-s9GVC8S7NtW8kDiXXek88g-1; Tue, 22 Mar 2022 12:02:24 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C28B3805901; Tue, 22 Mar 2022 16:02:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BB5E40317E; Tue, 22 Mar 2022 16:02:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 07210193F6DF; Tue, 22 Mar 2022 16:02:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 339701940364 for ; Tue, 22 Mar 2022 16:02:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 25690C23DC6; Tue, 22 Mar 2022 16:02:13 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1E28C23DC3 for ; Tue, 22 Mar 2022 16:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647964946; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kOPek/c0Vu2h2Rd0GQ8qA6mL08CW+C1APeXHYB0sZ7Q=; b=I6viqLzDrZq3vrCLVzAVRh0FZgZeIbxG2OLv0AZGDg2V8pAf9lidKh58GvKNAKtgATk1bN thSezmDNWYRCAc69gTCwuwT0sLm5+DyR/CSI1tvKB9f4loOlDU6Bm3XW57QEOHZnt2M+ul ht1mOdT5ekx9w07QUGSYkz85JcAWvPQ= X-MC-Unique: s9GVC8S7NtW8kDiXXek88g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 3/7] vircommand: Don't set nonblocking FDs in virCommandDoAsyncIO() Date: Tue, 22 Mar 2022 17:02:02 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1647964949538100003 Content-Type: text/plain; charset="utf-8" Back in 2013 (v1.0.3-rc1~235) when I introduced virCommandDoAsyncIO() things were way different than today. We had one event loop for everything and asynchronous IO for virCommand was handled by the event loop. Therefore, it made sense to enable VIR_EXEC_NONBLOCK flag alongside with VIR_EXEC_ASYNC_IO. Well, sort of - a blocking FD can still be put into poll(). Anyway, this was reimplemented in v1.0.3-rc1~127 when a separate thread is created that handles IO. Therefore, there's no need to enable VIR_EXEC_NONBLOCK flag anymore. There's a separate API to request that flag: virCommandNonblockingFDs(). Signed-off-by: Michal Privoznik --- src/util/vircommand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 5f22bd0ac3..ebd986cb13 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -3105,7 +3105,6 @@ virCommandFree(virCommand *cmd) * ... * * - * The libvirt's event loop is used for handling stdios of @cmd. * Since current implementation uses strlen to determine length * of data to be written to @cmd's stdin, don't pass any binary * data. If you want to re-run command, you need to call this and @@ -3117,7 +3116,7 @@ virCommandDoAsyncIO(virCommand *cmd) if (virCommandHasError(cmd)) return; =20 - cmd->flags |=3D VIR_EXEC_ASYNC_IO | VIR_EXEC_NONBLOCK; + cmd->flags |=3D VIR_EXEC_ASYNC_IO; } =20 =20 --=20 2.34.1