From nobody Sun Feb 8 13:09:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1558079137; cv=none; d=zoho.com; s=zohoarc; b=TqaukayuMXFPeQjlDgU6NL6DRQIzMOFjKh0uHhKTMIBkJ6JH3mNwkNIKaYHIRRGySe8y69zVOuB5BT+YCAnldIOfPXk7PGM8BHayGRpGyahOpldJKGdgvrQ/Ob+B6sr7Ce98Zs+rq9uAflCBlK95C3qDfAJTfjWMwV13UaZvi3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558079137; 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:ARC-Authentication-Results; bh=MwhzwxgcU6IGSlXNAf7qkbz/WWgO8hOj/eTYXHK0T/4=; b=myW1BD1vZhVAI3BXlkoTRLSU3CXmw67DKmdhA9ul2UwuGMo+bzHtDLo6pOH5YJF+mSo9JXA1fKSvi1tuxpjlxIONifKxjEUrijHuQGdn9ijo/Jk5zpnb6vO5cklia62phV6x6GFnV0EN3VZxUQX7IDO1D8b/2Yi/CrJz52tliV0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1558079137546469.2934454825239; Fri, 17 May 2019 00:45:37 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 92E3F316D8C5; Fri, 17 May 2019 07:45:35 +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 663A334837; Fri, 17 May 2019 07:45:33 +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 283541806B14; Fri, 17 May 2019 07:45:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4H7itSG025526 for ; Fri, 17 May 2019 03:44:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 496CB5D6A9; Fri, 17 May 2019 07:44:55 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04AC35D707; Fri, 17 May 2019 07:44:53 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Fri, 17 May 2019 09:45:17 +0200 Message-Id: <1558079119-320634-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1558079119-320634-1-git-send-email-imammedo@redhat.com> References: <1558079119-320634-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, pbonzini@redhat.com, ehabkost@redhat.com Subject: [libvirt] [PATCH v3 4/6] numa: introduce "numa-mem-supported" machine property 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 17 May 2019 07:45:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" '-numa mem' option has a number of issues and mgmt often defaults to it. Unfortunately it's no possible to replace it with an alternative '-numa memdev' without breaking migration compatibility. What's possible though is to deprecate it, keeping option working with old machine types. Once deprecation period expires, QEMU will disable '-numa mem' option, usage on new machine types and when the last machine type that supported it is removed we would be able to remove '-numa mem' with associated code. In order to help mgmt to find out if being deprecated CLI option '-numa mem=3DSZ' is still supported by particular machine type, expose this information via "numa-mem-supported" machine property. Users can use "qom-list-properties" QMP command to list machine type properties including initial proprety values (when probing for supported machine types with '-machine none') or at runtime at preconfig time before numa mapping is configured and decide if they should used legacy '-numa mem' or alternative '-numa memdev' option. Signed-off-by: Igor Mammedov --- include/hw/boards.h | 1 + hw/arm/virt.c | 1 + hw/core/machine.c | 12 ++++++++++++ hw/i386/pc.c | 1 + hw/ppc/spapr.c | 1 + 5 files changed, 16 insertions(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index 6f7916f..9e347cf 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -210,6 +210,7 @@ struct MachineClass { bool ignore_boot_device_suffixes; bool smbus_no_migration_support; bool nvdimm_supported; + bool numa_mem_supported; =20 HotplugHandler *(*get_hotplug_handler)(MachineState *machine, DeviceState *dev); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 5331ab7..2e86c78 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1943,6 +1943,7 @@ static void virt_machine_class_init(ObjectClass *oc, = void *data) assert(!mc->get_hotplug_handler); mc->get_hotplug_handler =3D virt_machine_get_hotplug_handler; hc->plug =3D virt_machine_device_plug_cb; + mc->numa_mem_supported =3D true; } =20 static void virt_instance_init(Object *obj) diff --git a/hw/core/machine.c b/hw/core/machine.c index 5d046a4..8bc53ba 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -506,6 +506,13 @@ static char *machine_get_nvdimm_persistence(Object *ob= j, Error **errp) return g_strdup(ms->nvdimms_state->persistence_string); } =20 +static bool machine_get_numa_mem_supported(Object *obj, Error **errp) +{ + MachineClass *mc =3D MACHINE_GET_CLASS(obj); + + return mc->numa_mem_supported; +} + static void machine_set_nvdimm_persistence(Object *obj, const char *value, Error **errp) { @@ -810,6 +817,11 @@ static void machine_class_init(ObjectClass *oc, void *= data) &error_abort); object_class_property_set_description(oc, "memory-encryption", "Set memory encryption object to use", &error_abort); + + object_class_property_add_bool(oc, "numa-mem-supported", + machine_get_numa_mem_supported, NULL, &error_abort); + object_class_property_set_description(oc, "numa-mem-supported", + "Shows if legacy '-numa mem=3DSIZE option is supported", &error_ab= ort); } =20 static void machine_class_base_init(ObjectClass *oc, void *data) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index de91e90..bec0055 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2756,6 +2756,7 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) nc->nmi_monitor_handler =3D x86_nmi; mc->default_cpu_type =3D TARGET_DEFAULT_CPU_TYPE; mc->nvdimm_supported =3D true; + mc->numa_mem_supported =3D true; =20 object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int", pc_machine_get_device_memory_region_size, NULL, diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 2ef3ce4..265ecfb 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4336,6 +4336,7 @@ static void spapr_machine_class_init(ObjectClass *oc,= void *data) * in which LMBs are represented and hot-added */ mc->numa_mem_align_shift =3D 28; + mc->numa_mem_supported =3D true; =20 smc->default_caps.caps[SPAPR_CAP_HTM] =3D SPAPR_CAP_OFF; smc->default_caps.caps[SPAPR_CAP_VSX] =3D SPAPR_CAP_ON; --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list