From nobody Fri May 10 01:13:46 2024 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=1695389215; cv=none; d=zohomail.com; s=zohoarc; b=nmjTAV//c4NRhzS3XQ3pnJpOlgGDIkwTUmtT4A5/7vE96o+hGmZwaHdAB+DHJoDAoFUzKonOvBOm1wSjlGmLeQCFzFju5/F2MYutAuOBR5rD/VLpRZKg/et++8Iu1Z64XCpLX+pwuY5O9lYzWnFEmzZOkxyMXCam7lx04SHxqJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695389215; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=MMr2y6JvU0z8Bw9u3GjBnEZXD3jFbmQdO/qlvNWqIEM=; b=G33dbwGeaqBtWG01UhuSibw5Xkk45guXLPsQv9RTZUqNnCE4SGDvbUGJytlYd0LBiwtXoqM0pVq8OcO/qqPS2ycg/HLKJxOxp7dZ2tVPB2B95pfNfsTA++PIaD2wPRwcMFAbmGa9ClEe8fky1yM4Tq3ZNVmAbTM0a3wcxkcghlw= 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 1695389215830672.8112932894065; Fri, 22 Sep 2023 06:26:55 -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-663-RoXqG_nYPpykfbbnVVv4oA-1; Fri, 22 Sep 2023 09:26:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A78F7185A79C; Fri, 22 Sep 2023 13:26:49 +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 2AFF410005D4; Fri, 22 Sep 2023 13:26:47 +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 93EA61946588; Fri, 22 Sep 2023 13:26:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E557D1946586 for ; Fri, 22 Sep 2023 13:26:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B42D1C154CA; Fri, 22 Sep 2023 13:26:40 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.224.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA074C15BB8 for ; Fri, 22 Sep 2023 13:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695389214; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MMr2y6JvU0z8Bw9u3GjBnEZXD3jFbmQdO/qlvNWqIEM=; b=UwcfafG2z0eObHsG0YHojBFLuWEV6wjZ430rFAenNixvJXp2Renwn83QQMKQTIUGB402yi FFvOaBMNGzfNYg/f6G2ZN5qpG9MEOjj97KmhljF7YSXDFArwzu2LdzfXwWmIQuhEX3QnM2 92czVRyS8stkBuInGp+72mK8uSKR9Ts= X-MC-Unique: RoXqG_nYPpykfbbnVVv4oA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: Improve error message for failed firmware autoselection Date: Fri, 22 Sep 2023 15:26:36 +0200 Message-ID: <20230922132636.361169-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695389217678100001 The current message can be misleading, because it seems to suggest that no firmware of the requested type is available on the system. What actually happens most of the time, however, is that despite having multiple firmwares of the right type to choose from, none of them is suitable because of lacking some specific feature or being incompatible with some setting that the user has explicitly enabled. Providing an error message that describes exactly the problem is not feasible, since we would have to list each candidate along with the reason why we rejected it, which would get out of hand quickly. As a small but hopefully helpful improvement over the current situation, reword the error message to make it clearer that the culprit is not necessarily the firmware type, but rather the overall domain configuration. Suggested-by: Michael Kj=C3=B6rling <7d1340278307@ewoof.net> Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/qemu/qemu_firmware.c | 2 +- .../firmware-auto-efi-loader-path-nonstandard.x86_64-latest.err | 2 +- ...rmware-auto-efi-nvram-template-nonstandard.x86_64-latest.err | 2 +- .../firmware-auto-efi-rw-abi-update.x86_64-latest.err | 2 +- tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 3dcd139a47..d39e61d071 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1854,7 +1854,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver, } } else { virReportError(VIR_ERR_OPERATION_FAILED, - _("Unable to find any firmware to satisfy '%1$s= '"), + _("Unable to find '%1$s' firmware that is compa= tible with the current configuration"), virDomainOsDefFirmwareTypeToString(def->os.firm= ware)); return -1; } diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-loader-path-nonstanda= rd.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-auto-efi-loader-path= -nonstandard.x86_64-latest.err index 4cfde1bd2e..3edb2b3451 100644 --- a/tests/qemuxml2argvdata/firmware-auto-efi-loader-path-nonstandard.x86_= 64-latest.err +++ b/tests/qemuxml2argvdata/firmware-auto-efi-loader-path-nonstandard.x86_= 64-latest.err @@ -1 +1 @@ -operation failed: Unable to find any firmware to satisfy 'efi' +operation failed: Unable to find 'efi' firmware that is compatible with th= e current configuration diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-nvram-template-nonsta= ndard.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-auto-efi-nvram-te= mplate-nonstandard.x86_64-latest.err index 4cfde1bd2e..3edb2b3451 100644 --- a/tests/qemuxml2argvdata/firmware-auto-efi-nvram-template-nonstandard.x= 86_64-latest.err +++ b/tests/qemuxml2argvdata/firmware-auto-efi-nvram-template-nonstandard.x= 86_64-latest.err @@ -1 +1 @@ -operation failed: Unable to find any firmware to satisfy 'efi' +operation failed: Unable to find 'efi' firmware that is compatible with th= e current configuration diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-= latest.err b/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-= latest.err index 4cfde1bd2e..3edb2b3451 100644 --- a/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.= err +++ b/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.= err @@ -1 +1 @@ -operation failed: Unable to find any firmware to satisfy 'efi' +operation failed: Unable to find 'efi' firmware that is compatible with th= e current configuration diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err = b/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err index 4cfde1bd2e..3edb2b3451 100644 --- a/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err +++ b/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err @@ -1 +1 @@ -operation failed: Unable to find any firmware to satisfy 'efi' +operation failed: Unable to find 'efi' firmware that is compatible with th= e current configuration --=20 2.41.0