From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 684CFC282DD for ; Mon, 10 Jun 2019 13:10:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 414B820679 for ; Mon, 10 Jun 2019 13:10:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 414B820679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haK4S-0004k4-7B for qemu-devel@archiver.kernel.org; Mon, 10 Jun 2019 09:10:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41253) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haK3N-0004J1-1d for qemu-devel@nongnu.org; Mon, 10 Jun 2019 09:09:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haK3K-00009z-LC for qemu-devel@nongnu.org; Mon, 10 Jun 2019 09:09:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32912) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1haK3H-00008V-OA for qemu-devel@nongnu.org; Mon, 10 Jun 2019 09:09:33 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C49AD18DF60 for ; Mon, 10 Jun 2019 13:09:25 +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 378AF5B681; Mon, 10 Jun 2019 13:09:21 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 15:10:07 +0200 Message-Id: <1560172207-378962-1-git-send-email-imammedo@redhat.com> In-Reply-To: <1559205199-233510-2-git-send-email-imammedo@redhat.com> References: <1559205199-233510-2-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 10 Jun 2019 13:09:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 1/3] machine: show if CLI option '-numa node, mem' is supported in QAPI schema X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libvir-list@redhat.com, pbonzini@redhat.com, berrange@redhat.com, ehabkost@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Legacy '-numa node,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 only. In order to help users to find out if being deprecated CLI option '-numa node,mem' is still supported by particular machine type, add new "numa-mem-supported" property to output of query-machines. "numa-mem-supported" is set to 'true' for machines that currently support NUMA, but it will be flipped to 'false' later on, once deprecation period expires and kept 'true' only for old machine types that used to support the legacy option so it won't break existing configuration that are using it. Signed-off-by: Igor Mammedov --- v5: (Markus Armbruster ) * s/by machine type/by the machine type/ * ammend commit message s/to MachineInfo description in QAPI schema/to output of query-machines/ v4: * drop idea to use "qom-list-properties" and use MachineInfo instead which could be inspected with 'query-machines' include/hw/boards.h | 3 +++ hw/arm/virt.c | 1 + hw/i386/pc.c | 1 + hw/ppc/spapr.c | 1 + qapi/misc.json | 5 ++++- vl.c | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 6ff02bf..ab6badc 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -158,6 +158,8 @@ typedef struct { * @kvm_type: * Return the type of KVM corresponding to the kvm-type string option or * computed based on other criteria such as the host kernel capabilities. + * @numa_mem_supported: + * true if '--numa node.mem' option is supported and false otherwise */ struct MachineClass { /*< private >*/ @@ -210,6 +212,7 @@ struct MachineClass { bool ignore_boot_device_suffixes; bool smbus_no_migration_support; bool nvdimm_supported; + bool numa_mem_supported; HotplugHandler *(*get_hotplug_handler)(MachineState *machine, DeviceState *dev); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index bf54f10..481a603 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 = virt_machine_get_hotplug_handler; hc->plug = virt_machine_device_plug_cb; + mc->numa_mem_supported = true; } static void virt_instance_init(Object *obj) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index edc240b..25146d7 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2750,6 +2750,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) nc->nmi_monitor_handler = x86_nmi; mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE; mc->nvdimm_supported = true; + mc->numa_mem_supported = true; 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 e2b33e5..89d5814 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4340,6 +4340,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) * in which LMBs are represented and hot-added */ mc->numa_mem_align_shift = 28; + mc->numa_mem_supported = true; smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF; smc->default_caps.caps[SPAPR_CAP_VSX] = SPAPR_CAP_ON; diff --git a/qapi/misc.json b/qapi/misc.json index 8b3ca4f..2dbfdf0 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -2018,12 +2018,15 @@ # # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0) # +# @numa-mem-supported: true if '-numa node,mem' option is supported by +# the machine type and false otherwise (since 4.1) +# # Since: 1.2.0 ## { 'struct': 'MachineInfo', 'data': { 'name': 'str', '*alias': 'str', '*is-default': 'bool', 'cpu-max': 'int', - 'hotpluggable-cpus': 'bool'} } + 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool'} } ## # @query-machines: diff --git a/vl.c b/vl.c index cd1fbc4..f5b083f 100644 --- a/vl.c +++ b/vl.c @@ -1428,6 +1428,7 @@ MachineInfoList *qmp_query_machines(Error **errp) info->name = g_strdup(mc->name); info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus; info->hotpluggable_cpus = mc->has_hotpluggable_cpus; + info->numa_mem_supported = mc->numa_mem_supported; entry = g_malloc0(sizeof(*entry)); entry->value = info; -- 2.7.4