From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54832 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PryVQ-0006V2-8t for qemu-devel@nongnu.org; Tue, 22 Feb 2011 15:06:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PryVI-0007Ii-IW for qemu-devel@nongnu.org; Tue, 22 Feb 2011 15:06:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PryVI-0007I6-9v for qemu-devel@nongnu.org; Tue, 22 Feb 2011 15:06:36 -0500 Message-Id: <20110222170115.658100551@redhat.com> Date: Tue, 22 Feb 2011 14:00:05 -0300 From: Marcelo Tosatti References: <20110222170004.808373778@redhat.com> Content-Disposition: inline; filename=1-3-add-migration-active.patch Subject: [Qemu-devel] [patch 1/3] add migration_active function List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marcelo Tosatti <"mtosa..."@redhat.com>, Jes.Sorensen@redhat.com, avi@redhat.com To query whether migration is active. Signed-off-by: Marcelo Tosatti Index: qemu/migration.c =================================================================== --- qemu.orig/migration.c +++ qemu/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/migration.h =================================================================== --- qemu.orig/migration.h +++ qemu/migration.h @@ -139,4 +139,6 @@ void add_migration_state_change_notifier void remove_migration_state_change_notifier(Notifier *notify); int get_migration_state(void); +bool migration_active(void); + #endif