Patchwork [V3,3/7] blockdev: open images with BDRV_O_INCOMING on incoming live migration

login
register
mail settings
Submitter Benoit Canet
Date March 23, 2012, 7:36 a.m.
Message ID <1332488214-4685-4-git-send-email-benoit.canet@gmail.com>
Download mbox | patch
Permalink /patch/148390/
State New
Headers show

Comments

Benoit Canet - March 23, 2012, 7:36 a.m.
Open images with BDRV_O_INCOMING in order to inform block drivers
that an incoming live migration is coming.

Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
 blockdev.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/blockdev.c b/blockdev.c
index 1a500b8..9b57133 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -591,6 +591,10 @@  DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
         bdrv_flags |= BDRV_O_COPY_ON_READ;
     }
 
+    if (runstate_check(RUN_STATE_INMIGRATE)) {
+        bdrv_flags |= BDRV_O_INCOMING;
+    }
+
     if (media == MEDIA_CDROM) {
         /* CDROM is fine for any interface, don't check.  */
         ro = 1;