From patchwork Thu Feb 4 22:50:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 8228661 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB843BEEE5 for ; Thu, 4 Feb 2016 22:51:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13AE62039D for ; Thu, 4 Feb 2016 22:51:07 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 6E71A2039C for ; Thu, 4 Feb 2016 22:51:06 +0000 (UTC) Received: from localhost ([::1]:44633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRSjx-0000Y2-Gt for patchwork-qemu-devel@patchwork.kernel.org; Thu, 04 Feb 2016 17:51:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRSjp-0000Vd-Oh for qemu-devel@nongnu.org; Thu, 04 Feb 2016 17:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRSjo-0001Uc-S7 for qemu-devel@nongnu.org; Thu, 04 Feb 2016 17:50:57 -0500 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]:35160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRSjk-0001UJ-FV; Thu, 04 Feb 2016 17:50:52 -0500 Received: by mail-pa0-x234.google.com with SMTP id ho8so22767087pac.2; Thu, 04 Feb 2016 14:50:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Rh8HrFcbCoLGRAZwdRs22RgvoLUN4xlaPKgked2+8qs=; b=o3roZYzhHVx91R3897v3zDBZV7ioiSSge7xeslN9rV+1HPlhqm5hmH3et/abmPtlKu hqpUebNpiSFouk7rVtmhp6bds6rB/1Rz3IUscbDE6JOBd7blSdaGhhXGS1JijMtvO7xR RlIN66VmTPLLbrw8bUjrFEDQyKKCFZtf58+a/yMqYkZJ+ThXBdeN40uR9dqUQXPhBBbu bJg14DnmPawfVKqbqwDpIvKcxu7OnI5O2KwIP17ComfbMK4xgVXK1fAGBk5zTNYXalh1 ZcVBHE+OVt++KO7EDDNS5A79kOJAIKeuhbQ8mM0uoTz1Kj+UcatNHBnZflX7KIxfYBoM ZwyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Rh8HrFcbCoLGRAZwdRs22RgvoLUN4xlaPKgked2+8qs=; b=M9WqAi0BU23c4P722jgJ/mMBu2V9Nu6hsRA+wMtItF0nZ1jLnj30oQVUe6R1UC1x0P 2apxzHHBjcuMYEyjDw+lR3ddv9uR/TXXu1WglB458XAuJudIDYmzkHnz2v7KosrHuJoe frLhyik3EkpQWBto9Io5gpNsgLxlkQ/okFuJvL4QNARKFNN6bHpKjZcGGbfvc4rg9h1H 3UqUgBcwy9ioZPyBjIhu0QejWQZm3C44aCQxgGebERFnsCfp7Jah1e05E9mTEk497/g0 N/+qFNkXn08LbAjKDM1AXrg64uib7ANqS0glLHs7LydSTYs7EGUMt5CGljyv8w9AWd/1 jXyw== X-Gm-Message-State: AG10YOTXEnyq3AjsFwC+21z+AIhvdMyh6NztGva7a0kLkAzZuRW17cWtkSUCIN/hKGV7KQ== X-Received: by 10.67.14.168 with SMTP id fh8mr14979504pad.11.1454626251203; Thu, 04 Feb 2016 14:50:51 -0800 (PST) Received: from localhost ([45.32.44.20]) by smtp.gmail.com with ESMTPSA id p9sm19550565pfa.11.2016.02.04.14.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Feb 2016 14:50:50 -0800 (PST) From: Wei Yang To: quintela@redhat.com, amit.shah@redhat.com Date: Thu, 4 Feb 2016 22:50:30 +0000 Message-Id: <1454626230-16334-1-git-send-email-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::234 Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, Wei Yang Subject: [Qemu-devel] [PATCH] migration: reorder code to make it symmetric 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In qemu_savevm_state_complete_precopy(), it iterates on each device to add a json object and transfer related status to destination, while the order of the last two steps could be refined. Current order: json_start_object() save_section_header() vmstate_save() json_end_object() save_section_footer() After the change: json_start_object() save_section_header() vmstate_save() save_section_footer() json_end_object() This patch reorder the code to to make it symmetric. No functional change. Signed-off-by: Wei Yang Reviewed-by: Amit Shah --- migration/savevm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index b9caf59..42bfab4 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1088,12 +1088,11 @@ void qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only) json_prop_int(vmdesc, "instance_id", se->instance_id); save_section_header(f, se, QEMU_VM_SECTION_FULL); - vmstate_save(f, se, vmdesc); - - json_end_object(vmdesc); trace_savevm_section_end(se->idstr, se->section_id, 0); save_section_footer(f, se); + + json_end_object(vmdesc); } if (!in_postcopy) {