Skip to contentSkip to conversation

make qed and live migration usage safe

RFC PATCH Superseded Benoît Canet 2 participants 18 messages Mar 6, 2012 – Mar 20, 2012 Block layer

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover make qed and live migration usage safe

QED + live migration is an unsafe and disabled mix.

This patchset make qed and live migration safe to use.

The check of QED images is delayed during the incoming migration. After the migration complete the QED images are checked.

Benoît Canet (10):
block: Add new BDRV_O_INCOMING flag to notice incoming live migration
block: add a function to set incoming live migration
block: add a function to clear incoming live migration
block: rename *_invalidate_cache_* to *_post_incoming_migration_*
migration: inform the block layer of incoming live status
block: open images with BDRV_O_INCOMING on incoming live migration
qed: extract image checking into check_image_if_needed
qed: add bdrv_post_incoming_migration operation checking the image
qed: honor BDRV_O_INCOMING for incoming live migration
qed: remove incoming live migration blocker

 block.c       |   35 +++++++++++++++++++++---
 block.h       |   13 +++++++--
 block/qcow2.c |    7 ++++-
 block/qed.c   |   81 +++++++++++++++++++++++++++++++++++----------------------
 block/qed.h   |    2 -
 block_int.h   |    4 +-
 migration.c   |    9 +++++-
 vl.c          |    5 +++
 8 files changed, 110 insertions(+), 46 deletions(-)
Signature · 1 line
1.7.7.6
#1 lore raw

RFC PATCH 1/10 block: Add new BDRV_O_INCOMING flag to notice incoming live migration

Quoted 1 line

From original patch with Patchwork-id: 31110 by

Stefan Hajnoczi <[email protected]>

"Add a flag to indicate that incoming migration is pending and care needs to be taken for data consistency. Block drivers should not modify the image file before incoming migration is complete since the migration source host is still using the image file."

The rationale for not using bdrv->read_only is the following.

"Unfortunately this is not possible because too many other places in QEMU test bdrv_is_read_only() and use it for their own evil purposes. For example, ide_init_drive() will error out because read-only harddisks are not supported. We're mixing guest and host side read-only concepts so this simpler alternative does not work."

---
 block.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
block.h +1 -0
index 48d0bf3..e320d8f 100644
@@ -71,6 +71,7 @@ typedef struct BlockDevOps {
 #define BDRV_O_NO_BACKING  0x0100 /* don't open the backing file */
 #define BDRV_O_NO_FLUSH    0x0200 /* disable flushing on this disk */
 #define BDRV_O_COPY_ON_READ 0x0400 /* copy read backing sectors into image */
+#define BDRV_O_INCOMING    0x0800  /* consistency hint for incoming migration */
 
 #define BDRV_O_CACHE_MASK  (BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH)
 
Signature · 1 line
1.7.7.6
#2 lore raw

RFC PATCH 2/10 block: add a function to set incoming live migration

In reply to Benoît Canet

This function will help to inform the block layer that an incoming live migration is coming in order to make proper usage of the BDRV_O_INCOMING flag.

---
 block.c |    8 ++++++++
 block.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)
block.c +8 -0
index 52ffe14..3e2260d 100644
@@ -100,6 +100,8 @@ static BlockDriverState *bs_snapshots;
 /* If non-zero, use only whitelisted block drivers */
 static int use_bdrv_whitelist;
 
+static bool incoming_migration;
+
 #ifdef _WIN32
 static int is_windows_drive_prefix(const char *filename)
 {
@@ -3580,6 +3582,12 @@ void bdrv_invalidate_cache_all(void)
     }
 }
 
