From nobody Fri Apr 26 12:35:38 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=1652105599; cv=none; d=zohomail.com; s=zohoarc; b=LPk4NIFdaSf/R9y8PlNE5LUNEPirWrgCtaiKDbGdwUQX3QYbNJx+2+1RpArFfevuBm3DixxK4XR803oD9fDJaVPdk83WRPbDLtrFt39kqqCPFdsquf3Ogt0Uya5wA6xqJNQJ6DRO6v2/6/FzhNZudVpy/CWxWq5GruoyvlHv62Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652105599; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=pJ5HdwHpbrqQEwLaqsrpstsNwBsyiDUUaDAFaoeCwDs=; b=J8eJIwLI0r4Wz1zuCyyuo4sey+kEW0BQDArRG9LU4u74TkKpVS1PpqLJWs4CeoZXDsitmv1qe4MaM32KxVyjJCiVPQDDl2raQqyJ5j8JVGJn9hgQ+mq5kpEn+YwxgHOxFuWfN+iZ+Bg/CdzXJ1ni2ABmPL4lIJM7KjYUZ9NTwpA= 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 1652105599106863.610346814481; Mon, 9 May 2022 07:13:19 -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-350-s_N1xCUVNXC74sL66q_tvQ-1; Mon, 09 May 2022 10:13:14 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7631E1857F10; Mon, 9 May 2022 14:13:10 +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 3DB7A400E896; Mon, 9 May 2022 14:13:07 +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 02BBE1947051; Mon, 9 May 2022 14:13:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 590661947040 for ; Mon, 9 May 2022 14:13:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 36220111E3EC; Mon, 9 May 2022 14:13:05 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1FAB111E3FB for ; Mon, 9 May 2022 14:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652105598; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pJ5HdwHpbrqQEwLaqsrpstsNwBsyiDUUaDAFaoeCwDs=; b=GmoWGPez8mgV3Qf3++OlqKsxV0gHEKF40MKaWI1e3bucSv1jnptmQVng+LqAJDNQ6CIk+R tlac2UKhqU80VQ94+dy60BETiTXZCESEVU99IgGQFCWtb4pWGiiY+OTj9trsmCkqBJ4rKY y0qMBK4v6K0gKRMOKDJ2ooFjRThtGMI= X-MC-Unique: s_N1xCUVNXC74sL66q_tvQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_security: Drop qemuSecurityStartVhostUserGPU() Date: Mon, 9 May 2022 16:12:53 +0200 Message-Id: <3ebdadc1af3dff1c748a9279a8ff2b3324c2796f.1652105573.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.84 on 10.11.54.1 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: 1652105599711100003 Content-Type: text/plain; charset="utf-8"; x-default="true" There's no real difference between qemuSecurityStartVhostUserGPU() and qemuSecurityCommandRun(). The latter is used more frequently while the former has just one user. Therefore, drop the less frequently used one. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_security.c | 40 ---------------------------------- src/qemu/qemu_security.h | 6 ----- src/qemu/qemu_vhost_user_gpu.c | 3 +-- 3 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c index 19d957dd4b..3be1766764 100644 --- a/src/qemu/qemu_security.c +++ b/src/qemu/qemu_security.c @@ -499,46 +499,6 @@ qemuSecurityRestoreNetdevLabel(virQEMUDriver *driver, } =20 =20 -/* - * qemuSecurityStartVhostUserGPU: - * - * @driver: the QEMU driver - * @vm: the domain object - * @cmd: the command to run - * @existstatus: pointer to int returning exit status of process - * @cmdret: pointer to int returning result of virCommandRun - * - * Start the vhost-user-gpu process with appropriate labels. - * This function returns -1 on security setup error, 0 if all the - * setup was done properly. In case the virCommand failed to run - * 0 is returned but cmdret is set appropriately with the process - * exitstatus also set. - */ -int -qemuSecurityStartVhostUserGPU(virQEMUDriver *driver, - virDomainObj *vm, - virCommand *cmd, - int *exitstatus, - int *cmdret) -{ - if (virSecurityManagerSetChildProcessLabel(driver->securityManager, - vm->def, cmd) < 0) - return -1; - - if (virSecurityManagerPreFork(driver->securityManager) < 0) - return -1; - - *cmdret =3D virCommandRun(cmd, exitstatus); - - virSecurityManagerPostFork(driver->securityManager); - - if (*cmdret < 0) - return -1; - - return 0; -} - - /* * qemuSecurityStartTPMEmulator: * diff --git a/src/qemu/qemu_security.h b/src/qemu/qemu_security.h index 8b26ea3f99..eaf646f225 100644 --- a/src/qemu/qemu_security.h +++ b/src/qemu/qemu_security.h @@ -87,12 +87,6 @@ int qemuSecurityRestoreNetdevLabel(virQEMUDriver *driver, virDomainObj *vm, virDomainNetDef *net); =20 -int qemuSecurityStartVhostUserGPU(virQEMUDriver *driver, - virDomainObj *vm, - virCommand *cmd, - int *exitstatus, - int *cmdret); - int qemuSecurityStartTPMEmulator(virQEMUDriver *driver, virDomainObj *vm, virCommand *cmd, diff --git a/src/qemu/qemu_vhost_user_gpu.c b/src/qemu/qemu_vhost_user_gpu.c index f7d444e851..6f601cebde 100644 --- a/src/qemu/qemu_vhost_user_gpu.c +++ b/src/qemu/qemu_vhost_user_gpu.c @@ -158,8 +158,7 @@ int qemuExtVhostUserGPUStart(virQEMUDriver *driver, virCommandAddArgFormat(cmd, "--render-node=3D%s", video->accel= ->rendernode); } =20 - if (qemuSecurityStartVhostUserGPU(driver, vm, cmd, - &exitstatus, &cmdret) < 0) + if (qemuSecurityCommandRun(driver, vm, cmd, -1, -1, &exitstatus, &cmdr= et) < 0) goto error; =20 if (cmdret < 0 || exitstatus !=3D 0) { --=20 2.35.1