From patchwork Fri Feb 26 15:17:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 8438471 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C40FB9F52D for ; Fri, 26 Feb 2016 15:27:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38C68203B1 for ; Fri, 26 Feb 2016 15:27:56 +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 8CA472024C for ; Fri, 26 Feb 2016 15:27:55 +0000 (UTC) Received: from localhost ([::1]:50494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZKJ8-0002UB-OW for patchwork-qemu-devel@patchwork.kernel.org; Fri, 26 Feb 2016 10:27:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZK9P-0002fW-B5 for qemu-devel@nongnu.org; Fri, 26 Feb 2016 10:17:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZK9J-0004Ec-LV for qemu-devel@nongnu.org; Fri, 26 Feb 2016 10:17:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZK9J-0004EW-Gr for qemu-devel@nongnu.org; Fri, 26 Feb 2016 10:17:45 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 2CDD18E69D; Fri, 26 Feb 2016 15:17:45 +0000 (UTC) Received: from localhost (ovpn-113-204.phx2.redhat.com [10.3.113.204]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1QFHhZB026252; Fri, 26 Feb 2016 10:17:44 -0500 From: Amit Shah To: Peter Maydell Date: Fri, 26 Feb 2016 20:47:30 +0530 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Juan Quintela , qemu list , Matthew.Fortune@imgtec.com, Amit Shah , den@openvz.org, richard.weiyang@gmail.com, "Dr. David Alan Gilbert" , silbe@linux.vnet.ibm.com Subject: [Qemu-devel] [PULL 1/6] 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Wei Yang 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 Message-Id: <1454626230-16334-1-git-send-email-richard.weiyang@gmail.com> Signed-off-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 94f2894..02e8487 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) {