From nobody Sun Feb 8 23:41:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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 205.139.110.61 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=1594198198; cv=none; d=zohomail.com; s=zohoarc; b=m8LYZ9659Lp1/oa/ZkrgqgZMk2ZfgTCLq+7pd98lqeiFWHPVzV/OH9gDpmFAu7xT8jmFfQEogu55mCZbTGqx3+XhHgL38v5nVxwvnfeRtTgOFzqSz8O3spXO8S8WzPmr4441JRklK5yydiCSjn11SuCHgDg2SFK/XQdZ5VdTLMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594198198; h=Content-Type:Content-Transfer-Encoding:Cc: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=hLEf7kdqllCQogCXpBXRfgLD9bMXH2pyungrio94Pn8=; b=ewQXTWZW34eIhxCKrH8rUo1uO98Z4espSihKaDA+vMDl5F4Mtv3Vn4qxGZycTA6eIb+S1Ltj407uLDoiSdhFw58YueZMJWYEvfUb9PeuCoVf7HrWLZkKa2bZo6dTmZkGVhNXhsrc4nKJLd2NBql1sjNnMZefET5YP29A+xsqdig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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 [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594198198258220.7142178824115; Wed, 8 Jul 2020 01:49:58 -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-188-rinRbLG2PVKO7B-CSn4A5A-1; Wed, 08 Jul 2020 04:49:54 -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 79C20805729; Wed, 8 Jul 2020 08:49:49 +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 5730A1000235; Wed, 8 Jul 2020 08:49:49 +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 279A31809557; Wed, 8 Jul 2020 08:49:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0688naCn016459 for ; Wed, 8 Jul 2020 04:49:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B57E1A914; Wed, 8 Jul 2020 08:49:36 +0000 (UTC) Received: from nautilus.redhat.com (unknown [10.40.193.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id D301519C4F; Wed, 8 Jul 2020 08:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594198196; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=hLEf7kdqllCQogCXpBXRfgLD9bMXH2pyungrio94Pn8=; b=NWNELi0jStDIMhe2FWXHeqyHMHzBu3h2ZYgEZu8xobQjx135iv9GAuyYiTr15XLgsHDwil RPACVSomB696s+UkgMUfOdzH9HMLCX+CEmayvA+K1oTT0QUY5VjvpSS5uYth9+2hC6trXd BF3/6Alhr75J2mYn3enFy5jEJpBKyPM= X-MC-Unique: rinRbLG2PVKO7B-CSn4A5A-1 From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/2] qemu: Use virQEMUCapsCacheLookupDefault instead of lookup by arch Date: Wed, 8 Jul 2020 10:49:30 +0200 Message-Id: <912341135b0342dfb34867152ea293ebb3d49577.1594198169.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Erik Skultety 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) Content-Type: text/plain; charset="utf-8" Firstly, SEV is present only on AMD, so we can safely assume x86. Secondly, the problem with looking up capabilities in the cache by arch is that it's using virHashSearch with a callback to find the right capabilities and get the binary name from it as well, but since the cache is empty, it will return NULL and we won't get the corresponding binary name out of the lookup either. Then, during the cache validation we try to create a new cache entry for the emulator, but since we don't have the binary name, nothing gets created. Therefore, virQEMUCapsCacheLookupDefault is used to fix this issue, because it doesn't rely on the capabilities cache to construct the emulator binary name. https://bugzilla.redhat.com/show_bug.cgi?id=3D1852311 Signed-off-by: Erik Skultety --- src/qemu/qemu_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a5b38b3d24..cd8d7ffb56 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -22823,8 +22823,10 @@ qemuNodeGetSEVInfo(virConnectPtr conn, if (virNodeGetSevInfoEnsureACL(conn) < 0) return -1; =20 - qemucaps =3D virQEMUCapsCacheLookupByArch(driver->qemuCapsCache, - virArchFromHost()); + qemucaps =3D virQEMUCapsCacheLookupDefault(driver->qemuCapsCache, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL); + if (!qemucaps) return -1; =20 --=20 2.26.2