From nobody Sun Feb 8 15:30:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1576603573; cv=none; d=zohomail.com; s=zohoarc; b=EMzyPzAFj3H97GNF68fAr1QuFR0cheXJohhlh5ipsw/rw7xSig3fmtf2wiKQMksdU4ITXahc+LbiYr0T8B+5S06iCanyNRYCQMosCGJOGPfLPAYYuvIq2XCGU2cLui9dEmLkQH8lhgugBoCJobHBzWpFA5GE2dnr0WREwymf97w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576603573; 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=k3rr+HJHpdSzcTxl9Us4N0dkd3WkHcvrwjGAHXQUwzM=; b=AWC6a8zzuB9AV6t4M8aWzM36uuD1ajuRtHtxT6sE2eqLlBNv+67vD5oHlL3OmBt9tuIZEVfTPL8/ttxFuuZ5A9vFKhxXMnyPoYi9dz8nNT8QeAMwRlfnI2+lOCtIL77xPphlWyk/egc8Xi7R5Pq4F7YVz2AVrQMtIOYrJp+h1Co= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576603573948865.2787275937877; Tue, 17 Dec 2019 09:26:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-bL-4Q4GFP4GAeN5jV1ZGEQ-1; Tue, 17 Dec 2019 12:26:11 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6531E800C75; Tue, 17 Dec 2019 17:26:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A156C10018FF; Tue, 17 Dec 2019 17:26:04 +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 B5C04104906; Tue, 17 Dec 2019 17:26:03 +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 xBHHPPcx031597 for ; Tue, 17 Dec 2019 12:25:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id DD5095C28F; Tue, 17 Dec 2019 17:25:25 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-155.brq.redhat.com [10.40.204.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EBCE5C28C for ; Tue, 17 Dec 2019 17:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576603572; 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=k3rr+HJHpdSzcTxl9Us4N0dkd3WkHcvrwjGAHXQUwzM=; b=TtV8qTGVOLmPklGwZYNjsVGY43sl2WYnwCplmyQ9DXZePw91zzuPD5FF7Ep9l+UOenpwk3 jhP/iYzilxONA3AZqsDbkvYRsDTcE2+M0pbZrQIQGmy1nPo2bp2n6DYNmebuopXkymWrFy BHs++M07o95l9T1kgQnh6JzVNO/7kKs= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 17 Dec 2019 18:25:19 +0100 Message-Id: <565e183bfb6cf523b491affa6c2f7cbd385c00e8.1576603498.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu_firmware: Pass virDomainDef into qemuFirmwareFillDomain() 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: bL-4Q4GFP4GAeN5jV1ZGEQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This function needs domain definition really, we don't need to pass the whole domain object. This saves couple of dereferences and characters esp. in more checks to come. Signed-off-by: Michal Privoznik Reviewed-by: Cole Robinson --- src/qemu/qemu_firmware.c | 12 ++++++------ src/qemu/qemu_firmware.h | 2 +- src/qemu/qemu_process.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index f62ce90ac9..96058c9b45 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1204,7 +1204,7 @@ qemuFirmwareFetchParsedConfigs(bool privileged, =20 int qemuFirmwareFillDomain(virQEMUDriverPtr driver, - virDomainObjPtr vm, + virDomainDefPtr def, unsigned int flags) { VIR_AUTOSTRINGLIST paths =3D NULL; @@ -1217,7 +1217,7 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver, if (!(flags & VIR_QEMU_PROCESS_START_NEW)) return 0; =20 - if (vm->def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_NONE) + if (def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_NONE) return 0; =20 if ((nfirmwares =3D qemuFirmwareFetchParsedConfigs(driver->privileged, @@ -1225,7 +1225,7 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver, return -1; =20 for (i =3D 0; i < nfirmwares; i++) { - if (qemuFirmwareMatchDomain(vm->def, firmwares[i], paths[i])) { + if (qemuFirmwareMatchDomain(def, firmwares[i], paths[i])) { theone =3D firmwares[i]; VIR_DEBUG("Found matching firmware (description path '%s')", paths[i]); @@ -1236,7 +1236,7 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver, if (!theone) { virReportError(VIR_ERR_OPERATION_FAILED, _("Unable to find any firmware to satisfy '%s'"), - virDomainOsDefFirmwareTypeToString(vm->def->os.firm= ware)); + virDomainOsDefFirmwareTypeToString(def->os.firmware= )); goto cleanup; } =20 @@ -1245,10 +1245,10 @@ qemuFirmwareFillDomain(virQEMUDriverPtr driver, * likely that admin/FW manufacturer messed up. */ qemuFirmwareSanityCheck(theone, paths[i]); =20 - if (qemuFirmwareEnableFeatures(driver, vm->def, theone) < 0) + if (qemuFirmwareEnableFeatures(driver, def, theone) < 0) goto cleanup; =20 - vm->def->os.firmware =3D VIR_DOMAIN_OS_DEF_FIRMWARE_NONE; + def->os.firmware =3D VIR_DOMAIN_OS_DEF_FIRMWARE_NONE; =20 ret =3D 0; cleanup: diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h index 4be65bc664..37cbfae39d 100644 --- a/src/qemu/qemu_firmware.h +++ b/src/qemu/qemu_firmware.h @@ -45,7 +45,7 @@ qemuFirmwareFetchConfigs(char ***firmwares, =20 int qemuFirmwareFillDomain(virQEMUDriverPtr driver, - virDomainObjPtr vm, + virDomainDefPtr def, unsigned int flags); =20 int diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7e1db50e8f..6d4511a49f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6344,7 +6344,7 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, goto cleanup; =20 VIR_DEBUG("Prepare bios/uefi paths"); - if (qemuFirmwareFillDomain(driver, vm, flags) < 0) + if (qemuFirmwareFillDomain(driver, vm->def, flags) < 0) goto cleanup; if (qemuDomainInitializePflashStorageSource(vm) < 0) goto cleanup; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list