From patchwork Mon Sep 7 12:08:07 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: 515102 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 64AD7140321 for ; Mon, 7 Sep 2015 22:08:39 +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=CXXt/ioe; dkim-atps=neutral Received: from localhost ([::1]:56261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYvDx-0002Ur-K3 for incoming@patchwork.ozlabs.org; Mon, 07 Sep 2015 08:08:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYvDR-0001bl-2b for qemu-devel@nongnu.org; Mon, 07 Sep 2015 08:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYvDP-0003fQ-Be for qemu-devel@nongnu.org; Mon, 07 Sep 2015 08:08:05 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:33843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYvDP-0003em-61 for qemu-devel@nongnu.org; Mon, 07 Sep 2015 08:08:03 -0400 Received: by wicfx3 with SMTP id fx3so86456092wic.1 for ; Mon, 07 Sep 2015 05:08:02 -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=TY0PBI/z0heMPKLC3NZu277W4ASWWy/0dIrzSbYeFkI=; b=CXXt/ioen4Mocx1WNTzRPi+9rapkLAGpa0MqJP4YMsZWCi95witERtFNO/VOVVBpYr 80zQmMDTScDZBCrBQ5rNaOxzL0qugS51qb0RAKTA6UffUyWEINrNGvrhsGAbxvaSZMwr Xuj6QQxamLPjyWgmZAEWIQM8CC5538bkA3Ug8wDGb4Gyl8Ho73nYxfhlREPw6EuT43fa vI2nE5sW6wNMX57ZHWNo7cLwx5lzRi/z0XXIVfQSUyuRjKrimMilmxzgKl6eAjgq2x06 pdCh/yZUzhni9J4KABLDFjwlPPQaWsiswmFNidzwznnbMEZV29yu6cD7+i4ou8LSBRCi tqGQ== X-Received: by 10.180.37.133 with SMTP id y5mr16838306wij.15.1441627682499; Mon, 07 Sep 2015 05:08:02 -0700 (PDT) Received: from nullptr.home.dirty-ice.org (188-143-119-255.pool.digikabel.hu. [188.143.119.255]) by smtp.gmail.com with ESMTPSA id gc8sm4806755wib.2.2015.09.07.05.08.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Sep 2015 05:08:01 -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: Mon, 7 Sep 2015 14:08:07 +0200 Message-Id: <10d59855527f68bfaa90e74ec45b0da50ce5463a.1441627175.git.DirtY.iCE.hu@gmail.com> X-Mailer: git-send-email 2.5.1 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::232 Cc: Eduardo Habkost , Markus Armbruster Subject: [Qemu-devel] [PATCH 2/7] 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 v2: * renamed NumaDriver to NumaOptionType numa.c | 4 ++-- qapi-schema.json | 47 ++++++++++++++++++++++++++++++++++++----------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/numa.c b/numa.c index 402804b..e79620f 100644 --- a/numa.c +++ b/numa.c @@ -226,8 +226,8 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) goto error; } - switch (object->kind) { - case NUMA_OPTIONS_KIND_NODE: + switch (object->type) { + 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 67fef37..9e4fe5d 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3550,17 +3550,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) @@ -3587,6 +3576,42 @@ '*memdev': 'str' }} ## +# @NumaOptionType +# +# List of possible numa drivers. +# +# Since: 2.5 +## +{ 'enum': 'NumaOptionType', + 'data': [ 'node' ] } + +## +# @NumaCommonOptions +# +# Common set of numa options. +# +# @type: the numa driver to use +# +# 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