From nobody Sat Feb 7 12:11:24 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=1633683784; cv=none; d=zohomail.com; s=zohoarc; b=dcudEwZO1jHkPqMccKK4rZSygvJKeKqu+/pqs4Baj1cGNJifm7f07AGhMkrQ9AsSFPlmO6AJVELEyzhDESs7HDFuiz+Tt3zeHmotVvpNTyLyFUbcRc4zBhqnmgU6rTJCOfIh2FK65J+EQyWNYgHtDmMrRgzXd8FVUvBIcKXWpb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633683784; h=Content-Type:Content-Transfer-Encoding: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=5YmDguSsgYoX7Yg2XOv6Qn+NpzbwBSOclTCu+YYzo6M=; b=lahb1GNmX+C2adEC8KD8nlZdWX7xYzb8c7li0udfOTxvWSaqLuGFRY/5uQnU15DRnqZn4cZX0osRKAzmqWEKuhWCJ33xrJo8ssew1yd/2tETKtT+Txm0AvolGu7f406T625uQUjdnvBhDIr48peQX/q2FE+ht3mM3RG+GgqtSQg= 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 1633683784966945.8511617830826; Fri, 8 Oct 2021 02:03:04 -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-174-Ull9eoG7PwSf6RHYGzZNHg-1; Fri, 08 Oct 2021 05:02:17 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A82A1023F53; Fri, 8 Oct 2021 09:02:12 +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 DA7D619D9F; Fri, 8 Oct 2021 09:02:11 +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 83C274EA38; Fri, 8 Oct 2021 09:02:11 +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 19891pkQ001591 for ; Fri, 8 Oct 2021 05:01:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id D67C9100AE2C; Fri, 8 Oct 2021 09:01:51 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.195.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 401CC10013C1; Fri, 8 Oct 2021 09:01:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633683784; 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=5YmDguSsgYoX7Yg2XOv6Qn+NpzbwBSOclTCu+YYzo6M=; b=MFFwgV87SlF+iIG88dhFJkfBG48PiNIU14yXxX7+UIFne7rPgNNEm11x/fDgZpqdMc22ie RvhKpDrRU8nG/yRvW8RJrj/CUhPnpIsuMIsnzMvw5np+JmqrE400y45qJ6Q07t2CKXqVvo FHVrW+EORKbsVAIbS5WOIcF8eHtfXVc= X-MC-Unique: Ull9eoG7PwSf6RHYGzZNHg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v3 2/6] qemu: always use hyphens in hyperv feature names Date: Fri, 8 Oct 2021 10:01:41 +0100 Message-Id: <20211008090145.4169737-3-berrange@redhat.com> In-Reply-To: <20211008090145.4169737-1-berrange@redhat.com> References: <20211008090145.4169737-1-berrange@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.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633683786059100001 QEMU switched from using underscores in x86 CPU features to hyphens in the 2.8.0 series with two commits commit fc7dfd205f3287893c436d932a167bffa30579c8 (HEAD, refs/bisect/bad) Author: Eduardo Habkost Date: Fri Sep 30 15:49:40 2016 -0300 target-i386: Remove underscores from feat_names arrays commit 54b8dc7c19cd781e96f1e9b001ca6001d804eb19 Author: Eduardo Habkost Date: Fri Sep 30 15:49:38 2016 -0300 target-i386: Register aliases for feature names with underscores Libvirt names use underscores so we conditionally tranlate the names when talking to new QEMU. Since the min QEMU was raised to version 2.11.0, all QEMU versions we talk to expect hypens, so the translation can be done unconditionally. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jiri Denemark --- src/qemu/qemu_command.c | 8 +------- tests/qemuxml2argvdata/hyperv.x86_64-4.0.0.args | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 28bca1519c..3b82c64e72 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6493,11 +6493,6 @@ qemuBuildCpuCommandLine(virCommand *cmd, } =20 if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_TRISTATE_SWITC= H_ON) { - const char *hvPrefix =3D "hv-"; - - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CANONICAL_CPU_FEATURES)) - hvPrefix =3D "hv_"; - for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { switch ((virDomainHyperv) i) { case VIR_DOMAIN_HYPERV_RELAXED: @@ -6513,8 +6508,7 @@ qemuBuildCpuCommandLine(virCommand *cmd, case VIR_DOMAIN_HYPERV_IPI: case VIR_DOMAIN_HYPERV_EVMCS: if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",%s%s", - hvPrefix, + virBufferAsprintf(&buf, ",hv-%s", virDomainHypervTypeToString(i)); if ((i =3D=3D VIR_DOMAIN_HYPERV_STIMER) && (def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_= ON)) diff --git a/tests/qemuxml2argvdata/hyperv.x86_64-4.0.0.args b/tests/qemuxm= l2argvdata/hyperv.x86_64-4.0.0.args index 100223b53a..32cc2fbff7 100644 --- a/tests/qemuxml2argvdata/hyperv.x86_64-4.0.0.args +++ b/tests/qemuxml2argvdata/hyperv.x86_64-4.0.0.args @@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ -machine pc-i440fx-4.0,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ --cpu 'qemu32,hv_relaxed,hv_vapic,hv-spinlocks=3D0x2fff,hv_vpindex,hv_runti= me,hv_synic,hv_stimer,hv_reset,hv-vendor-id=3DKVM Hv,hv_frequencies,hv_reen= lightenment,hv_tlbflush,hv_ipi,hv_evmcs' \ +-cpu 'qemu32,hv-relaxed,hv-vapic,hv-spinlocks=3D0x2fff,hv-vpindex,hv-runti= me,hv-synic,hv-stimer,hv-reset,hv-vendor-id=3DKVM Hv,hv-frequencies,hv-reen= lightenment,hv-tlbflush,hv-ipi,hv-evmcs' \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ --=20 2.31.1