From nobody Tue Feb 10 07:41:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580488828708255.9619668166216; Fri, 31 Jan 2020 08:40:28 -0800 (PST) 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-133-qy2ywIM5PI-VtuGUOWSBug-1; Fri, 31 Jan 2020 11:40:25 -0500 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 30AD31089561; Fri, 31 Jan 2020 16:40:18 +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 0B036100EBA8; Fri, 31 Jan 2020 16:40:18 +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 BC3A318089C8; Fri, 31 Jan 2020 16:40:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00VGe1uO024306 for ; Fri, 31 Jan 2020 11:40:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6875D100EBA8; Fri, 31 Jan 2020 16:40:01 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.43.2.246]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E40B41001925 for ; Fri, 31 Jan 2020 16:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580488827; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=d5MAUORSvuijvj3z7d7gKiQMUTBslzit72f7004Tu+E=; b=N6bc2Eipn8hk6MFUv21G9ObzaMARKiR6rXEVOgdAJZoiaDQTNxNNZ1q7H05yx2UQf+x8c4 6up2ydvXLstKh4R5nKpGWzrHkq3K74vQjFjQF4nxHEH+4vjnHGvk7M4m1WOI4FzO6o8gF6 PNbryABBggO/1IUlD2mgUQPA5KRBK4Q= From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] qemu: Validate the kvm-no-adjvtime CPU feature Date: Fri, 31 Jan 2020 17:39:51 +0100 Message-Id: <20200131163952.525863-5-abologna@redhat.com> In-Reply-To: <20200131163952.525863-1-abologna@redhat.com> References: <20200131163952.525863-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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 X-MC-Unique: qy2ywIM5PI-VtuGUOWSBug-1 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" Error out if the QEMU binary doesn't support it. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d3045b4bcd..8b0c91d6c1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4625,7 +4625,8 @@ qemuDomainDefSetDefaultCPU(virDomainDefPtr def, =20 =20 static int -qemuDomainDefCPUPostParse(virDomainDefPtr def) +qemuDomainDefCPUPostParse(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) { virCPUFeatureDefPtr sveFeature =3D NULL; bool sveVectorLengthsProvided =3D false; @@ -4696,6 +4697,15 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def) } else if (STRPREFIX(feature->name, "sve")) { sveVectorLengthsProvided =3D true; } + + if (STREQ(feature->name, "kvm-no-adjvtime") && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_KVM_NO_ADJVTIME)) + { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is not supported by this " + "QEMU binary"), feature->name); + return -1; + } } =20 if (sveVectorLengthsProvided) { @@ -4858,7 +4868,7 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuDomainDefVcpusPostParse(def) < 0) return -1; =20 - if (qemuDomainDefCPUPostParse(def) < 0) + if (qemuDomainDefCPUPostParse(def, qemuCaps) < 0) return -1; =20 if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0) --=20 2.24.1