From patchwork Fri Feb 26 09:55:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 588741 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 AB4531402BC for ; Fri, 26 Feb 2016 20:56:26 +1100 (AEDT) Received: from localhost ([::1]:48481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZF8K-0001zh-Ka for incoming@patchwork.ozlabs.org; Fri, 26 Feb 2016 04:56:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZF7u-0001Gu-LG for qemu-devel@nongnu.org; Fri, 26 Feb 2016 04:55:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZF7t-0002L4-NE for qemu-devel@nongnu.org; Fri, 26 Feb 2016 04:55:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZF7t-0002Kz-I4 for qemu-devel@nongnu.org; Fri, 26 Feb 2016 04:55:57 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id F30D064447; Fri, 26 Feb 2016 09:55:56 +0000 (UTC) Received: from localhost (ovpn-113-33.phx2.redhat.com [10.3.113.33]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1Q9ttF5002540; Fri, 26 Feb 2016 04:55:56 -0500 From: Amit Shah To: Peter Maydell Date: Fri, 26 Feb 2016 15:25:40 +0530 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 26 Feb 2016 09:55:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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) {