blockdev: open images with BDRV_O_INCOMING on incoming live migration
authorBenoît Canet <benoit.canet@gmail.com>
Fri, 23 Mar 2012 07:36:50 +0000 (08:36 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 5 Apr 2012 14:28:16 +0000 (16:28 +0200)
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>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c

index 4d17486e312bf9a262f6ddd4e3252f1f7f0f63aa..0c2440e249eb7c9eb9aa28d47f03cd7ed0e82711 100644 (file)
@@ -595,6 +595,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;