From nobody Mon Feb 9 12:11:35 2026 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=1633620973; cv=none; d=zohomail.com; s=zohoarc; b=R6o2gnUrieTiIg9fQX1aipscPP3p9wXSjT1KZQhRaMvNaXdn2pJjwsdoJj1qTg6HLAemFUsjut4EUk89qGKHZTyH4Hg9hWrDLHrzbomwFOH4Rfvt07lD3Q8hYEp+UmJJFxUdyfeWCjDC537ytawi5eYm6ZYca3U3kuZUelIjBS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633620973; 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=LsyOlmtd53FBgDwhxDX9X31YFeNBiW67ZQlQjILCUUs=; b=PjOY75CdskcVNEmlBwv0Od0YfFeaugThyNLjsIUjDtZ/D/+UStcGeVo6vIfO8fo2D3OJhuwyi9fr+CzFKELUFKwuNwCqn6oi3AZK/EBMcmIT3yh8+4+HQU4rkmx+jRA0B2Ga2Rx9kDVkNXFA3R/fp//avND5pNJkA/yUgddVEYo= 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 1633620973011530.5239179160195; Thu, 7 Oct 2021 08:36:13 -0700 (PDT) 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-32-KajVqTcqN8K8m-joz2H19A-1; Thu, 07 Oct 2021 11:36:10 -0400 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 8E41D8BB3C1; Thu, 7 Oct 2021 15:28:27 +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 6687E10E00E4; Thu, 7 Oct 2021 15:28:27 +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 B449B1803B30; Thu, 7 Oct 2021 15:28:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 197FJiMP024043 for ; Thu, 7 Oct 2021 11:19:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 86ED55F4EA; Thu, 7 Oct 2021 15:19:44 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFA165F4F3 for ; Thu, 7 Oct 2021 15:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633620972; 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=LsyOlmtd53FBgDwhxDX9X31YFeNBiW67ZQlQjILCUUs=; b=b4udp2o8SivUMTh7Ara3W2qUnHr3B8KxtUIVS3WV8UglmcqZEEaIyIn0LhyusOPIyMzGXG 0UKS8YXJj3jvxp9JLROKKHDPOQmOCAdxc1oAEKVeN8J819PbdZG0kSb5v4TSyz+192bw2H qtGXSBWdTc2iGEJvoD7r2qccHUtIZUY= X-MC-Unique: KajVqTcqN8K8m-joz2H19A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 052/103] qemu: validate: Move validation of device rom Date: Thu, 7 Oct 2021 17:17:40 +0200 Message-Id: <0a2364a943ad51e444bf971b35b26ccf3940dfa6.1633619630.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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 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: 1633620973377100001 Content-Type: text/plain; charset="utf-8" Move the validation from 'qemuBuildRomStr' into the function which validates device info. It was originally named 'qemuValidateDomainDeviceDefAddress' but this commit renames it to 'qemuValidateDomainDeviceDefInfo'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 6 ------ src/qemu/qemu_validate.c | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 75a30f75ff..95395805e5 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1048,12 +1048,6 @@ qemuBuildRomStr(virBuffer *buf, virDomainDeviceInfo *info) { if (info->romenabled || info->rombar || info->romfile) { - if (info->type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("ROM tuning is only supported for PCI d= evices")); - return -1; - } - /* Passing an empty romfile=3D tells QEMU to disable ROM entirely = for * this device, and makes other settings irrelevant */ if (info->romenabled =3D=3D VIR_TRISTATE_BOOL_NO) { diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 499c9ed571..08f7fb2f42 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1362,6 +1362,14 @@ qemuValidateDomainDeviceInfo(const virDomainDeviceDe= f *dev, } } + if (info->romenabled || info->rombar || info->romfile) { + if (info->type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("ROM tuning is only supported for PCI devices= ")); + return -1; + } + } + return 0; } --=20 2.31.1