+void bdrv_set_incoming_migration(void)
+{
+    assert(incoming_migration == false);
+    incoming_migration = true;
+}
+
 int bdrv_flush(BlockDriverState *bs)
 {
     Coroutine *co;
block.h +2 -0
index e320d8f..23af1cc 100644
@@ -223,6 +223,8 @@ BlockDriverAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
 void bdrv_invalidate_cache(BlockDriverState *bs);
 void bdrv_invalidate_cache_all(void);
 
+void bdrv_set_incoming_migration(void);
+
 /* Ensure contents are flushed to disk.  */
 int bdrv_flush(BlockDriverState *bs);
 int coroutine_fn bdrv_co_flush(BlockDriverState *bs);
Signature · 1 line
1.7.7.6
#3 lore raw

Re: [Qemu-devel] [RFC PATCH 02/10] block: add a function to set incoming live migration

Quoted 9 lines · Benoît Canet

This function will help to inform the block layer that an incoming live migration is coming in order to make proper usage of the BDRV_O_INCOMING flag.

---
 block.c |    8 ++++++++
 block.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

The block layer doesn't need to keep track of incoming migrations:

blockdev.c:drive_init() or vl.c:drive_init_func() could use runstate_check(RUN_STATE_INMIGRATE) to check whether incoming migration is in progress. If so, they would pass in BDRV_O_INCOMING during image creation. As a result we don't need to introduce this global variable or functions to manipulate it in the block layer.

The block layer post migration function will still need to clear BDRV_O_INCOMING from open_flags.

Stefan

#4 lore raw

RFC PATCH 3/10 block: add a function to clear incoming live migration

In reply to Benoît Canet

This function is to be called to inform the block layer that an incoming live migration has been canceled or has just finished. It will also clear all BDRV_O_INCOMING flags.

---
 block.c |   13 +++++++++++++
 block.h |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)
block.c +13 -0
index 3e2260d..889d464 100644
@@ -3588,6 +3588,19 @@ void bdrv_set_incoming_migration(void)
     incoming_migration = true;
 }
 
+void bdrv_clear_incoming_migration_all(void)
+{
+    BlockDriverState *bs;
+
+    assert(incoming_migration == true);
+
+    incoming_migration = false;
+
+    QTAILQ_FOREACH(bs, &bdrv_states, list) {
+        bs->open_flags = bs->open_flags & ~(BDRV_O_INCOMING);
+    }
+}
+
 int bdrv_flush(BlockDriverState *bs)
 {
     Coroutine *co;
block.h +1 -0
index 23af1cc..2ddf9c5 100644
@@ -224,6 +224,7 @@ void bdrv_invalidate_cache(BlockDriverState *bs);
 void bdrv_invalidate_cache_all(void);
 
 void bdrv_set_incoming_migration(void);
+void bdrv_clear_incoming_migration_all(void);
 
 /* Ensure contents are flushed to disk.  */
 int bdrv_flush(BlockDriverState *bs);
Signature · 1 line
1.7.7.6
#5 lore raw

RFC PATCH 4/10 block: rename *_invalidate_cache_* to *_post_incoming_migration_*

In reply to Benoît Canet

This patch will allow to do a post incoming live migration check on QED images and keep invalidating caches on qcow2 images.

---
 block.c       |   10 +++++-----
 block.h       |    8 +++++---
 block/qcow2.c |    7 ++++++-
 block_int.h   |    4 ++--
 migration.c   |    6 ++++--
 5 files changed, 22 insertions(+), 13 deletions(-)
block.c +5 -5
index 889d464..b0f0288 100644
@@ -3566,19 +3566,19 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
     }
 }
 
-void bdrv_invalidate_cache(BlockDriverState *bs)
+void bdrv_post_incoming_migration(BlockDriverState *bs)
 {
-    if (bs->drv && bs->drv->bdrv_invalidate_cache) {
-        bs->drv->bdrv_invalidate_cache(bs);
+    if (bs->drv && bs->drv->bdrv_post_incoming_migration) {
+        bs->drv->bdrv_post_incoming_migration(bs);
     }
 }
 
-void bdrv_invalidate_cache_all(void)
+void bdrv_post_incoming_migration_all(void)
 {
     BlockDriverState *bs;
 
     QTAILQ_FOREACH(bs, &bdrv_states, list) {
-        bdrv_invalidate_cache(bs);
+        bdrv_post_incoming_migration(bs);
     }
 }
 
block.h +5 -3
index 2ddf9c5..1323086 100644
@@ -219,9 +219,11 @@ BlockDriverAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
         unsigned long int req, void *buf,
         BlockDriverCompletionFunc *cb, void *opaque);
 
-/* Invalidate any cached metadata used by image formats */
-void bdrv_invalidate_cache(BlockDriverState *bs);
-void bdrv_invalidate_cache_all(void);
+/* Do post incoming migration operations
+ * Ex: flush mutable metadata
+ */
+void bdrv_post_incoming_migration(BlockDriverState *bs);
+void bdrv_post_incoming_migration_all(void);
 
 void bdrv_set_incoming_migration(void);
 void bdrv_clear_incoming_migration_all(void);
block/qcow2.c +6 -1
index eb5ea48..bbe6032 100644
@@ -700,6 +700,11 @@ static void qcow2_invalidate_cache(BlockDriverState *bs)
     }
 }
 
+static void qcow2_post_incoming_migration(BlockDriverState *bs)
+{
+    qcow2_invalidate_cache(bs);
+}
+
 static size_t header_ext_add(char *buf, uint32_t magic, const void *s,
     size_t len, size_t buflen)
 {
@@ -1383,7 +1388,7 @@ static BlockDriver bdrv_qcow2 = {
 
     .bdrv_change_backing_file   = qcow2_change_backing_file,
 
-    .bdrv_invalidate_cache      = qcow2_invalidate_cache,
+    .bdrv_post_incoming_migration = qcow2_post_incoming_migration,
 
     .create_options = qcow2_create_options,
     .bdrv_check = qcow2_check,
block_int.h +2 -2
index b460c36..e68d42e 100644
@@ -145,9 +145,9 @@ struct BlockDriver {
         int64_t sector_num, int nb_sectors, int *pnum);
 
     /*
-     * Invalidate any cached meta-data.
+     * Do the post incoming migration processing
      */
-    void (*bdrv_invalidate_cache)(BlockDriverState *bs);
+    void (*bdrv_post_incoming_migration)(BlockDriverState *bs);
 
     /*
      * Flushes all data that was already written to the OS all the way down to
migration.c +4 -2
index 00fa1e3..45af364 100644
@@ -91,8 +91,10 @@ void process_incoming_migration(QEMUFile *f)
     qemu_announce_self();
     DPRINTF("successfully loaded vm state\n");
 
-    /* Make sure all file formats flush their mutable metadata */
-    bdrv_invalidate_cache_all();
+    /* Execute post incoming migration operations :
+     * for qcow2 make sure to flush mutable metadata
+     **/
+    bdrv_post_incoming_migration_all();
 
     if (autostart) {
         vm_start();
Signature · 1 line
1.7.7.6
#6 lore raw

RFC PATCH 5/10 migration: inform the block layer of incoming live status

In reply to Benoît Canet
---
 migration.c |    2 ++
 vl.c        |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)
migration.c +2 -0
index 45af364..5ac31a3 100644
@@ -76,6 +76,7 @@ int qemu_start_incoming_migration(const char *uri)
         ret = fd_start_incoming_migration(p);
 #endif
     else {
+        bdrv_clear_incoming_migration_all();
         fprintf(stderr, "unknown migration protocol: %s\n", uri);
         ret = -EPROTONOSUPPORT;
     }
@@ -91,6 +92,7 @@ void process_incoming_migration(QEMUFile *f)
     qemu_announce_self();
     DPRINTF("successfully loaded vm state\n");
 
+    bdrv_clear_incoming_migration_all();
     /* Execute post incoming migration operations :
      * for qcow2 make sure to flush mutable metadata
      **/
vl.c +5 -0
index 97ab2b9..b1d3dd2 100644
@@ -3389,6 +3389,11 @@ int main(int argc, char **argv, char **envp)
 
     blk_mig_init();
 
+    /* make the block layer ready for incoming live migration */
+    if (incoming) {
+        bdrv_set_incoming_migration();
+    }
+
     /* open the virtual block devices */
     if (snapshot)
         qemu_opts_foreach(qemu_find_opts("drive"), drive_enable_snapshot, NULL, 0);
Signature · 1 line
1.7.7.6
#7 lore raw

RFC PATCH 6/10 block: open images with BDRV_O_INCOMING on incoming live migration

In reply to Benoît Canet

Open images with BDRV_O_INCOMING in order to inform block drivers that an incoming live migration is coming.

---
 block.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
block.c +4 -0
index b0f0288..78287df 100644
@@ -575,6 +575,10 @@ static int bdrv_open_common(BlockDriverState *bs, const char *filename,
 
     trace_bdrv_open_common(bs, filename, flags, drv->format_name);
 
+    if (incoming_migration) {
+        flags |= BDRV_O_INCOMING;
+    }
+
     bs->file = NULL;
     bs->total_sectors = 0;
     bs->encrypted = 0;
Signature · 1 line
1.7.7.6
#8 lore raw

RFC PATCH 7/10 qed: extract image checking into check_image_if_needed

In reply to Benoît Canet
---
 block/qed.c |   55 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 21 deletions(-)
block/qed.c +34 -21
index a041d31..25558fc 100644
@@ -367,6 +367,37 @@ static void qed_cancel_need_check_timer(BDRVQEDState *s)
     qemu_del_timer(s->need_check_timer);
 }
 
+static int check_image_if_needed(BlockDriverState *bs)
+{
+    int ret;
+    BDRVQEDState *s = bs->opaque;
+
+    if (s->header.features & QED_F_NEED_CHECK) {
+        /* Read-only images cannot be fixed.  There is no risk of corruption
+         * since write operations are not possible.  Therefore, allow
+         * potentially inconsistent images to be opened read-only.  This can
+         * aid data recovery from an otherwise inconsistent image.
+         */
+        if (!bdrv_is_read_only(bs->file)) {
+            BdrvCheckResult result = {0};
+
+            ret = qed_check(s, &result, true);
+            if (ret) {
+                return ret;
+            }
+            if (!result.corruptions && !result.check_errors) {
+                /* Ensure fixes reach storage before clearing check bit */
+                bdrv_flush(s->bs);
+
+                s->header.features &= ~QED_F_NEED_CHECK;
+                qed_write_header_sync(s);
+            }
+        }
+    }
+
+    return 0;
+}
+
 static int bdrv_qed_open(BlockDriverState *bs, int flags)
 {
     BDRVQEDState *s = bs->opaque;
@@ -471,27 +502,9 @@ static int bdrv_qed_open(BlockDriverState *bs, int flags)
     }
 
     /* If image was not closed cleanly, check consistency */
-    if (s->header.features & QED_F_NEED_CHECK) {
-        /* Read-only images cannot be fixed.  There is no risk of corruption
-         * since write operations are not possible.  Therefore, allow
-         * potentially inconsistent images to be opened read-only.  This can
-         * aid data recovery from an otherwise inconsistent image.
-         */
-        if (!bdrv_is_read_only(bs->file)) {
-            BdrvCheckResult result = {0};
-
-            ret = qed_check(s, &result, true);
-            if (ret) {
-                goto out;
-            }
-            if (!result.corruptions && !result.check_errors) {
-                /* Ensure fixes reach storage before clearing check bit */
-                bdrv_flush(s->bs);
-
-                s->header.features &= ~QED_F_NEED_CHECK;
-                qed_write_header_sync(s);
-            }
-        }
+    ret = check_image_if_needed(bs);
+    if (ret) {
+        goto out;
     }
 
     s->need_check_timer = qemu_new_timer_ns(vm_clock,
Signature · 1 line
1.7.7.6
#9 lore raw

RFC PATCH 8/10 qed: add bdrv_post_incoming_migration operation checking the image

In reply to Benoît Canet

The bs is closed on verification failure to avoid further corruptions.

---
 block.h     |    1 +
 block/qed.c |   14 ++++++++++++++
 migration.c |    1 +
 3 files changed, 16 insertions(+), 0 deletions(-)
block.h +1 -0
index 1323086..25b66f0 100644
@@ -221,6 +221,7 @@ BlockDriverAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
 
 /* Do post incoming migration operations
  * Ex: flush mutable metadata
+ * Ex: check image
  */
 void bdrv_post_incoming_migration(BlockDriverState *bs);
 void bdrv_post_incoming_migration_all(void);
block/qed.c +14 -0
index 25558fc..f6300af 100644
@@ -1529,6 +1529,19 @@ static int bdrv_qed_change_backing_file(BlockDriverState *bs,
     return ret;
 }
 
+static void bdrv_qed_check_if_needed(BlockDriverState *bs)
+{
+    /* close the block device if the verification fail */
+    if (check_image_if_needed(bs)) {
+        bdrv_close(bs);
+    }
+}
+
+static void bdrv_qed_post_incoming_migration(BlockDriverState *bs)
+{
+    bdrv_qed_check_if_needed(bs);
+}
+
 static int bdrv_qed_check(BlockDriverState *bs, BdrvCheckResult *result)
 {
     BDRVQEDState *s = bs->opaque;
@@ -1581,6 +1594,7 @@ static BlockDriver bdrv_qed = {
     .bdrv_getlength           = bdrv_qed_getlength,
     .bdrv_get_info            = bdrv_qed_get_info,
     .bdrv_change_backing_file = bdrv_qed_change_backing_file,
+    .bdrv_post_incoming_migration = bdrv_qed_post_incoming_migration,
     .bdrv_check               = bdrv_qed_check,
 };
 
migration.c +1 -0
index 5ac31a3..d59042c 100644
@@ -95,6 +95,7 @@ void process_incoming_migration(QEMUFile *f)
     bdrv_clear_incoming_migration_all();
     /* Execute post incoming migration operations :
      * for qcow2 make sure to flush mutable metadata
+     * for QED check image
      **/
     bdrv_post_incoming_migration_all();
 
Signature · 1 line
1.7.7.6
#10 lore raw

Re: [Qemu-devel] [RFC PATCH 08/10] qed: add bdrv_post_incoming_migration operation checking the image

block/qed.c static int bdrv_qed_change_backing_file(BlockDriverState *bs, · line 1537

Quoted 10 lines · Benoît Canet
block/qed.c +6 -0
@@ -1529,6 +1529,19 @@ static int bdrv_qed_change_backing_file(BlockDriverState *bs,
     return ret;
 }
 
+static void bdrv_qed_check_if_needed(BlockDriverState *bs)
+{
+    /* close the block device if the verification fail */
+    if (check_image_if_needed(bs)) {
+        bdrv_close(bs);
+    }

We open the image for incoming migration while the VM is still running. That means the metadata and header can still change before migration switchover. So we need to drop everything we know about this image and start from scratch.

qcow2 does it like this:

qcow2_close(bs);
memset(s, 0, sizeof(BDRVQcowState));
qcow2_open(bs, flags);

We should do something similar so that the QED header is re-read. This probably means check_image_if_needed() doesn't need to be factored out of qed_open().

(Note that the underlying file and BlockDriverState don't get reopened, we're simply reinitializing the QED/QCOW2 image format layer here.)

Stefan

#11 lore raw

Re: [Qemu-devel] [RFC PATCH 08/10] qed: add bdrv_post_incoming_migration operation checking the image

So should I drop the "block: rename *_invalidate_cache_* to *_post_incoming_migration_*" commit ?

Quoted 33 lines · Stefan Hajnoczi

Review static int

Quoted 1 line · Benoît Canet
(quoted diff) +0 -0
@@ -1529,6 +1529,19 @@ static int

bdrv_qed_change_backing_file(BlockDriverState *bs,

block/qed.c static int bdrv_qed_change_backing_file(BlockDriverState *bs, · line 1537

Quoted 9 lines
block/qed.c +6 -0
     return ret;
 }
 
+static void bdrv_qed_check_if_needed(BlockDriverState *bs)
+{
+    /* close the block device if the verification fail */
+    if (check_image_if_needed(bs)) {
+        bdrv_close(bs);
+    }

We open the image for incoming migration while the VM is still running. That means the metadata and header can still change before migration switchover. So we need to drop everything we know about this image and start from scratch.

qcow2 does it like this:

qcow2_close(bs);
memset(s, 0, sizeof(BDRVQcowState));
qcow2_open(bs, flags);

We should do something similar so that the QED header is re-read. This probably means check_image_if_needed() doesn't need to be factored out of qed_open().

(Note that the underlying file and BlockDriverState don't get reopened, we're simply reinitializing the QED/QCOW2 image format layer here.)

Stefan

#12 lore raw

Re: [Qemu-devel] [RFC PATCH 08/10] qed: add bdrv_post_incoming_migration operation checking the image

2012/3/20 Benoît Canet <[email protected]>:

Quoted 3 lines

So should I drop the "block: rename *_invalidate_cache_* to *_post_incoming_migration_*" commit ?

Yes, I think there is no semantic change so keeping the name unchanged is good.

Stefan

#13 lore raw

RFC PATCH 9/10 qed: honor BDRV_O_INCOMING for incoming live migration

In reply to Benoît Canet
Quoted 1 line

From original commit is Patchwork-id: 31108 by

Stefan Hajnoczi <[email protected]>

"The QED image format includes a file header bit to mark images dirty. QED normally checks dirty images on open and fixes inconsistent metadata. This is undesirable during live migration since the dirty bit may be set if the source host is modifying the image file. The check should be postponed until migration completes.

Skip operations that modify the image file if the BDRV_O_INCOMING flag is set."

---
 block/qed.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
block/qed.c +3 -2
index f6300af..4bfda24 100644
@@ -378,7 +378,8 @@ static int check_image_if_needed(BlockDriverState *bs)
          * potentially inconsistent images to be opened read-only.  This can
          * aid data recovery from an otherwise inconsistent image.
          */
-        if (!bdrv_is_read_only(bs->file)) {
+        if (!bdrv_is_read_only(bs->file) &&
+            !(bs->open_flags & BDRV_O_INCOMING)) {
             BdrvCheckResult result = {0};
 
             ret = qed_check(s, &result, true);
@@ -481,7 +482,7 @@ static int bdrv_qed_open(BlockDriverState *bs, int flags)
      * feature is no longer valid.
      */
     if ((s->header.autoclear_features & ~QED_AUTOCLEAR_FEATURE_MASK) != 0 &&
-        !bdrv_is_read_only(bs->file)) {
+        !bdrv_is_read_only(bs->file) && !(flags & BDRV_O_INCOMING)) {
         s->header.autoclear_features &= QED_AUTOCLEAR_FEATURE_MASK;
 
         ret = qed_write_header_sync(s);
Signature · 1 line
1.7.7.6
#14 lore raw

RFC PATCH 10/10 qed: remove incoming live migration blocker

In reply to Benoît Canet
---
 block/qed.c |    9 ---------
 block/qed.h |    2 --
 2 files changed, 0 insertions(+), 11 deletions(-)
block/qed.c +0 -9
index 4bfda24..a7964f0 100644
@@ -511,12 +511,6 @@ 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);
@@ -529,9 +523,6 @@ 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);
 
block/qed.h +0 -2
index 62624a1..c716772 100644
@@ -169,8 +169,6 @@ typedef struct {
 
     /* Periodic flush and clear need check flag */
     QEMUTimer *need_check_timer;
-
-    Error *migration_blocker;
 } BDRVQEDState;
 
 enum {
Signature · 1 line
1.7.7.6
#15 lore raw
In reply to Benoît Canet

I'm resending you this one in private because your emails where missing in the first posting.

Regards

Benoît

Quoted 34 lines · Benoît Canet

QED + live migration is an unsafe and disabled mix.

This patchset make qed and live migration safe to use.

The check of QED images is delayed during the incoming migration. After the migration complete the QED images are checked.

Benoît Canet (10):
block: Add new BDRV_O_INCOMING flag to notice incoming live migration
block: add a function to set incoming live migration
block: add a function to clear incoming live migration
block: rename *_invalidate_cache_* to *_post_incoming_migration_*
migration: inform the block layer of incoming live status
block: open images with BDRV_O_INCOMING on incoming live migration
qed: extract image checking into check_image_if_needed
qed: add bdrv_post_incoming_migration operation checking the image
qed: honor BDRV_O_INCOMING for incoming live migration
qed: remove incoming live migration blocker

 block.c       |   35 +++++++++++++++++++++---
 block.h       |   13 +++++++--
 block/qcow2.c |    7 ++++-
 block/qed.c   |   81
+++++++++++++++++++++++++++++++++++----------------------
 block/qed.h   |    2 -
 block_int.h   |    4 +-
 migration.c   |    9 +++++-
 vl.c          |    5 +++
 8 files changed, 110 insertions(+), 46 deletions(-)

--
1.7.7.6

#16 lore raw
In reply to Benoît Canet

gentle ping :)

Quoted 34 lines · Benoît Canet

QED + live migration is an unsafe and disabled mix.

This patchset make qed and live migration safe to use.

The check of QED images is delayed during the incoming migration. After the migration complete the QED images are checked.

Benoît Canet (10):
block: Add new BDRV_O_INCOMING flag to notice incoming live migration
block: add a function to set incoming live migration
block: add a function to clear incoming live migration
block: rename *_invalidate_cache_* to *_post_incoming_migration_*
migration: inform the block layer of incoming live status
block: open images with BDRV_O_INCOMING on incoming live migration
qed: extract image checking into check_image_if_needed
qed: add bdrv_post_incoming_migration operation checking the image
qed: honor BDRV_O_INCOMING for incoming live migration
qed: remove incoming live migration blocker

 block.c       |   35 +++++++++++++++++++++---
 block.h       |   13 +++++++--
 block/qcow2.c |    7 ++++-
 block/qed.c   |   81
+++++++++++++++++++++++++++++++++++----------------------
 block/qed.h   |    2 -
 block_int.h   |    4 +-
 migration.c   |    9 +++++-
 vl.c          |    5 +++
 8 files changed, 110 insertions(+), 46 deletions(-)

--
1.7.7.6

#17 lore raw
In reply to Benoît Canet
Quoted 19 lines · Benoît Canet

QED + live migration is an unsafe and disabled mix.

This patchset make qed and live migration safe to use.

The check of QED images is delayed during the incoming migration. After the migration complete the QED images are checked.

Benoît Canet (10):
block: Add new BDRV_O_INCOMING flag to notice incoming live migration
block: add a function to set incoming live migration
block: add a function to clear incoming live migration
block: rename *_invalidate_cache_* to *_post_incoming_migration_*
migration: inform the block layer of incoming live status
block: open images with BDRV_O_INCOMING on incoming live migration
qed: extract image checking into check_image_if_needed
qed: add bdrv_post_incoming_migration operation checking the image
qed: honor BDRV_O_INCOMING for incoming live migration
qed: remove incoming live migration blocker

Quoted 9 lines
 block.c       |   35 +++++++++++++++++++++---
 block.h       |   13 +++++++--
 block/qcow2.c |    7 ++++-
 block/qed.c   |   81 +++++++++++++++++++++++++++++++++++----------------------
 block/qed.h   |    2 -
 block_int.h   |    4 +-
 migration.c   |    9 +++++-
 vl.c          |    5 +++
 8 files changed, 110 insertions(+), 46 deletions(-)

We talked about image format live migration approaches on IRC today with Kevin. I think the approach you have here will do the job.

Stefan