From nobody Mon Feb 9 16:17:01 2026 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