From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Wei Yang Date: Thu, 4 Feb 2016 22:50:30 +0000 Message-Id: <1454626230-16334-1-git-send-email-richard.weiyang@gmail.com> Subject: [Qemu-devel] [PATCH] migration: reorder code to make it symmetric List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com, amit.shah@redhat.com Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, 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 --- 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) { -- 1.7.9.5