From patchwork Thu Feb 15 00:44:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 10220173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3FCE060467 for ; Thu, 15 Feb 2018 00:46:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E3F22891A for ; Thu, 15 Feb 2018 00:46:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22E9A28A48; Thu, 15 Feb 2018 00:46:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 148612897A for ; Thu, 15 Feb 2018 00:46:54 +0000 (UTC) Received: from localhost ([::1]:48997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em7hN-0004jw-89 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Feb 2018 19:46:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em7fm-0003W7-5t for qemu-devel@nongnu.org; Wed, 14 Feb 2018 19:45:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em7fl-0005Q7-C0 for qemu-devel@nongnu.org; Wed, 14 Feb 2018 19:45:14 -0500 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:33702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1em7fg-0005K6-IJ; Wed, 14 Feb 2018 19:45:08 -0500 Received: by mail-pl0-x243.google.com with SMTP id t4so9531213plo.0; Wed, 14 Feb 2018 16:45:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=lfVkqNZ2REAyh251EMqdA7u4U95unkyfX2wwLVErNG4=; b=shcbinMeD7x9FJOlpOJA9A4Didrth7aBu2m4Pqt7tBHZR7BHkAwmEunFPqNMETBniZ GoDks65zz+6ZCSg+7ynsmuIPoEq+tNGohiUjMZdiI98BALbLxDTCfMLsmsNIhkwodrFz 2edTD4CRWnA+VquzFgoI8DgC8G/btWlIpYfqdpaEdgMRbA8QYgjr8b56K/EpTDDmmQJr Fd9jVVAnMdx3okdAdvg8yOH4SBM8oOBpPQKuQQMRUcFmnmvrOaxQPUm75fU/e1WjUNrB uMtrlPp3cLHnqgJAcO/0i9XyyxA39R9qkZbRQ8GTCzWXKMCNxBqcHyGlo9ASCQFcnI7s 8IuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lfVkqNZ2REAyh251EMqdA7u4U95unkyfX2wwLVErNG4=; b=AJcbPJFnf/0Yo6aA5QGyesJFbnOPRcwA28MTlCzDGXU5/mIdkhzt06vMXnUCZEYNXH 6Up+KeqTR/vlggtdAWcB6wnk1pC0ev+xMfZSRCoVgqHqdWITl6pnxSKvt14iPIoVWXbr Levz4XeY74BTpfWnE/j1ClwpxKOII2gQs9YSfzl584r4u3ECQjyYz1cM3DLHv/QqlJQc +6W6ExDs9TMwtq/j1gNTe6ESncvU4/02Mymiib2oGqyk3ZRZJlcovJakWEPiO7i9qiRw vgAnZ3Uh/shIJptfW8QzgniZF+6Q7AcDwvMesHE9zgcN2QmVbE4VSvuc6fgZ4gP8/dEX 7tqA== X-Gm-Message-State: APf1xPCg8QFoWoN8zYaCZ79qjwqt/6RN5jumaLCJrPo6zQdPWBISxnOc z/p9CFxghkgcHk+A+5lq9ZqUNDFd X-Google-Smtp-Source: AH8x225v2XQw4EM5e8/PWbuj9MPFIqaly0lIuoZZJNUyFrfGRYigvUCMgRpfIs0Vj1zyhuGJlrPs8A== X-Received: by 2002:a17:902:a984:: with SMTP id bh4-v6mr768800plb.95.1518655507133; Wed, 14 Feb 2018 16:45:07 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id u85sm12226660pfi.80.2018.02.14.16.45.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 16:45:06 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Thu, 15 Feb 2018 11:44:41 +1100 Message-Id: <20180215004443.18013-1-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::243 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 1/3] ppc/spapr-caps: Change migration macro to take full spapr-cap name X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aik@ozlabs.ru, qemu-devel@nongnu.org, Suraj Jitindar Singh , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change the macro that generates the vmstate migration field and the needed function for the spapr-caps to take the full spapr-cap name. This has the benefit of meaning this instance will be picked up when greping for the spapr-caps and making it more obvious what this macro is doing. Signed-off-by: Suraj Jitindar Singh --- hw/ppc/spapr_caps.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 62efdaee38..e69d308560 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -350,34 +350,34 @@ int spapr_caps_post_migration(sPAPRMachineState *spapr) } /* Used to generate the migration field and needed function for a spapr cap */ -#define SPAPR_CAP_MIG_STATE(cap, ccap) \ -static bool spapr_cap_##cap##_needed(void *opaque) \ +#define SPAPR_CAP_MIG_STATE(sname, cap) \ +static bool spapr_cap_##sname##_needed(void *opaque) \ { \ sPAPRMachineState *spapr = opaque; \ \ - return spapr->cmd_line_caps[SPAPR_CAP_##ccap] && \ - (spapr->eff.caps[SPAPR_CAP_##ccap] != \ - spapr->def.caps[SPAPR_CAP_##ccap]); \ + return spapr->cmd_line_caps[cap] && \ + (spapr->eff.caps[cap] != \ + spapr->def.caps[cap]); \ } \ \ -const VMStateDescription vmstate_spapr_cap_##cap = { \ - .name = "spapr/cap/" #cap, \ +const VMStateDescription vmstate_spapr_cap_##sname = { \ + .name = "spapr/cap/" #sname, \ .version_id = 1, \ .minimum_version_id = 1, \ - .needed = spapr_cap_##cap##_needed, \ + .needed = spapr_cap_##sname##_needed, \ .fields = (VMStateField[]) { \ - VMSTATE_UINT8(mig.caps[SPAPR_CAP_##ccap], \ + VMSTATE_UINT8(mig.caps[cap], \ sPAPRMachineState), \ VMSTATE_END_OF_LIST() \ }, \ } -SPAPR_CAP_MIG_STATE(htm, HTM); -SPAPR_CAP_MIG_STATE(vsx, VSX); -SPAPR_CAP_MIG_STATE(dfp, DFP); -SPAPR_CAP_MIG_STATE(cfpc, CFPC); -SPAPR_CAP_MIG_STATE(sbbc, SBBC); -SPAPR_CAP_MIG_STATE(ibs, IBS); +SPAPR_CAP_MIG_STATE(htm, SPAPR_CAP_HTM); +SPAPR_CAP_MIG_STATE(vsx, SPAPR_CAP_VSX); +SPAPR_CAP_MIG_STATE(dfp, SPAPR_CAP_DFP); +SPAPR_CAP_MIG_STATE(cfpc, SPAPR_CAP_CFPC); +SPAPR_CAP_MIG_STATE(sbbc, SPAPR_CAP_SBBC); +SPAPR_CAP_MIG_STATE(ibs, SPAPR_CAP_IBS); void spapr_caps_reset(sPAPRMachineState *spapr) {