From nobody Thu Sep 19 01:22:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1717080822975701.9457883330567; Thu, 30 May 2024 07:53:42 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E50041AAA; Thu, 30 May 2024 10:53:41 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id A00E11D50; Thu, 30 May 2024 10:51:34 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D9D761A23; Thu, 30 May 2024 10:51:17 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5E99A19C2 for ; Thu, 30 May 2024 10:51:17 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-gDcE8ErzMPqeVmXMD1ywlw-1; Thu, 30 May 2024 10:51:15 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D744801190 for ; Thu, 30 May 2024 14:51:14 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94DAF3C27 for ; Thu, 30 May 2024 14:51:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717080677; h=from:from: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; bh=wILGgTLJ8rR5BTzq2/nkqXuZf4w7pape+TgaQcRw2E4=; b=OG2G4y7HWPOw0T/PVlt3882IZXtUnKMDope4gBX+MSLPVu/8UTJLv8otqciC/Lwt1AP8UD 12N/D+lPam/u++pIHG5EJ1YXQV8OYi3WR8GvMkYRtqY4D2S4uoHPEOIJo1zWeqoD6XRgGt x9yXc39AM/mwJwPo4DqfsfaeBxDt638= X-MC-Unique: gDcE8ErzMPqeVmXMD1ywlw-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 3/4] qemu: validate: Fix check for unsupported FS-device bootindex use on un-assigned addresses Date: Thu, 30 May 2024 16:51:08 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EXW7GWFKW7MG665CPCIK5JOEJ2VOC67Y X-Message-ID-Hash: EXW7GWFKW7MG665CPCIK5JOEJ2VOC67Y X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1717080824277100001 Content-Type: text/plain; charset="utf-8" When hot-plugging a FS device with un-assigned address with a bootindex the recently-added validation check would fail as validation on hotplug is done prior to address assignment. To fix this problem we can simply relax the check to also pass on _NONE addresses. Unsupported configurations will still be caught as previous commit re-checks the definition after address assignment prior to hotplug. Resolves: https://issues.redhat.com/browse/RHEL-39271 Fixes: 4690058b6d3dab672bd18ff69c83392245253024 Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ac1940cb31..c08e1538f9 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4519,7 +4519,10 @@ qemuValidateDomainDeviceDefFS(virDomainFSDef *fs, return -1; } - if (fs->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { + /* Address type may be _NONE when validating and will be assig= ned + * later during hotplug */ + if (fs->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + fs->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("setting virtiofs boot order is supported= only with PCI bus")); return -1; --=20 2.45.1