From nobody Tue May 7 04:26:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 209.132.183.28 is neither permitted nor denied by domain of redhat.com) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 209.132.183.28 is neither permitted nor denied by domain of redhat.com) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1504122660973597.6187467118586; Wed, 30 Aug 2017 12:51:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2A46369C4; Wed, 30 Aug 2017 19:50:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B177617C17; Wed, 30 Aug 2017 19:50:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7825B1806107; Wed, 30 Aug 2017 19:50:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7UJmflP027806 for ; Wed, 30 Aug 2017 15:48:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 32AC898163; Wed, 30 Aug 2017 19:48:41 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-88.phx2.redhat.com [10.3.116.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3B1C9815E for ; Wed, 30 Aug 2017 19:48:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D2A46369C4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Wed, 30 Aug 2017 15:48:37 -0400 Message-Id: <20170830194837.11569-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: Clean up qemuDomainSecretPrepare X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 30 Aug 2017 19:50:54 +0000 (UTC) X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" No need to pass a @driver parameter since all that's done is deref the @cfg especially since the only caller can just pass an already referenced @cfg. Also, looks like commit id '0298531b' at one time had a different name for the API, so I took the liberty of fixing the comments too since I would already be updating them for the @cfg variable. Signed-off-by: John Ferlan --- Saw this while doing some updates for the recently posted VxHS series. src/qemu/qemu_domain.c | 11 ++++------- src/qemu/qemu_domain.h | 2 +- src/qemu/qemu_process.c | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index cbee151..4cd0087 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7454,7 +7454,7 @@ qemuDomainPrepareChannel(virDomainChrDefPtr channel, } =20 =20 -/* qemuProcessPrepareDomainChardevSourceTLS: +/* qemuDomainPrepareChardevSourceTLS: * @source: pointer to host interface data for char devices * @cfg: driver configuration * @@ -7478,19 +7478,18 @@ qemuDomainPrepareChardevSourceTLS(virDomainChrSourc= eDefPtr source, } =20 =20 -/* qemuProcessPrepareDomainChardevSource: +/* qemuDomainPrepareChardevSource: * @def: live domain definition - * @driver: qemu driver + * @cfg: driver configuration * * Iterate through all devices that use virDomainChrSourceDefPtr as host * interface part. */ void qemuDomainPrepareChardevSource(virDomainDefPtr def, - virQEMUDriverPtr driver) + virQEMUDriverConfigPtr cfg) { size_t i; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); =20 for (i =3D 0; i < def->nserials; i++) qemuDomainPrepareChardevSourceTLS(def->serials[i]->source, cfg); @@ -7515,8 +7514,6 @@ qemuDomainPrepareChardevSource(virDomainDefPtr def, =20 for (i =3D 0; i < def->nredirdevs; i++) qemuDomainPrepareChardevSourceTLS(def->redirdevs[i]->source, cfg); - - virObjectUnref(cfg); } =20 =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index f93b09b..4b030ae 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -842,7 +842,7 @@ void qemuDomainPrepareChardevSourceTLS(virDomainChrSour= ceDefPtr source, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 void qemuDomainPrepareChardevSource(virDomainDefPtr def, - virQEMUDriverPtr driver) + virQEMUDriverConfigPtr cfg) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 int qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 364c359..44df858 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5327,7 +5327,7 @@ qemuProcessPrepareDomain(virConnectPtr conn, goto cleanup; =20 VIR_DEBUG("Prepare chardev source backends for TLS"); - qemuDomainPrepareChardevSource(vm->def, driver); + qemuDomainPrepareChardevSource(vm->def, cfg); =20 VIR_DEBUG("Add secrets to disks, hostdevs, and chardevs"); if (qemuDomainSecretPrepare(conn, driver, vm) < 0) --=20 2.9.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list