From nobody Sun Feb 8 21:41:51 2026 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=1677674124; cv=none; d=zohomail.com; s=zohoarc; b=EXiiksf4HbtlZyaZiWz2nfoIaWRTEkEK6oe+LH0jmsucivvs/p85dfSGtjtzhQvLcVfsSzTEDpRwa8C7cphWC5l15LbniJZRgFvkEUqb2PbzSt8ASSFB3O0t7hdW9ZOpSOHixS1Vd08X6QN+CQ9FN0FHKw0MwhFJpFQnwDmhofM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677674124; 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=5+vzKLw/uZrxFKVcU5RCfYDwmMW5GqX+1AnKqjIGnyA=; b=hWOaKGWSXU0fOgFrx8quUFx2dKxJeI6GOYEJInElPFjzVSz2tH9p9hv+Vdvba3/sQ+1jtf33joxSZBXSfbsPrsp4PSmBGZkSMxayeRQeBGQ+xs8ZreDLrWlYQOxki80XYRsviudhzsrCfZ71F/IgeLYtzqWzpkJj3sn9b232lJc= 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 1677674124279836.2435651040413; Wed, 1 Mar 2023 04:35:24 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-542-n6E7vNZIPI2i-Lv63-DVdg-1; Wed, 01 Mar 2023 07:35:18 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 58E7D811E6E; Wed, 1 Mar 2023 12:35:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45F982166B26; Wed, 1 Mar 2023 12:35:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5F66D1948641; Wed, 1 Mar 2023 12:34:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 69E8219465BD for ; Wed, 1 Mar 2023 12:34:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 655F5492B01; Wed, 1 Mar 2023 12:34:40 +0000 (UTC) Received: from fedora.. (unknown [10.43.2.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C4B6492B00 for ; Wed, 1 Mar 2023 12:34:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677674123; 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=5+vzKLw/uZrxFKVcU5RCfYDwmMW5GqX+1AnKqjIGnyA=; b=DnGHWME6lPOTpqmWr/hdKNKKabaNG1ZAGU/WxD+CsCqnHBxk4oNu/dAURYn/kC1EDR+nTg V/xpiXxjBOgViCaoA29AJ9vCry9oZfyB9p8cuJL4/RC8SFyWXm0ZRkQvw1euKdeLw6mu8I WrHdTBzRaMc6y3Q6GJEpXB0BVVDA0/c= X-MC-Unique: n6E7vNZIPI2i-Lv63-DVdg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] qemu: do not require bits for maxphysaddr mode emulate Date: Wed, 1 Mar 2023 13:34:34 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1677674126197100001 Make the bits attribute optional. Signed-off-by: J=C3=A1n Tomko --- docs/formatdomain.rst | 3 +- src/qemu/qemu_validate.c | 7 ----- .../cpu-phys-bits-emulate-bare.xml | 20 ++++++++++++ .../cpu-phys-bits-emulate3.err | 1 - .../cpu-phys-bits-emulate3.xml | 20 ------------ tests/qemuxml2argvtest.c | 1 - ...u-phys-bits-emulate-bare.x86_64-latest.xml | 31 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 54 insertions(+), 30 deletions(-) create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate-bare.xml delete mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate3.err delete mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate3.xml create mode 100644 tests/qemuxml2xmloutdata/cpu-phys-bits-emulate-bare.x86= _64-latest.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 29854037a9..ae482d7905 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1615,7 +1615,8 @@ In case no restrictions need to be put on CPU model a= nd its features, a simpler passed through to the virtual CPUs ``emulate`` The hypervisor will define a specific value for the number of bits - of physical addresses via the ``bits`` attribute, which is mandat= ory. + of physical addresses via the ``bits`` attribute, which is option= al + :since:`since 9.2.0` The number of bits cannot exceed the number of physical address bits supported by the hypervisor. =20 diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index c877aa73d4..59d07a53d5 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -353,13 +353,6 @@ qemuValidateDomainDefCpu(virQEMUDriver *driver, break; =20 case VIR_CPU_MAX_PHYS_ADDR_MODE_EMULATE: - if (addr->bits =3D=3D -1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("if using CPU maximum physical address mo= de=3D'%s', bits=3D must be specified too"), - virCPUMaxPhysAddrModeTypeToString(VIR_CPU_M= AX_PHYS_ADDR_MODE_EMULATE)); - return -1; - } - if (driver->hostcpu && driver->hostcpu->addr && cpu->addr->bits > driver->hostcpu->addr->bits) { diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate-bare.xml b/tests/= qemuxml2argvdata/cpu-phys-bits-emulate-bare.xml new file mode 100644 index 0000000000..30a14894dd --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate-bare.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.err b/tests/qemu= xml2argvdata/cpu-phys-bits-emulate3.err deleted file mode 100644 index 5e21998259..0000000000 --- a/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.err +++ /dev/null @@ -1 +0,0 @@ -unsupported configuration: if using CPU maximum physical address mode=3D'e= mulate', bits=3D must be specified too diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.xml b/tests/qemu= xml2argvdata/cpu-phys-bits-emulate3.xml deleted file mode 100644 index 30a14894dd..0000000000 --- a/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.xml +++ /dev/null @@ -1,20 +0,0 @@ - - foo - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - - - - destroy - restart - destroy - - - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 492f98b3f1..a7c6b1639e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2985,7 +2985,6 @@ mymain(void) DO_TEST("cpu-phys-bits-passthrough", QEMU_CAPS_KVM); DO_TEST("cpu-phys-bits-emulate", QEMU_CAPS_KVM); DO_TEST("cpu-phys-bits-emulate2", QEMU_CAPS_KVM); - DO_TEST_PARSE_ERROR("cpu-phys-bits-emulate3", QEMU_CAPS_KVM); DO_TEST_PARSE_ERROR("cpu-phys-bits-passthrough2", QEMU_CAPS_KVM); DO_TEST_CAPS_LATEST("cpu-phys-bits-limit"); =20 diff --git a/tests/qemuxml2xmloutdata/cpu-phys-bits-emulate-bare.x86_64-lat= est.xml b/tests/qemuxml2xmloutdata/cpu-phys-bits-emulate-bare.x86_64-latest= .xml new file mode 100644 index 0000000000..94b3627a46 --- /dev/null +++ b/tests/qemuxml2xmloutdata/cpu-phys-bits-emulate-bare.x86_64-latest.xml @@ -0,0 +1,31 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + +