From patchwork Wed Sep 23 14:27:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?B?Wm9sdMOhbiBLxZF2w6Fnw7M=?= X-Patchwork-Id: 521714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 160531401AF for ; Thu, 24 Sep 2015 00:27:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=M4RK2PcQ; dkim-atps=neutral Received: from localhost ([::1]:48143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zel1G-0003MO-J3 for incoming@patchwork.ozlabs.org; Wed, 23 Sep 2015 10:27:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zel0Z-00025c-7P for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:26:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zel0W-0005u9-Ic for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:26:54 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:38349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zel0W-0005tp-6x for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:26:52 -0400 Received: by wiclk2 with SMTP id lk2so71996087wic.1 for ; Wed, 23 Sep 2015 07:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=FTgE5kSb1OyuWNT7R8y5KBBezYV+Dbe8A6qi3n1OpCk=; b=M4RK2PcQSFkdVZxVXJfavhXiDMhCc5GXBpJJHqKCxzYWgzwputXGoqCy10ikAMVkli 7hED3K9MZ8QnuJWC+FAi97ti+F8G73MaMNEssq/xZ703UFFebYSNXF85VaFQAV8m9k2P GPh84vmMaH85F1T3oTNcvUQbjnytPYDKAx21jqxObiCUp+zZIPJZJqcIwVQLB3HdpDJJ i6SMnxfXvDxvDJq77M99+0kWb/6SuNB19OGbBK6LdczuQDNVw2Z3jkStb1nJFV5szmin zLLCAm48pLiofu/mtZkTvkMd3fsQ0cj2wCebMGwPg99XxEEMbz2RNlY8XmvScjH8xBsd F/kQ== X-Received: by 10.194.111.232 with SMTP id il8mr36462867wjb.117.1443018411659; Wed, 23 Sep 2015 07:26:51 -0700 (PDT) Received: from nullptr.home.dirty-ice.org (94-21-30-197.pool.digikabel.hu. [94.21.30.197]) by smtp.gmail.com with ESMTPSA id fv13sm662088wic.7.2015.09.23.07.26.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Sep 2015 07:26:50 -0700 (PDT) From: "=?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?=" X-Google-Original-From: =?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?= To: qemu-devel@nongnu.org Date: Wed, 23 Sep 2015 16:27:34 +0200 Message-Id: <7567ba6259b039b5d89faf658c8f52d500e2595c.1443017811.git.DirtY.iCE.hu@gmail.com> X-Mailer: git-send-email 2.5.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::230 Cc: Eduardo Habkost , Markus Armbruster Subject: [Qemu-devel] [PATCH v2 1/3] qapi: convert NumaOptions into a flat union X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Changes the NumaOptions to flat union from a simple one. This is required by my later OptsVisitor patch to preserve backward compatibility. Strictly speaking this would break QMP compatibility (as specified in docs/qapi-code-gen.txt), but since no QMP command use this structure, it's not an issue. The -numa option syntax doesn't change. There are some changes in the C api, but this patch fixes them. Signed-off-by: Kővágó, Zoltán Reviewed-by: Eric Blake --- Changes from v1: * fixed documentation numa.c | 2 +- qapi-schema.json | 49 ++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/numa.c b/numa.c index 16a8c41..9cd0c84 100644 --- a/numa.c +++ b/numa.c @@ -227,7 +227,7 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) } switch (object->type) { - case NUMA_OPTIONS_KIND_NODE: + case NUMA_OPTION_TYPE_NODE: numa_node_parse(object->node, opts, &err); if (err) { goto error; diff --git a/qapi-schema.json b/qapi-schema.json index 263053d..72827f8 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3573,17 +3573,6 @@ 'data': { '*console':'int', 'events': [ 'InputEvent' ] } } ## -# @NumaOptions -# -# A discriminated record of NUMA options. (for OptsVisitor) -# -# Since 2.1 -## -{ 'union': 'NumaOptions', - 'data': { - 'node': 'NumaNodeOptions' }} - -## # @NumaNodeOptions # # Create a guest NUMA node. (for OptsVisitor) @@ -3610,6 +3599,44 @@ '*memdev': 'str' }} ## +# @NumaOptionType +# +# NUMA command-line option type. +# +# @node: Create a guest NUMA node. See @NumaNodeOptions. +# +# Since: 2.5 +## +{ 'enum': 'NumaOptionType', + 'data': [ 'node' ] } + +## +# @NumaCommonOptions +# +# Common set of numa options. +# +# @type: NUMA command-line option type. +# +# Since: 2.5 +## +{ 'struct': 'NumaCommonOptions', + 'data': { + 'type': 'NumaOptionType' } } + +## +# @NumaOptions +# +# A discriminated record of NUMA options. (for OptsVisitor) +# +# Since 2.1 +## +{ 'union': 'NumaOptions', + 'base': 'NumaCommonOptions', + 'discriminator': 'type', + 'data': { + 'node': 'NumaNodeOptions' }} + +## # @HostMemPolicy # # Host memory policy types