From nobody Mon May 6 20:27:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1628170866; cv=none; d=zohomail.com; s=zohoarc; b=i6C4fF/iIk9U8lnmtaqbcXglfpHv1dPjOb/uS4wDSqtlC10oElMcv4/3Q+6OM1/T4dfINZaaJsupdKxoBATOJmrt72c4XVEpqmkMlWcqqppqt/utTE2239FiyEnlBPFpB6xIg3RBo4eIXvAMM/loeSb/BqaicwDskaPmLzeeR74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628170866; 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=Bt+9hPjOUOvE1kOGpFjy/C7u4EWMbcgNflw1+sGQsHg=; b=JAbwt3R2bvyUOkXLm08G1ztlrQ5KG7eoM1Vx5A3Bm00qFkv4ofpAjMCVRUBF5wU98OoT+dMHr7wDqJHreR7JUtaSvrjhKgiGhPYiLl1RB58NXSbycHY0CAthn8Q58UUFv2Z/d58I7pQNnN0D848LC8cYVnQdIuo1HF7Y9neoPjQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1628170866511837.6797073763395; Thu, 5 Aug 2021 06:41:06 -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-441-g8GKBNa0MwuGNEE9t6jqrQ-1; Thu, 05 Aug 2021 09:41:04 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 24C31C73A0; Thu, 5 Aug 2021 13:40:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A25365C1A1; Thu, 5 Aug 2021 13:40:56 +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 F04694BB7C; Thu, 5 Aug 2021 13:40:54 +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 175DakbV011933 for ; Thu, 5 Aug 2021 09:36:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id B3A775C1C5; Thu, 5 Aug 2021 13:36:46 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08DE35C1A1; Thu, 5 Aug 2021 13:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628170865; 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=Bt+9hPjOUOvE1kOGpFjy/C7u4EWMbcgNflw1+sGQsHg=; b=hk/9CDPdI8tjL68e5NbgbYrsSLtzq63W9/6zcgynxeAZLanlrzNHbkqHrInKsDfmFQdSAr cM4fmTCZOYb3owy8GKBDKALz3z3tN0O3iXjDvWPDt/XcDXdpKcDyp83zhkAalevlwuJggm 883Yo5Y5Wsv7boheXkjELAbsuZH7RM4= X-MC-Unique: g8GKBNa0MwuGNEE9t6jqrQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] virQEMUCaps: Add kernel command line Date: Thu, 5 Aug 2021 15:36:38 +0200 Message-Id: <20210805133640.57947-2-twiederh@redhat.com> In-Reply-To: <20210805133640.57947-1-twiederh@redhat.com> References: <20210805133640.57947-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.16 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: 1628170868003100001 Content-Type: text/plain; charset="utf-8" The kernel command line can contain settings affecting the availability of cpu flags. Add the kernel command line to the capabilities cache. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 9558938866..21b7e8050b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -709,6 +709,7 @@ struct _virQEMUCaps { char *hostCPUSignature; char *package; char *kernelVersion; + char *kernelCmdline; =20 virArch arch; =20 @@ -1973,6 +1974,7 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) =20 ret->package =3D g_strdup(qemuCaps->package); ret->kernelVersion =3D g_strdup(qemuCaps->kernelVersion); + ret->kernelCmdline =3D g_strdup(qemuCaps->kernelCmdline); =20 ret->arch =3D qemuCaps->arch; =20 @@ -2024,6 +2026,7 @@ void virQEMUCapsDispose(void *obj) =20 g_free(qemuCaps->package); g_free(qemuCaps->kernelVersion); + g_free(qemuCaps->kernelCmdline); g_free(qemuCaps->binary); g_free(qemuCaps->hostCPUSignature); =20 @@ -4321,6 +4324,12 @@ virQEMUCapsLoadCache(virArch hostArch, goto cleanup; } =20 + if (virXPathBoolean("boolean(./kernelCmdline)", ctxt) > 0) { + qemuCaps->kernelCmdline =3D virXPathString("string(./kernelCmdline= )", ctxt); + if (!qemuCaps->kernelCmdline) + goto cleanup; + } + if (!(str =3D virXPathString("string(./arch)", ctxt))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing arch in QEMU capabilities cache")); @@ -4636,6 +4645,10 @@ virQEMUCapsFormatCache(virQEMUCaps *qemuCaps) virBufferAsprintf(&buf, "%s\n", qemuCaps->kernelVersion); =20 + if (qemuCaps->kernelCmdline) + virBufferAsprintf(&buf, "%s\n", + qemuCaps->kernelCmdline); + virBufferAsprintf(&buf, "%s\n", virArchToString(qemuCaps->arch)); =20 @@ -5495,6 +5508,7 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, qemuCaps->microcodeVersion =3D microcodeVersion; =20 qemuCaps->kernelVersion =3D g_strdup(kernelVersion); + qemuCaps->kernelCmdline =3D NULL; =20 qemuCaps->kvmSupportsNesting =3D virQEMUCapsKVMSupportsNesting(); =20 --=20 2.31.1 From nobody Mon May 6 20:27:45 2024 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=1628170887; cv=none; d=zohomail.com; s=zohoarc; b=ELPqSiN0ogmRScw+mJAXgGALha4QsZSdeAlDSqO1gZcgR2SKnh/iDkGm7vTHsM8JQVWLsPmcaUqaju8+NaJNcn06Ew+pytQpX7n2efUJmbWGQ0H3PFj7wq2GxNRPHyIcBpIFpik3jOziaepvyc+iUs/HEwxDKmkfg4UXmkRMOzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628170887; 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=TYf1GFFuwBAYf+Mq6eIvqg16aKV8svAGHXJNhjMg4ZU=; b=N30PvCrZxteeKGEltHQeiArFl/MHVewFA0/CFm2TMlH3/vvbpf2mbxY6M75zMAiVNiAFrwl3nPH1/XWj1HbCPDZbWs9VJSG8KKpXE5clws6DndX6KS24ZYILRurvGyQ9YafnTonqPxLFJgwFEefGWE+t6qwqj03MBh/hscDt9QM= 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 1628170887101822.7744194532391; Thu, 5 Aug 2021 06:41:27 -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-556-dTUGaC7PMOWAQImcROYCKg-1; Thu, 05 Aug 2021 09:41:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 83B071800D41; Thu, 5 Aug 2021 13:41:19 +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 39C9760BF4; Thu, 5 Aug 2021 13:41:19 +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 04199181A3F2; Thu, 5 Aug 2021 13:41:19 +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 175DalJ6011939 for ; Thu, 5 Aug 2021 09:36:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id BCBE45C1C5; Thu, 5 Aug 2021 13:36:47 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 119B75C1A1; Thu, 5 Aug 2021 13:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628170885; 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=TYf1GFFuwBAYf+Mq6eIvqg16aKV8svAGHXJNhjMg4ZU=; b=dZSkSjn1iziQiw8BsD0l4RxHc2vgmsNy5BvRJ7JPrJLlZwR2R2xSdsN0VGq/yULj1rO69t 0gWOBR7v9cqGKHs6bYCK6Hh/DYTJLpPpSBtriaBAxTQqEArtXjT2D75EHHMCYnoSnA/C+B 8bb+3qXTds66Tpa32rFtoIQCl4yny3A= X-MC-Unique: dTUGaC7PMOWAQImcROYCKg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] virQEMUCapsCachePriv: Add kernel command line Date: Thu, 5 Aug 2021 15:36:39 +0200 Message-Id: <20210805133640.57947-3-twiederh@redhat.com> In-Reply-To: <20210805133640.57947-1-twiederh@redhat.com> References: <20210805133640.57947-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.12 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: 1628170889106100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 21b7e8050b..c2a885351f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4096,6 +4096,7 @@ struct _virQEMUCapsCachePriv { virArch hostArch; unsigned int microcodeVersion; char *kernelVersion; + char *kernelCmdline; char *hostCPUSignature; =20 /* cache whether /dev/kvm is usable as runUid:runGuid */ @@ -4112,6 +4113,7 @@ virQEMUCapsCachePrivFree(void *privData) =20 g_free(priv->libDir); g_free(priv->kernelVersion); + g_free(priv->kernelCmdline); g_free(priv->hostCPUSignature); g_free(priv); } @@ -5649,6 +5651,9 @@ virQEMUCapsCacheNew(const char *libDir, if (uname(&uts) =3D=3D 0) priv->kernelVersion =3D g_strdup_printf("%s %s", uts.release, uts.= version); =20 + if (virFileReadValueString(&priv->kernelCmdline, "/proc/cmdline") < 0) + goto error; + cleanup: VIR_FREE(capsCacheDir); return cache; --=20 2.31.1 From nobody Mon May 6 20:27:45 2024 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=1628170951; cv=none; d=zohomail.com; s=zohoarc; b=YcdRtkONNcnpRfyxlaCGsep5urFN9xC3SvKqdTx0yMVYfHOrv9WjNUgTFX86Ll44JLjQprvDbhYbK84ITZsC4HZdjKVgWTDkh12VVn87txvCd5bfD7B1kQKxSVRF71oXLYHpwDH1bdjhzOKf18oEJUNMv+LX3iBQgC3KBHXJFfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628170951; 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=PCrK1ph+idZRO7vl+reISRyVDU2pFkM99ET7n8tDtFg=; b=F3SS2yJCZdfx1DAtDdP1GXSqOPHDgCMEZpJBULSyXFSOhTLcgoFessvlA31NnZSgMY/ukU817lZrJfOJMvmL5uEZ7FS1d5fENcFGZTrCGU4pW+ncFNZ9XvMSyqjzaZK4TiwYsEgaGdhcwuR5wXAKWPnW4IshSkLxKF4TW7rFouc= 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 1628170951120793.406002363025; Thu, 5 Aug 2021 06:42:31 -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-602-hcHT9SVeMm-v8PZ6D0OZCg-1; Thu, 05 Aug 2021 09:42:28 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4596787D542; Thu, 5 Aug 2021 13:42:23 +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 268416E6E2; Thu, 5 Aug 2021 13:42:23 +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 DBB12181A3F0; Thu, 5 Aug 2021 13:42:22 +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 175DamIe011945 for ; Thu, 5 Aug 2021 09:36:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id C7DE75C25D; Thu, 5 Aug 2021 13:36:48 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D5EA5C1A1; Thu, 5 Aug 2021 13:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628170950; 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=PCrK1ph+idZRO7vl+reISRyVDU2pFkM99ET7n8tDtFg=; b=GT9b9U2xWrXUe5My52FrZS2WvLpd7xq711jW5I9xWrB+BbAEbdSTJgk2wpvCwPg2ntgY6L k5GsQVt5H1qNtMgvaMKd9jjZAv9o+uBrz98/gvsVcJwiKvN1UxOHXsvOLNYM1kl0FLRA4D ZqsAQXx1HNL0MVVhcrRcisSQzkf23fA= X-MC-Unique: hcHT9SVeMm-v8PZ6D0OZCg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] qemu: Invalidate capabilities cache on kernel command line mismatch Date: Thu, 5 Aug 2021 15:36:40 +0200 Message-Id: <20210805133640.57947-4-twiederh@redhat.com> In-Reply-To: <20210805133640.57947-1-twiederh@redhat.com> References: <20210805133640.57947-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.11 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: 1628170952763100001 Content-Type: text/plain; charset="utf-8" See https://bugzilla.redhat.com/show_bug.cgi?id=3D1953389. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 17 ++++++++++++++--- src/qemu/qemu_capspriv.h | 3 ++- tests/qemucapsprobe.c | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c2a885351f..abf161227f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4984,6 +4984,15 @@ virQEMUCapsIsValid(void *data, return false; } =20 + if (STRNEQ_NULLABLE(priv->kernelCmdline, qemuCaps->kernelCmdline))= { + VIR_DEBUG("Outdated capabilities for '%s': kernel command line= " + "changed ('%s' vs '%s')", + qemuCaps->binary, + priv->kernelCmdline, + qemuCaps->kernelCmdline); + return false; + } + kvmSupportsNesting =3D virQEMUCapsKVMSupportsNesting(); if (kvmSupportsNesting !=3D qemuCaps->kvmSupportsNesting) { VIR_DEBUG("Outdated capabilities for '%s': kvm kernel nested " @@ -5460,7 +5469,8 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, gid_t runGid, const char *hostCPUSignature, unsigned int microcodeVersion, - const char *kernelVersion) + const char *kernelVersion, + const char *kernelCmdline) { virQEMUCaps *qemuCaps; struct stat sb; @@ -5510,7 +5520,7 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, qemuCaps->microcodeVersion =3D microcodeVersion; =20 qemuCaps->kernelVersion =3D g_strdup(kernelVersion); - qemuCaps->kernelCmdline =3D NULL; + qemuCaps->kernelCmdline =3D g_strdup(kernelCmdline); =20 qemuCaps->kvmSupportsNesting =3D virQEMUCapsKVMSupportsNesting(); =20 @@ -5537,7 +5547,8 @@ virQEMUCapsNewData(const char *binary, priv->runGid, priv->hostCPUSignature, virHostCPUGetMicrocodeVersion(p= riv->hostArch), - priv->kernelVersion); + priv->kernelVersion, + priv->kernelCmdline); } =20 =20 diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index a54a22685e..80ceb1425f 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -35,7 +35,8 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, gid_t runGid, const char *hostCPUSignature, unsigned int microcodeVersion, - const char *kernelVersion); + const char *kernelVersion, + const char *kernelCmdline); =20 int virQEMUCapsLoadCache(virArch hostArch, virQEMUCaps *qemuCaps, diff --git a/tests/qemucapsprobe.c b/tests/qemucapsprobe.c index bfa8ae8db7..76c18f0dcd 100644 --- a/tests/qemucapsprobe.c +++ b/tests/qemucapsprobe.c @@ -79,7 +79,7 @@ main(int argc, char **argv) return EXIT_FAILURE; =20 if (!(caps =3D virQEMUCapsNewForBinaryInternal(VIR_ARCH_NONE, argv[1],= "/tmp", - -1, -1, NULL, 0, NULL))) + -1, -1, NULL, 0, NULL, NU= LL))) return EXIT_FAILURE; =20 host =3D virArchFromHost(); --=20 2.31.1