From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDEF5-0005t1-1w for qemu-devel@nongnu.org; Fri, 01 Aug 2014 10:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDEF0-00048l-4i for qemu-devel@nongnu.org; Fri, 01 Aug 2014 10:55:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDEEz-00048d-SH for qemu-devel@nongnu.org; Fri, 01 Aug 2014 10:55:30 -0400 Date: Fri, 1 Aug 2014 15:55:20 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20140801145519.GD2430@work-vm> References: <1406125538-27992-1-git-send-email-yanghy@cn.fujitsu.com> <1406125538-27992-11-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406125538-27992-11-git-send-email-yanghy@cn.fujitsu.com> Subject: Re: [Qemu-devel] [RFC PATCH 10/17] COLO ctl: introduce is_slave() and is_master() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Hongyang Cc: kvm@vger.kernel.org, GuiJianfeng@cn.fujitsu.com, eddie.dong@intel.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com * Yang Hongyang (yanghy@cn.fujitsu.com) wrote: > is_slaver is to determine whether the QEMU instance is a > slaver(migration target) at runtime. > is_master is to determine whether the QEMU instance is a > master(migration starter) at runtime. > This 2 APIs will be used later. Since the names are made global in patch 15, I think it's best to do it here, but also use a more specific name for them, like colo_is_master. Dave > Signed-off-by: Yang Hongyang > --- > migration-colo.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/migration-colo.c b/migration-colo.c > index 802f8b0..2699e77 100644 > --- a/migration-colo.c > +++ b/migration-colo.c > @@ -187,6 +187,12 @@ static const QEMUFileOps colo_read_ops = { > > /* save */ > > +static __attribute__((unused)) bool is_master(void) > +{ > + MigrationState *s = migrate_get_current(); > + return (s->state == MIG_STATE_COLO); > +} > + > static void *colo_thread(void *opaque) > { > MigrationState *s = opaque; > @@ -275,6 +281,11 @@ void colo_init_checkpointer(MigrationState *s) > > static Coroutine *colo; > > +static __attribute__((unused)) bool is_slave(void) > +{ > + return colo != NULL; > +} > + > /* > * return: > * 0: start a checkpoint > -- > 1.9.1 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK