[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] qed: add migration blocker
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 4/4] qed: add migration blocker |
Date: |
Fri, 11 Nov 2011 14:29:38 -0600 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH 1/4] migrate: add migration blockers, Anthony Liguori, 2011/11/11
- [Qemu-devel] [PATCH 4/4] qed: add migration blocker,
Anthony Liguori <=
- [Qemu-devel] [PATCH 2/4] ivshmem: use migration blockers to prevent live migration in peer mode, Anthony Liguori, 2011/11/11
- [Qemu-devel] [PATCH 3/4] qcow2: add a migration blocker, Anthony Liguori, 2011/11/11
- Re: [Qemu-devel] [PATCH 3/4] qcow2: add a migration blocker, Stefan Hajnoczi, 2011/11/14
- Re: [Qemu-devel] [PATCH 3/4] qcow2: add a migration blocker, Anthony Liguori, 2011/11/14
- Re: [Qemu-devel] [PATCH 3/4] qcow2: add a migration blocker, Kevin Wolf, 2011/11/14
- Re: [Qemu-devel] [PATCH 3/4] qcow2: add a migration blocker, Stefan Hajnoczi, 2011/11/14
- Re: [Qemu-devel] [PATCH 3/4] qcow2: add a migration blocker, Anthony Liguori, 2011/11/14
- Re: [Qemu-devel] [PATCH 3/4] qcow2: add a migration blocker, Stefan Hajnoczi, 2011/11/14