From nobody Mon Dec 15 23:01:47 2025 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=1658846381; cv=none; d=zohomail.com; s=zohoarc; b=PI5flGhieyG4o0BF8WiPuKe3BYtVInjh/sq4vOTerHoen5aRjqdUp62aaGRKBXTFI0ZQipS/c0z+OdYuvzzjbuydlitPrl5sm0Oe60q3zWo/oEN0XNiTqVrBRt7rXMdDnS0x0Uc1veDxnfNFS4DlvUkj8Ln68UyJBs1fC7OlSLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846381; 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=QaZs5nZjvoXxa+77U+3TYgIFVVOE8RIGoEjGZtb8yn4=; b=jt1gukwGyojGN9B8iqxfYrNDQpVl4OqG6lhxJchaUo6zdonWrExGHOOucrpP+zljobGHLzPy1SxLQ0X1mO8roqXUl4YFCRWJ72VAOQw9IXfx9e5zjchu+8ptvREPp3HbxFuVe4+aGZAjdrOddId1gYGJLjfFRgVxorjQ40e0Grk= 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 1658846381849395.12173768341063; Tue, 26 Jul 2022 07:39:41 -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-615-PgYnZWX4Ok2wvNXH4v_m2Q-1; Tue, 26 Jul 2022 10:39:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A08B1824627; Tue, 26 Jul 2022 14:38:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 836F0C28118; Tue, 26 Jul 2022 14:38:59 +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 F16861947B88; Tue, 26 Jul 2022 14:38:56 +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 B90F01947054 for ; Tue, 26 Jul 2022 14:38:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A53B6400EA8E; Tue, 26 Jul 2022 14:38:50 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3154C40CF8EE for ; Tue, 26 Jul 2022 14:38:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846380; 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=QaZs5nZjvoXxa+77U+3TYgIFVVOE8RIGoEjGZtb8yn4=; b=LjKabr5/QJDMw+4lTgiTAIEEP+YyZ/YoXy2PNzfuDuX0wIw2JIXTwF03PYkMKSEwzI2mXR EJAAYGp+N2z3ZtHcmZkTdfC9mzv7ykwmbnndTqsadOXLhRvuxeR5Iw+EkddNjFoyZY6M5o b7aOt0qyLnrP/7QyQ4BL1VjoJaeKR2o= X-MC-Unique: PgYnZWX4Ok2wvNXH4v_m2Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 51/80] qemu: Remove pre-blockdev PFLASH setup Date: Tue, 26 Jul 2022 16:37:29 +0200 Message-Id: In-Reply-To: References: 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: 1658846382454100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 60 +++++++---------------------------------- src/qemu/qemu_domain.c | 5 +--- 2 files changed, 10 insertions(+), 55 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 5c90138c73..ed718eb81b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7045,8 +7045,7 @@ qemuBuildMachineCommandLine(virCommand *cmd, } } - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV) && - virDomainDefHasOldStyleUEFI(def)) { + if (virDomainDefHasOldStyleUEFI(def)) { if (priv->pflash0) virBufferAsprintf(&buf, ",pflash0=3D%s", priv->pflash0->nodefo= rmat); if (def->os.loader->nvram) @@ -9364,53 +9363,10 @@ qemuBuildRedirdevCommandLine(virCommand *cmd, } -static void -qemuBuildDomainLoaderPflashCommandLine(virCommand *cmd, - virDomainLoaderDef *loader, - virQEMUCaps *qemuCaps) -{ - g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - int unit =3D 0; - - if (loader->secure =3D=3D VIR_TRISTATE_BOOL_YES) { - virCommandAddArgList(cmd, - "-global", - "driver=3Dcfi.pflash01,property=3Dsecure,valu= e=3Don", - NULL); - } - - /* with blockdev we instantiate the pflash when formatting -machine */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) - return; - - virBufferAddLit(&buf, "file=3D"); - virQEMUBuildBufferEscapeComma(&buf, loader->path); - virBufferAsprintf(&buf, ",if=3Dpflash,format=3Draw,unit=3D%d", unit); - unit++; - - if (loader->readonly) { - virBufferAsprintf(&buf, ",readonly=3D%s", - virTristateSwitchTypeToString(loader->readonly)); - } - - virCommandAddArg(cmd, "-drive"); - virCommandAddArgBuffer(cmd, &buf); - - if (loader->nvram) { - virBufferAddLit(&buf, "file=3D"); - virQEMUBuildBufferEscapeComma(&buf, loader->nvram->path); - virBufferAsprintf(&buf, ",if=3Dpflash,format=3Draw,unit=3D%d", uni= t); - - virCommandAddArg(cmd, "-drive"); - virCommandAddArgBuffer(cmd, &buf); - } -} - static void qemuBuildDomainLoaderCommandLine(virCommand *cmd, - virDomainDef *def, - virQEMUCaps *qemuCaps) + virDomainDef *def) { virDomainLoaderDef *loader =3D def->os.loader; @@ -9424,7 +9380,12 @@ qemuBuildDomainLoaderCommandLine(virCommand *cmd, break; case VIR_DOMAIN_LOADER_TYPE_PFLASH: - qemuBuildDomainLoaderPflashCommandLine(cmd, loader, qemuCaps); + if (loader->secure =3D=3D VIR_TRISTATE_BOOL_YES) { + virCommandAddArgList(cmd, + "-global", + "driver=3Dcfi.pflash01,property=3Dsecure,= value=3Don", + NULL); + } break; case VIR_DOMAIN_LOADER_TYPE_NONE: @@ -9859,9 +9820,6 @@ qemuBuildPflashBlockdevCommandLine(virCommand *cmd, if (!virDomainDefHasOldStyleUEFI(vm->def)) return 0; - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) - return 0; - if (priv->pflash0 && qemuBuildPflashBlockdevOne(cmd, priv->pflash0, priv->qemuCaps) < 0) return -1; @@ -10267,7 +10225,7 @@ qemuBuildCommandLine(virDomainObj *vm, if (qemuBuildCpuCommandLine(cmd, driver, def, qemuCaps) < 0) return NULL; - qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps); + qemuBuildDomainLoaderCommandLine(cmd, def); if (qemuBuildMemCommandLine(cmd, def, qemuCaps, priv) < 0) return NULL; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7403b2584b..8b55dd0361 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11305,7 +11305,7 @@ qemuDomainSupportsCheckpointsBlockjobs(virDomainObj= *vm) * qemuDomainInitializePflashStorageSource: * * This helper converts the specification of the source of the 'loader' in= case - * PFLASH is required to virStorageSources in case QEMU_CAPS_BLOCKDEV is p= resent. + * PFLASH is required to virStorageSources. * * This helper is used in the intermediate state when we don't support full * backing chains for pflash drives in the XML. @@ -11323,9 +11323,6 @@ qemuDomainInitializePflashStorageSource(virDomainOb= j *vm, virDomainDef *def =3D vm->def; g_autoptr(virStorageSource) pflash0 =3D NULL; - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) - return 0; - if (!virDomainDefHasOldStyleUEFI(def)) return 0; --=20 2.36.1