From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPFxQ-0008MW-1s for qemu-devel@nongnu.org; Sat, 12 Nov 2011 10:57:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPFxJ-00079I-3W for qemu-devel@nongnu.org; Sat, 12 Nov 2011 10:57:22 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:42187 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPFxI-00078y-CM for qemu-devel@nongnu.org; Sat, 12 Nov 2011 10:57:20 -0500 From: Anthony Liguori Date: Sat, 12 Nov 2011 09:56:57 -0600 Message-Id: <1321113420-3252-4-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1321113420-3252-1-git-send-email-aliguori@us.ibm.com> References: <1321113420-3252-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 4/7] qed: add migration blocker List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Lucas Meneghel Rodrigues , Anthony Liguori , Stefan Hajnoczi , Juan Quintela , Avi Kivity Now when you try to migrate with qed, you get: (qemu) migrate tcp:localhost:1025 Block format 'qed' used by device 'ide0-hd0' does not support feature 'live migration' (qemu) Signed-off-by: Anthony Liguori --- block/qed.c | 10 ++++++++++ block/qed.h | 2 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/block/qed.c b/block/qed.c index d032a45..7e22e77 100644 --- a/block/qed.c +++ b/block/qed.c @@ -16,6 +16,7 @@ #include "trace.h" #include "qed.h" #include "qerror.h" +#include "migration.h" static void qed_aio_cancel(BlockDriverAIOCB *blockacb) { @@ -504,6 +505,12 @@ static int bdrv_qed_open(BlockDriverState *bs, int flags) s->need_check_timer = qemu_new_timer_ns(vm_clock, qed_need_check_timer_cb, s); + error_set(&s->migration_blocker, + QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, + "qed", bs->device_name, "live migration"); + migrate_add_blocker(s->migration_blocker); + + out: if (ret) { qed_free_l2_cache(&s->l2_cache); @@ -516,6 +523,9 @@ static void bdrv_qed_close(BlockDriverState *bs) { BDRVQEDState *s = bs->opaque; + migrate_del_blocker(s->migration_blocker); + error_free(s->migration_blocker); + qed_cancel_need_check_timer(s); qemu_free_timer(s->need_check_timer); diff --git a/block/qed.h b/block/qed.h index 388fdb3..62cbd3b 100644 --- a/block/qed.h +++ b/block/qed.h @@ -164,6 +164,8 @@ typedef struct { /* Periodic flush and clear need check flag */ QEMUTimer *need_check_timer; + + Error *migration_blocker; } BDRVQEDState; enum { -- 1.7.4.1