From nobody Mon Apr 29 03:24:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1593782342; cv=none; d=zohomail.com; s=zohoarc; b=KyWGcXBojRgByEnIfHkaMJsen57+rgDbLLsZSKHtWGdeiAGwFLkMVSv/tJEVx59R+QsLN+5GpMEmI61ZVFZNyfeCC2hGkUHV9jQnSy8vlPlKTWTe2vleVFlcfe72wdqOMg7Hxr3m8/acouyWbG0QI7Qai4XodwILv6MiQTLdrGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593782342; 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=KxsKw4kO1jseWrBjBnu8ukgCKZIRavFRbmQ2QNm4S7mbfdSIJnfdFC4eevjMkL8c/uIt3qJTDLBcSIOMceC8Zznyuv5ZMo4dOXmW60+Ria3HkB3qnEj8+o/6kBtZqdcARQHc2SiOmR0SO32jWtdTJjqk+q57Sa2JeJuKuVaHMCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1593782342909196.35394583602658; Fri, 3 Jul 2020 06:19:02 -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-398-bf73vZm4MKCO8ZKWlPnJBw-1; Fri, 03 Jul 2020 09:18:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65BB8800C64; Fri, 3 Jul 2020 13:18:52 +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 4716F79221; Fri, 3 Jul 2020 13:18:52 +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 1438C1809557; Fri, 3 Jul 2020 13:18:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 063DErBl004921 for ; Fri, 3 Jul 2020 09:14:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id B2C215F9DC; Fri, 3 Jul 2020 13:14:53 +0000 (UTC) Received: from nautilus.redhat.com (unknown [10.40.192.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07D315FC2E; Fri, 3 Jul 2020 13:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593782341; 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=X4QCRhOmMq/A2y/BXBLikgSkNfYJxDf5R9tWb+n3B4dLIAix99v3FzI4R6LVfsLuqVQ3ln ifbGX0fQtfessncuHm5goESbQliK6idhbDvzKPvhyEjr60iAO0DxcnJRrUyuYeoRnNf6DE eOEHAhR2DuF7MJFtTDwkTukUVEQ4PqA= X-MC-Unique: bf73vZm4MKCO8ZKWlPnJBw-1 From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH 1/1] qemu: Use virQEMUCapsCacheLookupDefault instead of lookup by arch Date: Fri, 3 Jul 2020 15:14:48 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.13 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