2 * QEMU live block migration
4 * Copyright IBM, Corp. 2009
7 * Liran Schour <lirans@il.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
12 * Contributions after 2012-01-13 are licensed under the terms of the
13 * GNU GPL, version 2 or (at your option) any later version.
16 #include "qemu-common.h"
17 #include "block/block.h"
18 #include "qemu/error-report.h"
19 #include "qemu/main-loop.h"
21 #include "qemu/queue.h"
22 #include "qemu/timer.h"
23 #include "migration/block.h"
24 #include "migration/migration.h"
25 #include "sysemu/blockdev.h"
28 #define BLOCK_SIZE (1 << 20)
29 #define BDRV_SECTORS_PER_DIRTY_CHUNK (BLOCK_SIZE >> BDRV_SECTOR_BITS)
31 #define BLK_MIG_FLAG_DEVICE_BLOCK 0x01
32 #define BLK_MIG_FLAG_EOS 0x02
33 #define BLK_MIG_FLAG_PROGRESS 0x04
34 #define BLK_MIG_FLAG_ZERO_BLOCK 0x08
36 #define MAX_IS_ALLOCATED_SEARCH 65536
38 //#define DEBUG_BLK_MIGRATION
40 #ifdef DEBUG_BLK_MIGRATION
41 #define DPRINTF(fmt, ...) \
42 do { printf("blk_migration: " fmt, ## __VA_ARGS__); } while (0)
44 #define DPRINTF(fmt, ...) \
48 typedef struct BlkMigDevState
{
49 /* Written during setup phase. Can be read without a lock. */
52 int64_t total_sectors
;
53 QSIMPLEQ_ENTRY(BlkMigDevState
) entry
;
55 /* Only used by migration thread. Does not need a lock. */
60 /* Protected by block migration lock. */
61 unsigned long *aio_bitmap
;
62 int64_t completed_sectors
;
63 BdrvDirtyBitmap
*dirty_bitmap
;
67 typedef struct BlkMigBlock
{
68 /* Only used by migration thread. */
77 /* Protected by block migration lock. */
79 QSIMPLEQ_ENTRY(BlkMigBlock
) entry
;
82 typedef struct BlkMigState
{
83 /* Written during setup phase. Can be read without a lock. */
86 QSIMPLEQ_HEAD(bmds_list
, BlkMigDevState
) bmds_list
;
87 int64_t total_sector_sum
;
90 /* Protected by lock. */
91 QSIMPLEQ_HEAD(blk_list
, BlkMigBlock
) blk_list
;
95 /* Only used by migration thread. Does not need a lock. */
100 /* Lock must be taken _inside_ the iothread lock. */
104 static BlkMigState block_mig_state
;
106 static void blk_mig_lock(void)
108 qemu_mutex_lock(&block_mig_state
.lock
);
111 static void blk_mig_unlock(void)
113 qemu_mutex_unlock(&block_mig_state
.lock
);
116 /* Must run outside of the iothread lock during the bulk phase,
117 * or the VM will stall.
120 static void blk_send(QEMUFile
*f
, BlkMigBlock
* blk
)
123 uint64_t flags
= BLK_MIG_FLAG_DEVICE_BLOCK
;
125 if (block_mig_state
.zero_blocks
&&
126 buffer_is_zero(blk
->buf
, BLOCK_SIZE
)) {
127 flags
|= BLK_MIG_FLAG_ZERO_BLOCK
;
130 /* sector number and flags */
131 qemu_put_be64(f
, (blk
->sector
<< BDRV_SECTOR_BITS
)
135 len
= strlen(bdrv_get_device_name(blk
->bmds
->bs
));
136 qemu_put_byte(f
, len
);
137 qemu_put_buffer(f
, (uint8_t *)bdrv_get_device_name(blk
->bmds
->bs
), len
);
139 /* if a block is zero we need to flush here since the network
140 * bandwidth is now a lot higher than the storage device bandwidth.
141 * thus if we queue zero blocks we slow down the migration */
142 if (flags
& BLK_MIG_FLAG_ZERO_BLOCK
) {
147 qemu_put_buffer(f
, blk
->buf
, BLOCK_SIZE
);
150 int blk_mig_active(void)
152 return !QSIMPLEQ_EMPTY(&block_mig_state
.bmds_list
);
155 uint64_t blk_mig_bytes_transferred(void)
157 BlkMigDevState
*bmds
;
161 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
162 sum
+= bmds
->completed_sectors
;
165 return sum
<< BDRV_SECTOR_BITS
;
168 uint64_t blk_mig_bytes_remaining(void)
170 return blk_mig_bytes_total() - blk_mig_bytes_transferred();
173 uint64_t blk_mig_bytes_total(void)
175 BlkMigDevState
*bmds
;
178 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
179 sum
+= bmds
->total_sectors
;
181 return sum
<< BDRV_SECTOR_BITS
;
185 /* Called with migration lock held. */
187 static int bmds_aio_inflight(BlkMigDevState
*bmds
, int64_t sector
)
189 int64_t chunk
= sector
/ (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK
;
191 if (sector
< bdrv_nb_sectors(bmds
->bs
)) {
192 return !!(bmds
->aio_bitmap
[chunk
/ (sizeof(unsigned long) * 8)] &
193 (1UL << (chunk
% (sizeof(unsigned long) * 8))));
199 /* Called with migration lock held. */
201 static void bmds_set_aio_inflight(BlkMigDevState
*bmds
, int64_t sector_num
,
202 int nb_sectors
, int set
)
205 unsigned long val
, idx
, bit
;
207 start
= sector_num
/ BDRV_SECTORS_PER_DIRTY_CHUNK
;
208 end
= (sector_num
+ nb_sectors
- 1) / BDRV_SECTORS_PER_DIRTY_CHUNK
;
210 for (; start
<= end
; start
++) {
211 idx
= start
/ (sizeof(unsigned long) * 8);
212 bit
= start
% (sizeof(unsigned long) * 8);
213 val
= bmds
->aio_bitmap
[idx
];
217 val
&= ~(1UL << bit
);
219 bmds
->aio_bitmap
[idx
] = val
;
223 static void alloc_aio_bitmap(BlkMigDevState
*bmds
)
225 BlockDriverState
*bs
= bmds
->bs
;
228 bitmap_size
= bdrv_nb_sectors(bs
) + BDRV_SECTORS_PER_DIRTY_CHUNK
* 8 - 1;
229 bitmap_size
/= BDRV_SECTORS_PER_DIRTY_CHUNK
* 8;
231 bmds
->aio_bitmap
= g_malloc0(bitmap_size
);
234 /* Never hold migration lock when yielding to the main loop! */
236 static void blk_mig_read_cb(void *opaque
, int ret
)
238 BlkMigBlock
*blk
= opaque
;
243 QSIMPLEQ_INSERT_TAIL(&block_mig_state
.blk_list
, blk
, entry
);
244 bmds_set_aio_inflight(blk
->bmds
, blk
->sector
, blk
->nr_sectors
, 0);
246 block_mig_state
.submitted
--;
247 block_mig_state
.read_done
++;
248 assert(block_mig_state
.submitted
>= 0);
252 /* Called with no lock taken. */
254 static int mig_save_device_bulk(QEMUFile
*f
, BlkMigDevState
*bmds
)
256 int64_t total_sectors
= bmds
->total_sectors
;
257 int64_t cur_sector
= bmds
->cur_sector
;
258 BlockDriverState
*bs
= bmds
->bs
;
262 if (bmds
->shared_base
) {
263 qemu_mutex_lock_iothread();
264 while (cur_sector
< total_sectors
&&
265 !bdrv_is_allocated(bs
, cur_sector
, MAX_IS_ALLOCATED_SEARCH
,
267 cur_sector
+= nr_sectors
;
269 qemu_mutex_unlock_iothread();
272 if (cur_sector
>= total_sectors
) {
273 bmds
->cur_sector
= bmds
->completed_sectors
= total_sectors
;
277 bmds
->completed_sectors
= cur_sector
;
279 cur_sector
&= ~((int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK
- 1);
281 /* we are going to transfer a full block even if it is not allocated */
282 nr_sectors
= BDRV_SECTORS_PER_DIRTY_CHUNK
;
284 if (total_sectors
- cur_sector
< BDRV_SECTORS_PER_DIRTY_CHUNK
) {
285 nr_sectors
= total_sectors
- cur_sector
;
288 blk
= g_new(BlkMigBlock
, 1);
289 blk
->buf
= g_malloc(BLOCK_SIZE
);
291 blk
->sector
= cur_sector
;
292 blk
->nr_sectors
= nr_sectors
;
294 blk
->iov
.iov_base
= blk
->buf
;
295 blk
->iov
.iov_len
= nr_sectors
* BDRV_SECTOR_SIZE
;
296 qemu_iovec_init_external(&blk
->qiov
, &blk
->iov
, 1);
299 block_mig_state
.submitted
++;
302 qemu_mutex_lock_iothread();
303 blk
->aiocb
= bdrv_aio_readv(bs
, cur_sector
, &blk
->qiov
,
304 nr_sectors
, blk_mig_read_cb
, blk
);
306 bdrv_reset_dirty_bitmap(bs
, bmds
->dirty_bitmap
, cur_sector
, nr_sectors
);
307 qemu_mutex_unlock_iothread();
309 bmds
->cur_sector
= cur_sector
+ nr_sectors
;
310 return (bmds
->cur_sector
>= total_sectors
);
313 /* Called with iothread lock taken. */
315 static int set_dirty_tracking(void)
317 BlkMigDevState
*bmds
;
320 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
321 bmds
->dirty_bitmap
= bdrv_create_dirty_bitmap(bmds
->bs
, BLOCK_SIZE
,
323 if (!bmds
->dirty_bitmap
) {
331 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
332 if (bmds
->dirty_bitmap
) {
333 bdrv_release_dirty_bitmap(bmds
->bs
, bmds
->dirty_bitmap
);
339 static void unset_dirty_tracking(void)
341 BlkMigDevState
*bmds
;
343 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
344 bdrv_release_dirty_bitmap(bmds
->bs
, bmds
->dirty_bitmap
);
348 static void init_blk_migration(QEMUFile
*f
)
350 BlockDriverState
*bs
;
351 BlkMigDevState
*bmds
;
354 block_mig_state
.submitted
= 0;
355 block_mig_state
.read_done
= 0;
356 block_mig_state
.transferred
= 0;
357 block_mig_state
.total_sector_sum
= 0;
358 block_mig_state
.prev_progress
= -1;
359 block_mig_state
.bulk_completed
= 0;
360 block_mig_state
.zero_blocks
= migrate_zero_blocks();
362 for (bs
= bdrv_next(NULL
); bs
; bs
= bdrv_next(bs
)) {
363 if (bdrv_is_read_only(bs
)) {
367 sectors
= bdrv_nb_sectors(bs
);
372 bmds
= g_new0(BlkMigDevState
, 1);
374 bmds
->bulk_completed
= 0;
375 bmds
->total_sectors
= sectors
;
376 bmds
->completed_sectors
= 0;
377 bmds
->shared_base
= block_mig_state
.shared_base
;
378 alloc_aio_bitmap(bmds
);
379 error_setg(&bmds
->blocker
, "block device is in use by migration");
380 bdrv_op_block_all(bs
, bmds
->blocker
);
383 block_mig_state
.total_sector_sum
+= sectors
;
385 if (bmds
->shared_base
) {
386 DPRINTF("Start migration for %s with shared base image\n",
387 bdrv_get_device_name(bs
));
389 DPRINTF("Start full migration for %s\n", bdrv_get_device_name(bs
));
392 QSIMPLEQ_INSERT_TAIL(&block_mig_state
.bmds_list
, bmds
, entry
);
396 /* Called with no lock taken. */
398 static int blk_mig_save_bulked_block(QEMUFile
*f
)
400 int64_t completed_sector_sum
= 0;
401 BlkMigDevState
*bmds
;
405 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
406 if (bmds
->bulk_completed
== 0) {
407 if (mig_save_device_bulk(f
, bmds
) == 1) {
408 /* completed bulk section for this device */
409 bmds
->bulk_completed
= 1;
411 completed_sector_sum
+= bmds
->completed_sectors
;
415 completed_sector_sum
+= bmds
->completed_sectors
;
419 if (block_mig_state
.total_sector_sum
!= 0) {
420 progress
= completed_sector_sum
* 100 /
421 block_mig_state
.total_sector_sum
;
425 if (progress
!= block_mig_state
.prev_progress
) {
426 block_mig_state
.prev_progress
= progress
;
427 qemu_put_be64(f
, (progress
<< BDRV_SECTOR_BITS
)
428 | BLK_MIG_FLAG_PROGRESS
);
429 DPRINTF("Completed %d %%\r", progress
);
435 static void blk_mig_reset_dirty_cursor(void)
437 BlkMigDevState
*bmds
;
439 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
444 /* Called with iothread lock taken. */
446 static int mig_save_device_dirty(QEMUFile
*f
, BlkMigDevState
*bmds
,
450 int64_t total_sectors
= bmds
->total_sectors
;
455 for (sector
= bmds
->cur_dirty
; sector
< bmds
->total_sectors
;) {
457 if (bmds_aio_inflight(bmds
, sector
)) {
463 if (bdrv_get_dirty(bmds
->bs
, bmds
->dirty_bitmap
, sector
)) {
465 if (total_sectors
- sector
< BDRV_SECTORS_PER_DIRTY_CHUNK
) {
466 nr_sectors
= total_sectors
- sector
;
468 nr_sectors
= BDRV_SECTORS_PER_DIRTY_CHUNK
;
470 blk
= g_new(BlkMigBlock
, 1);
471 blk
->buf
= g_malloc(BLOCK_SIZE
);
473 blk
->sector
= sector
;
474 blk
->nr_sectors
= nr_sectors
;
477 blk
->iov
.iov_base
= blk
->buf
;
478 blk
->iov
.iov_len
= nr_sectors
* BDRV_SECTOR_SIZE
;
479 qemu_iovec_init_external(&blk
->qiov
, &blk
->iov
, 1);
481 blk
->aiocb
= bdrv_aio_readv(bmds
->bs
, sector
, &blk
->qiov
,
482 nr_sectors
, blk_mig_read_cb
, blk
);
485 block_mig_state
.submitted
++;
486 bmds_set_aio_inflight(bmds
, sector
, nr_sectors
, 1);
489 ret
= bdrv_read(bmds
->bs
, sector
, blk
->buf
, nr_sectors
);
499 bdrv_reset_dirty_bitmap(bmds
->bs
, bmds
->dirty_bitmap
, sector
,
503 sector
+= BDRV_SECTORS_PER_DIRTY_CHUNK
;
504 bmds
->cur_dirty
= sector
;
507 return (bmds
->cur_dirty
>= bmds
->total_sectors
);
510 DPRINTF("Error reading sector %" PRId64
"\n", sector
);
516 /* Called with iothread lock taken.
519 * 0: too much data for max_downtime
520 * 1: few enough data for max_downtime
522 static int blk_mig_save_dirty_block(QEMUFile
*f
, int is_async
)
524 BlkMigDevState
*bmds
;
527 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
528 ret
= mig_save_device_dirty(f
, bmds
, is_async
);
537 /* Called with no locks taken. */
539 static int flush_blks(QEMUFile
*f
)
544 DPRINTF("%s Enter submitted %d read_done %d transferred %d\n",
545 __FUNCTION__
, block_mig_state
.submitted
, block_mig_state
.read_done
,
546 block_mig_state
.transferred
);
549 while ((blk
= QSIMPLEQ_FIRST(&block_mig_state
.blk_list
)) != NULL
) {
550 if (qemu_file_rate_limit(f
)) {
558 QSIMPLEQ_REMOVE_HEAD(&block_mig_state
.blk_list
, entry
);
566 block_mig_state
.read_done
--;
567 block_mig_state
.transferred
++;
568 assert(block_mig_state
.read_done
>= 0);
572 DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTION__
,
573 block_mig_state
.submitted
, block_mig_state
.read_done
,
574 block_mig_state
.transferred
);
578 /* Called with iothread lock taken. */
580 static int64_t get_remaining_dirty(void)
582 BlkMigDevState
*bmds
;
585 QSIMPLEQ_FOREACH(bmds
, &block_mig_state
.bmds_list
, entry
) {
586 dirty
+= bdrv_get_dirty_count(bmds
->bs
, bmds
->dirty_bitmap
);
589 return dirty
<< BDRV_SECTOR_BITS
;
592 /* Called with iothread lock taken. */
594 static void blk_mig_cleanup(void)
596 BlkMigDevState
*bmds
;
601 unset_dirty_tracking();
604 while ((bmds
= QSIMPLEQ_FIRST(&block_mig_state
.bmds_list
)) != NULL
) {
605 QSIMPLEQ_REMOVE_HEAD(&block_mig_state
.bmds_list
, entry
);
606 bdrv_op_unblock_all(bmds
->bs
, bmds
->blocker
);
607 error_free(bmds
->blocker
);
608 bdrv_unref(bmds
->bs
);
609 g_free(bmds
->aio_bitmap
);
613 while ((blk
= QSIMPLEQ_FIRST(&block_mig_state
.blk_list
)) != NULL
) {
614 QSIMPLEQ_REMOVE_HEAD(&block_mig_state
.blk_list
, entry
);
621 static void block_migration_cancel(void *opaque
)
626 static int block_save_setup(QEMUFile
*f
, void *opaque
)
630 DPRINTF("Enter save live setup submitted %d transferred %d\n",
631 block_mig_state
.submitted
, block_mig_state
.transferred
);
633 qemu_mutex_lock_iothread();
634 init_blk_migration(f
);
636 /* start track dirty blocks */
637 ret
= set_dirty_tracking();
640 qemu_mutex_unlock_iothread();
644 qemu_mutex_unlock_iothread();
647 blk_mig_reset_dirty_cursor();
648 qemu_put_be64(f
, BLK_MIG_FLAG_EOS
);
653 static int block_save_iterate(QEMUFile
*f
, void *opaque
)
656 int64_t last_ftell
= qemu_ftell(f
);
659 DPRINTF("Enter save live iterate submitted %d transferred %d\n",
660 block_mig_state
.submitted
, block_mig_state
.transferred
);
667 blk_mig_reset_dirty_cursor();
669 /* control the rate of transfer */
671 while ((block_mig_state
.submitted
+
672 block_mig_state
.read_done
) * BLOCK_SIZE
<
673 qemu_file_get_rate_limit(f
)) {
675 if (block_mig_state
.bulk_completed
== 0) {
676 /* first finish the bulk phase */
677 if (blk_mig_save_bulked_block(f
) == 0) {
678 /* finished saving bulk on all devices */
679 block_mig_state
.bulk_completed
= 1;
683 /* Always called with iothread lock taken for
684 * simplicity, block_save_complete also calls it.
686 qemu_mutex_lock_iothread();
687 ret
= blk_mig_save_dirty_block(f
, 1);
688 qemu_mutex_unlock_iothread();
695 /* no more dirty blocks */
706 qemu_put_be64(f
, BLK_MIG_FLAG_EOS
);
707 delta_ftell
= qemu_ftell(f
) - last_ftell
;
708 if (delta_ftell
> 0) {
710 } else if (delta_ftell
< 0) {
717 /* Called with iothread lock taken. */
719 static int block_save_complete(QEMUFile
*f
, void *opaque
)
723 DPRINTF("Enter save live complete submitted %d transferred %d\n",
724 block_mig_state
.submitted
, block_mig_state
.transferred
);
731 blk_mig_reset_dirty_cursor();
733 /* we know for sure that save bulk is completed and
734 all async read completed */
736 assert(block_mig_state
.submitted
== 0);
740 ret
= blk_mig_save_dirty_block(f
, 0);
746 /* report completion */
747 qemu_put_be64(f
, (100 << BDRV_SECTOR_BITS
) | BLK_MIG_FLAG_PROGRESS
);
749 DPRINTF("Block migration completed\n");
751 qemu_put_be64(f
, BLK_MIG_FLAG_EOS
);
757 static uint64_t block_save_pending(QEMUFile
*f
, void *opaque
, uint64_t max_size
)
759 /* Estimate pending number of bytes to send */
762 qemu_mutex_lock_iothread();
764 pending
= get_remaining_dirty() +
765 block_mig_state
.submitted
* BLOCK_SIZE
+
766 block_mig_state
.read_done
* BLOCK_SIZE
;
768 /* Report at least one block pending during bulk phase */
769 if (pending
<= max_size
&& !block_mig_state
.bulk_completed
) {
770 pending
= max_size
+ BLOCK_SIZE
;
773 qemu_mutex_unlock_iothread();
775 DPRINTF("Enter save live pending %" PRIu64
"\n", pending
);
779 static int block_load(QEMUFile
*f
, void *opaque
, int version_id
)
781 static int banner_printed
;
783 char device_name
[256];
785 BlockDriverState
*bs
, *bs_prev
= NULL
;
787 int64_t total_sectors
= 0;
792 addr
= qemu_get_be64(f
);
794 flags
= addr
& ~BDRV_SECTOR_MASK
;
795 addr
>>= BDRV_SECTOR_BITS
;
797 if (flags
& BLK_MIG_FLAG_DEVICE_BLOCK
) {
798 /* get device name */
799 len
= qemu_get_byte(f
);
800 qemu_get_buffer(f
, (uint8_t *)device_name
, len
);
801 device_name
[len
] = '\0';
803 bs
= bdrv_find(device_name
);
805 fprintf(stderr
, "Error unknown block device %s\n",
812 total_sectors
= bdrv_nb_sectors(bs
);
813 if (total_sectors
<= 0) {
814 error_report("Error getting length of block device %s",
820 if (total_sectors
- addr
< BDRV_SECTORS_PER_DIRTY_CHUNK
) {
821 nr_sectors
= total_sectors
- addr
;
823 nr_sectors
= BDRV_SECTORS_PER_DIRTY_CHUNK
;
826 if (flags
& BLK_MIG_FLAG_ZERO_BLOCK
) {
827 ret
= bdrv_write_zeroes(bs
, addr
, nr_sectors
,
830 buf
= g_malloc(BLOCK_SIZE
);
831 qemu_get_buffer(f
, buf
, BLOCK_SIZE
);
832 ret
= bdrv_write(bs
, addr
, buf
, nr_sectors
);
839 } else if (flags
& BLK_MIG_FLAG_PROGRESS
) {
840 if (!banner_printed
) {
841 printf("Receiving block device images\n");
844 printf("Completed %d %%%c", (int)addr
,
845 (addr
== 100) ? '\n' : '\r');
847 } else if (!(flags
& BLK_MIG_FLAG_EOS
)) {
848 fprintf(stderr
, "Unknown block migration flags: %#x\n", flags
);
851 ret
= qemu_file_get_error(f
);
855 } while (!(flags
& BLK_MIG_FLAG_EOS
));
860 static void block_set_params(const MigrationParams
*params
, void *opaque
)
862 block_mig_state
.blk_enable
= params
->blk
;
863 block_mig_state
.shared_base
= params
->shared
;
865 /* shared base means that blk_enable = 1 */
866 block_mig_state
.blk_enable
|= params
->shared
;
869 static bool block_is_active(void *opaque
)
871 return block_mig_state
.blk_enable
== 1;
874 static SaveVMHandlers savevm_block_handlers
= {
875 .set_params
= block_set_params
,
876 .save_live_setup
= block_save_setup
,
877 .save_live_iterate
= block_save_iterate
,
878 .save_live_complete
= block_save_complete
,
879 .save_live_pending
= block_save_pending
,
880 .load_state
= block_load
,
881 .cancel
= block_migration_cancel
,
882 .is_active
= block_is_active
,
885 void blk_mig_init(void)
887 QSIMPLEQ_INIT(&block_mig_state
.bmds_list
);
888 QSIMPLEQ_INIT(&block_mig_state
.blk_list
);
889 qemu_mutex_init(&block_mig_state
.lock
);
891 register_savevm_live(NULL
, "block", 0, 1, &savevm_block_handlers
,