From nobody Thu Mar 28 19:05:28 2024 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=1652470370; cv=none; d=zohomail.com; s=zohoarc; b=TJtcndzOVeCKECjqyRi4VG2TfFMfq8qxyUCeBVtgctePHXje9CpnKOSrrUotksMXJbhW8ChAOhXiidHB/xIwIIWJ6DW1gUXNEiwK15V+eelnw1YuNv+0f93LmpBDQ09iLQODZ/9BLUKrU7H4CYneZhsHM+wrlGkNIBaJWKf8VfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652470370; h=Content-Type:Content-Transfer-Encoding:Cc: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=WUVqlpwCaVr4pDGScNdED9DC3I+ZIxnSA4Kzld3v/MM=; b=OKC1AfAO6xlbxj8AtbzDqa8Bp2r+FVyw9YY+XdpibOuaKZ8sh0/fzDiYzhgi20WeozQ/C3fQ8y1JQt1LsB+OknXBmLb1NCY5EUI/rJxC5OlGrcrxdbg+xIQeHnbFqrzijmHd2e3k4q9NZjYaUKtumMbp5AAt+j+jxRaLZrFavXU= 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 1652470370902912.1638442646288; Fri, 13 May 2022 12:32:50 -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-164-SD4JnPMJPzWBNRjLLhfsGw-1; Fri, 13 May 2022 15:32:47 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 53A0F80B71A; Fri, 13 May 2022 19:32:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E66314E043A; Fri, 13 May 2022 19:32:45 +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 4CF63193223E; Fri, 13 May 2022 19:32:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D7B1E194975B for ; Fri, 13 May 2022 19:32:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CB53740CFD02; Fri, 13 May 2022 19:32:43 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.19.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0E3940CFD00; Fri, 13 May 2022 19:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652470369; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WUVqlpwCaVr4pDGScNdED9DC3I+ZIxnSA4Kzld3v/MM=; b=GRbQz53KufROlqXxS3IrcNZDJIHThrFnliiycpr1jGeuKoqhLMxZ2g9JiXU7SYVVOyRK1Z 95eTNsyKK1WzK6el/KR9G5KvRr9R35xiRmSPsoDIde7O/3SxulhCynn2TAmbgGezC4oWeC RHGILt4IXWPRHE/Kir3yQRU8cGWX8MU= X-MC-Unique: SD4JnPMJPzWBNRjLLhfsGw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] util: remove virCommandPassFDGetFDIndex() Date: Fri, 13 May 2022 14:32:41 -0500 Message-Id: <20220513193242.1197894-2-jjongsma@redhat.com> In-Reply-To: <20220513193242.1197894-1-jjongsma@redhat.com> References: <20220513193242.1197894-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: , Cc: pkrempa@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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: 1652470372077100001 Content-Type: text/plain; charset="utf-8"; x-default="true" commit f9236200 removed the last use of this function, so it can be dropped. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/vircommand.c | 27 --------------------------- src/util/vircommand.h | 3 --- 3 files changed, 31 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 9309259751..66f73e84aa 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2057,7 +2057,6 @@ virCommandNewArgs; virCommandNewVAList; virCommandNonblockingFDs; virCommandPassFD; -virCommandPassFDGetFDIndex; virCommandPassFDIndex; virCommandRawStatus; virCommandRequireHandshake; diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 41cf552d7b..f3c26a2673 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1077,33 +1077,6 @@ virCommandPassFD(virCommand *cmd, int fd, unsigned i= nt flags) virCommandPassFDIndex(cmd, fd, flags, NULL); } =20 -/* - * virCommandPassFDGetFDIndex: - * @cmd: pointer to virCommand - * @fd: FD to get index of - * - * Determine the index of the FD in the transfer set. - * - * Returns index >=3D 0 if @set contains @fd, - * -1 otherwise. - */ -int -virCommandPassFDGetFDIndex(virCommand *cmd, int fd) -{ - size_t i =3D 0; - - if (virCommandHasError(cmd)) - return -1; - - while (i < cmd->npassfd) { - if (cmd->passfd[i].fd =3D=3D fd) - return i; - i++; - } - - return -1; -} - /** * virCommandSetPidFile: * @cmd: the command to modify diff --git a/src/util/vircommand.h b/src/util/vircommand.h index 600806a987..c534a9bb16 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -61,9 +61,6 @@ void virCommandPassFDIndex(virCommand *cmd, unsigned int flags, size_t *idx) G_GNUC_NO_INLINE; =20 -int virCommandPassFDGetFDIndex(virCommand *cmd, - int fd); - void virCommandSetPidFile(virCommand *cmd, const char *pidfile) ATTRIBUTE_NONNULL(2); =20 --=20 2.35.3 From nobody Thu Mar 28 19:05:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1652470445; cv=none; d=zohomail.com; s=zohoarc; b=XXCmyUqfo/AaoIsNcIppDNBiGcXPIGMgW32KFj2n5zoTXCQ2LaiWWTKUohxARzeHm+mfIWwb8rAylHB9UIqwaVsWP+FbP6sLxy5JVknfh8dhx5xkxnhaB+bkImOZbUAaUMZtAdHkqj2GdwdMYLcMrWSYPe4yYDvcx6+Pe1TyZyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652470445; h=Content-Type:Content-Transfer-Encoding:Cc: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=0gK9a69YRNYdHJ6aoLC0k6CVvYSzBjNTiidG0tTZvFM=; b=j8sX/WfCgtd4ac/uQkrt6ynPtKb31Oztm6YuieNtB37OPwHJm1NykUTdgVCba5qUHA8gP6zcAomDXSa6czVlB2K+i4Xz2A5ODp7yxLN2QyoQIzUW6+mtawSWy0Yg5Upy2YIHgz+4FzHyBuG5oFGB1bKQBzdQC625Gj6ZF2Ec15w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1652470445257196.72996667943937; Fri, 13 May 2022 12:34:05 -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-179-unK9zRQAPP2qmVRPAY3Xjg-1; Fri, 13 May 2022 15:32:48 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CFF1286B8C2; Fri, 13 May 2022 19:32:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B643B43FD41; Fri, 13 May 2022 19:32:45 +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 E6F1F1932235; Fri, 13 May 2022 19:32:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 34662193223E for ; Fri, 13 May 2022 19:32:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 16C0D40CFD02; Fri, 13 May 2022 19:32:44 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.19.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DFC4A40CFD00; Fri, 13 May 2022 19:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652470444; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0gK9a69YRNYdHJ6aoLC0k6CVvYSzBjNTiidG0tTZvFM=; b=EAul9jMBrsFnTccDVstflVTL9pZWtxV3JQKwRy3e1qmweqwr3SdeA6d/ZTzfRYOW0F79VB hkCjaMLiguidQgsXcoleivJkCki9VkU0PlwAlTGuG/x02LKORA5Uk+LwnLUKwMOTJaYslU qPafHyQgBtNqEaxpyas/Mg9+j3wW2Wg= X-MC-Unique: unK9zRQAPP2qmVRPAY3Xjg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] util: Remove virCommandPassFDIndex() Date: Fri, 13 May 2022 14:32:42 -0500 Message-Id: <20220513193242.1197894-3-jjongsma@redhat.com> In-Reply-To: <20220513193242.1197894-1-jjongsma@redhat.com> References: <20220513193242.1197894-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: , Cc: pkrempa@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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: 1652470446600100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The last use of this function was removed in commit 6d161bcc, so the function is no longer used except as an internal implementation for virCommandPassFD(). Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/vircommand.c | 28 ++-------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 66f73e84aa..d95c181793 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2057,7 +2057,6 @@ virCommandNewArgs; virCommandNewVAList; virCommandNonblockingFDs; virCommandPassFD; -virCommandPassFDIndex; virCommandRawStatus; virCommandRequireHandshake; virCommandRun; diff --git a/src/util/vircommand.c b/src/util/vircommand.c index f3c26a2673..d78c666f28 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1021,11 +1021,10 @@ virCommandNewVAList(const char *binary, va_list lis= t) VIR_FORCE_CLOSE(fd) =20 /** - * virCommandPassFDIndex: + * virCommandPassFD: * @cmd: the command to modify * @fd: fd to reassign to the child * @flags: extra flags; binary-OR of virCommandPassFDFlags - * @idx: pointer to fill with the index of the FD in the transfer set * * Transfer the specified file descriptor to the child, instead * of closing it on exec. @fd must not be one of the three @@ -1036,7 +1035,7 @@ virCommandNewVAList(const char *binary, va_list list) * should cease using the @fd when this call completes */ void -virCommandPassFDIndex(virCommand *cmd, int fd, unsigned int flags, size_t = *idx) +virCommandPassFD(virCommand *cmd, int fd, unsigned int flags) { if (!cmd) { VIR_COMMAND_MAYBE_CLOSE_FD(fd, flags); @@ -1052,29 +1051,6 @@ virCommandPassFDIndex(virCommand *cmd, int fd, unsig= ned int flags, size_t *idx) } =20 virCommandFDSet(cmd, fd, flags); - - if (idx) - *idx =3D cmd->npassfd - 1; -} - -/** - * virCommandPassFD: - * @cmd: the command to modify - * @fd: fd to reassign to the child - * @flags: extra flags; binary-OR of virCommandPassFDFlags - * - * Transfer the specified file descriptor to the child, instead - * of closing it on exec. @fd must not be one of the three - * standard streams. - * - * If the flag VIR_COMMAND_PASS_FD_CLOSE_PARENT is set then fd will - * be closed in the parent no later than Run/RunAsync/Free. The parent - * should cease using the @fd when this call completes - */ -void -virCommandPassFD(virCommand *cmd, int fd, unsigned int flags) -{ - virCommandPassFDIndex(cmd, fd, flags, NULL); } =20 /** --=20 2.35.3