From nobody Tue May 21 04:05:53 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=1659455485; cv=none; d=zohomail.com; s=zohoarc; b=Z3+cd0Rsc3BrNlmnITPyxr5vayBUDwYcLLVwiiA49rImedjzKzvLMWShOt/VgxQ6b6Tg9gQs/UV9FmnpZ0/wxCFEqHdJ9bEk6InIyo0flNqR6KlNdoFgGvvNSiXSozjJgF/1EJ0suSN0M2Wx2q/rnpMsdeUH4AQo/p9BztO1OTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659455485; 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=CX6XTvclbRwc1lmVwBcPOf03dR4qS704ciaS/4p4TSo=; b=DGzJkcDf0IkC7A0Bji/pq344oPQpQn7tjXG7iTUvPVIcfyZnvfpWfAJ8W0WbnkecW4ZPZJ4HI+1UFaz9ekvZIHVoo+x9ECrRbTQqYkuHf6GWUAFSbWZeeP4IPHKcoVtV7tKLCcewSaiUraa/RCTPYABoOskdT2rkqeFrh8lgP0g= 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 1659455485728831.2592819120274; Tue, 2 Aug 2022 08:51:25 -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-103-q2pofzk1P_G2srl3DnIouw-1; Tue, 02 Aug 2022 11:51:21 -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 F16A1801755; Tue, 2 Aug 2022 15:51:18 +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 79518492C3B; Tue, 2 Aug 2022 15:51: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 267F21946A4E; Tue, 2 Aug 2022 15:51:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 35B631946A51 for ; Tue, 2 Aug 2022 15:51:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 07AFF1415116; Tue, 2 Aug 2022 15:51:16 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id A769A141510F for ; Tue, 2 Aug 2022 15:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659455484; 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=CX6XTvclbRwc1lmVwBcPOf03dR4qS704ciaS/4p4TSo=; b=JwJNSOjC4xKb0mkdO84cn1n72T6rpiu/wiBAVYxk2vbifvxvQUuLQCcQShVlmaSnCexObD PQps6Xy+frj4w+sS8MVm/q+ulqh6QFx5Uo2rWVeT/1hs7fY9/w0kF4kd3PSA2KRuh5Mi9e /sO8CB2DZUPZDApYdzVoej50jkjGMic= X-MC-Unique: q2pofzk1P_G2srl3DnIouw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH] qemu_capabilities: replace code with function call Date: Tue, 2 Aug 2022 17:50:13 +0200 Message-Id: <9a68a1dcfa2790c755dec02744f9030009e6ca84.1659455192.git.khanicov@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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 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: 1659455486028100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Since functions virQEMUCapsFillDomainFeatureSEVCaps() and virQEMUCapsSEVInfoCopy() essentially do the same thing it does not make sense to have the code duplicated. This patch replaces the relevant code in the first function with the function call to the second one. Signed-off-by: Kristina Hanicova Reviewed-by: Jonathon Jongsma --- Notes: Pointed out by Michal src/qemu/qemu_capabilities.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b002fb98ed..53223417ae 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6495,18 +6495,7 @@ virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCaps *qem= uCaps, if (!cap) return; =20 - domCaps->sev =3D g_new0(virSEVCapability, 1); - - domCaps->sev->pdh =3D g_strdup(cap->pdh); - domCaps->sev->cert_chain =3D g_strdup(cap->cert_chain); - if (cap->cpu0_id !=3D NULL) { - domCaps->sev->cpu0_id =3D g_strdup(cap->cpu0_id); - } - - domCaps->sev->cbitpos =3D cap->cbitpos; - domCaps->sev->reduced_phys_bits =3D cap->reduced_phys_bits; - domCaps->sev->max_guests =3D cap->max_guests; - domCaps->sev->max_es_guests =3D cap->max_es_guests; + virQEMUCapsSEVInfoCopy(&domCaps->sev, cap); } =20 =20 --=20 2.37.1