From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOclw-0005j1-L8 for qemu-devel@nongnu.org; Mon, 23 May 2011 17:34:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOclu-0001s5-4d for qemu-devel@nongnu.org; Mon, 23 May 2011 17:34:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOclt-0001rO-L9 for qemu-devel@nongnu.org; Mon, 23 May 2011 17:34:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4NLYfvl021684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 May 2011 17:34:41 -0400 Message-Id: <20110523213410.673809978@amt.cnet> Date: Mon, 23 May 2011 18:31:16 -0300 From: Marcelo Tosatti References: <20110523213115.164535428@amt.cnet> Content-Disposition: inline; filename=1-3-add-migration-active.patch Subject: [Qemu-devel] [patch 1/7] add migration_active function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com, dlaor@redhat.com, avi@redhat.com, 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; +} Index: qemu-block-copy/migration.h =================================================================== --- qemu-block-copy.orig/migration.h +++ qemu-block-copy/migration.h @@ -148,4 +148,6 @@ int ram_load(QEMUFile *f, void *opaque, extern int incoming_expected; +bool migration_active(void); + #endif