From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ11H-00080D-8M for qemu-devel@nongnu.org; Fri, 27 May 2011 13:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQ11G-000730-AA for qemu-devel@nongnu.org; Fri, 27 May 2011 13:40:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ11G-00072w-2m for qemu-devel@nongnu.org; Fri, 27 May 2011 13:40:18 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4RHeHO8018424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 27 May 2011 13:40:17 -0400 Message-ID: <4DDFE2AA.6070800@redhat.com> Date: Fri, 27 May 2011 19:43:06 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <20110523213115.164535428@amt.cnet> <20110523213410.673809978@amt.cnet> In-Reply-To: <20110523213410.673809978@amt.cnet> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [patch 1/7] add migration_active function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Jes.Sorensen@redhat.com, dlaor@redhat.com, qemu-devel@nongnu.org, avi@redhat.com Am 23.05.2011 23:31, schrieb Marcelo Tosatti: > To query whether migration is active. > > Signed-off-by: Marcelo Tosatti > > Index: qemu-block-copy/migration.c > =================================================================== > --- qemu-block-copy.orig/migration.c > +++ qemu-block-copy/migration.c > @@ -480,3 +480,13 @@ int get_migration_state(void) > return MIG_STATE_ERROR; > } > } > + > +bool migration_active(void) > +{ > + if (current_migration && > + current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) { > + return true; > + } > + > + return false; > +} The very same check already exists open-coded in do_migrate(). Maybe we should convert it now that a function is available for it? Kevin