From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Quintela Subject: Re: [PATCH 03/18] Introduce skip_header parameter to qemu_loadvm_state(). Date: Wed, 23 Feb 2011 23:00:01 +0100 Message-ID: References: <1298468927-19193-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <1298468927-19193-4-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> Reply-To: quintela@redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, kwolf@redhat.com, aliguori@us.ibm.com, mtosatti@redhat.com, ananth@in.ibm.com, mst@redhat.com, dlaor@redhat.com, vatsa@linux.vnet.ibm.com, blauwirbel@gmail.com, ohmura.kei@lab.ntt.co.jp, avi@redhat.com, pbonzini@redhat.com, psuriset@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com To: Yoshiaki Tamura Return-path: Received: from mx1.redhat.com ([209.132.183.28]:24606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753090Ab1BWWCE (ORCPT ); Wed, 23 Feb 2011 17:02:04 -0500 In-Reply-To: <1298468927-19193-4-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> (Yoshiaki Tamura's message of "Wed, 23 Feb 2011 22:48:32 +0900") Sender: kvm-owner@vger.kernel.org List-ID: Yoshiaki Tamura wrote: > Introduce skip_header parameter to qemu_loadvm_state() so that it can > be called iteratively without reading the header. > > Signed-off-by: Yoshiaki Tamura > --- > migration.c | 2 +- > savevm.c | 24 +++++++++++++----------- > sysemu.h | 2 +- > 3 files changed, 15 insertions(+), 13 deletions(-) > > diff --git a/migration.c b/migration.c > index 302b8fe..bd51fef 100644 > --- a/migration.c > +++ b/migration.c > @@ -63,7 +63,7 @@ int qemu_start_incoming_migration(const char *uri) > > void process_incoming_migration(QEMUFile *f) > { > - if (qemu_loadvm_state(f) < 0) { > + if (qemu_loadvm_state(f, 0) < 0) { > fprintf(stderr, "load of migration failed\n"); > exit(0); > } I think it would be better to just create a different function qemu_loadvm_state_internal() (better name) and that qemu_loadvm_state() just does the other tests and call qemu_loadvm_state_internal? Later, Juan. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49020 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsMmp-00073d-7J for qemu-devel@nongnu.org; Wed, 23 Feb 2011 17:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsMmQ-0007iu-Bl for qemu-devel@nongnu.org; Wed, 23 Feb 2011 17:01:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsMmP-0007in-VX for qemu-devel@nongnu.org; Wed, 23 Feb 2011 17:01:54 -0500 From: Juan Quintela In-Reply-To: <1298468927-19193-4-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> (Yoshiaki Tamura's message of "Wed, 23 Feb 2011 22:48:32 +0900") References: <1298468927-19193-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <1298468927-19193-4-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> Date: Wed, 23 Feb 2011 23:00:01 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 03/18] Introduce skip_header parameter to qemu_loadvm_state(). Reply-To: quintela@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yoshiaki Tamura Cc: kwolf@redhat.com, aliguori@us.ibm.com, dlaor@redhat.com, ananth@in.ibm.com, kvm@vger.kernel.org, mst@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org, vatsa@linux.vnet.ibm.com, blauwirbel@gmail.com, ohmura.kei@lab.ntt.co.jp, avi@redhat.com, pbonzini@redhat.com, psuriset@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com Yoshiaki Tamura wrote: > Introduce skip_header parameter to qemu_loadvm_state() so that it can > be called iteratively without reading the header. > > Signed-off-by: Yoshiaki Tamura > --- > migration.c | 2 +- > savevm.c | 24 +++++++++++++----------- > sysemu.h | 2 +- > 3 files changed, 15 insertions(+), 13 deletions(-) > > diff --git a/migration.c b/migration.c > index 302b8fe..bd51fef 100644 > --- a/migration.c > +++ b/migration.c > @@ -63,7 +63,7 @@ int qemu_start_incoming_migration(const char *uri) > > void process_incoming_migration(QEMUFile *f) > { > - if (qemu_loadvm_state(f) < 0) { > + if (qemu_loadvm_state(f, 0) < 0) { > fprintf(stderr, "load of migration failed\n"); > exit(0); > } I think it would be better to just create a different function qemu_loadvm_state_internal() (better name) and that qemu_loadvm_state() just does the other tests and call qemu_loadvm_state_internal? Later, Juan.