]> Git Repo - qemu.git/blob - block-migration.c
Merge remote branch 'amit/for-anthony' into staging
[qemu.git] / block-migration.c
1 /*
2  * QEMU live block migration
3  *
4  * Copyright IBM, Corp. 2009
5  *
6  * Authors:
7  *  Liran Schour   <[email protected]>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  *
12  */
13
14 #include "qemu-common.h"
15 #include "block_int.h"
16 #include "hw/hw.h"
17 #include "qemu-queue.h"
18 #include "qemu-timer.h"
19 #include "monitor.h"
20 #include "block-migration.h"
21 #include "migration.h"
22 #include <assert.h>
23
24 #define BLOCK_SIZE (BDRV_SECTORS_PER_DIRTY_CHUNK << BDRV_SECTOR_BITS)
25
26 #define BLK_MIG_FLAG_DEVICE_BLOCK       0x01
27 #define BLK_MIG_FLAG_EOS                0x02
28 #define BLK_MIG_FLAG_PROGRESS           0x04
29
30 #define MAX_IS_ALLOCATED_SEARCH 65536
31
32 //#define DEBUG_BLK_MIGRATION
33
34 #ifdef DEBUG_BLK_MIGRATION
35 #define DPRINTF(fmt, ...) \
36     do { printf("blk_migration: " fmt, ## __VA_ARGS__); } while (0)
37 #else
38 #define DPRINTF(fmt, ...) \
39     do { } while (0)
40 #endif
41
42 typedef struct BlkMigDevState {
43     BlockDriverState *bs;
44     int bulk_completed;
45     int shared_base;
46     int64_t cur_sector;
47     int64_t cur_dirty;
48     int64_t completed_sectors;
49     int64_t total_sectors;
50     int64_t dirty;
51     QSIMPLEQ_ENTRY(BlkMigDevState) entry;
52     unsigned long *aio_bitmap;
53 } BlkMigDevState;
54
55 typedef struct BlkMigBlock {
56     uint8_t *buf;
57     BlkMigDevState *bmds;
58     int64_t sector;
59     int nr_sectors;
60     struct iovec iov;
61     QEMUIOVector qiov;
62     BlockDriverAIOCB *aiocb;
63     int ret;
64     int64_t time;
65     QSIMPLEQ_ENTRY(BlkMigBlock) entry;
66 } BlkMigBlock;
67
68 typedef struct BlkMigState {
69     int blk_enable;
70     int shared_base;
71     QSIMPLEQ_HEAD(bmds_list, BlkMigDevState) bmds_list;
72     QSIMPLEQ_HEAD(blk_list, BlkMigBlock) blk_list;
73     int submitted;
74     int read_done;
75     int transferred;
76     int64_t total_sector_sum;
77     int prev_progress;
78     int bulk_completed;
79     long double total_time;
80     int reads;
81 } BlkMigState;
82
83 static BlkMigState block_mig_state;
84
85 static void blk_send(QEMUFile *f, BlkMigBlock * blk)
86 {
87     int len;
88
89     /* sector number and flags */
90     qemu_put_be64(f, (blk->sector << BDRV_SECTOR_BITS)
91                      | BLK_MIG_FLAG_DEVICE_BLOCK);
92
93     /* device name */
94     len = strlen(blk->bmds->bs->device_name);
95     qemu_put_byte(f, len);
96     qemu_put_buffer(f, (uint8_t *)blk->bmds->bs->device_name, len);
97
98     qemu_put_buffer(f, blk->buf, BLOCK_SIZE);
99 }
100
101 int blk_mig_active(void)
102 {
103     return !QSIMPLEQ_EMPTY(&block_mig_state.bmds_list);
104 }
105
106 uint64_t blk_mig_bytes_transferred(void)
107 {
108     BlkMigDevState *bmds;
109     uint64_t sum = 0;
110
111     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
112         sum += bmds->completed_sectors;
113     }
114     return sum << BDRV_SECTOR_BITS;
115 }
116
117 uint64_t blk_mig_bytes_remaining(void)
118 {
119     return blk_mig_bytes_total() - blk_mig_bytes_transferred();
120 }
121
122 uint64_t blk_mig_bytes_total(void)
123 {
124     BlkMigDevState *bmds;
125     uint64_t sum = 0;
126
127     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
128         sum += bmds->total_sectors;
129     }
130     return sum << BDRV_SECTOR_BITS;
131 }
132
133 static inline void add_avg_read_time(int64_t time)
134 {
135     block_mig_state.reads++;
136     block_mig_state.total_time += time;
137 }
138
139 static inline long double compute_read_bwidth(void)
140 {
141     assert(block_mig_state.total_time != 0);
142     return  (block_mig_state.reads * BLOCK_SIZE)/ block_mig_state.total_time;
143 }
144
145 static int bmds_aio_inflight(BlkMigDevState *bmds, int64_t sector)
146 {
147     int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;
148
149     if ((sector << BDRV_SECTOR_BITS) < bdrv_getlength(bmds->bs)) {
150         return !!(bmds->aio_bitmap[chunk / (sizeof(unsigned long) * 8)] &
151             (1UL << (chunk % (sizeof(unsigned long) * 8))));
152     } else {
153         return 0;
154     }
155 }
156
157 static void bmds_set_aio_inflight(BlkMigDevState *bmds, int64_t sector_num,
158                              int nb_sectors, int set)
159 {
160     int64_t start, end;
161     unsigned long val, idx, bit;
162
163     start = sector_num / BDRV_SECTORS_PER_DIRTY_CHUNK;
164     end = (sector_num + nb_sectors - 1) / BDRV_SECTORS_PER_DIRTY_CHUNK;
165
166     for (; start <= end; start++) {
167         idx = start / (sizeof(unsigned long) * 8);
168         bit = start % (sizeof(unsigned long) * 8);
169         val = bmds->aio_bitmap[idx];
170         if (set) {
171             val |= 1UL << bit;
172         } else {
173             val &= ~(1UL << bit);
174         }
175         bmds->aio_bitmap[idx] = val;
176     }
177 }
178
179 static void alloc_aio_bitmap(BlkMigDevState *bmds)
180 {
181     BlockDriverState *bs = bmds->bs;
182     int64_t bitmap_size;
183
184     bitmap_size = (bdrv_getlength(bs) >> BDRV_SECTOR_BITS) +
185             BDRV_SECTORS_PER_DIRTY_CHUNK * 8 - 1;
186     bitmap_size /= BDRV_SECTORS_PER_DIRTY_CHUNK * 8;
187
188     bmds->aio_bitmap = qemu_mallocz(bitmap_size);
189 }
190
191 static void blk_mig_read_cb(void *opaque, int ret)
192 {
193     BlkMigBlock *blk = opaque;
194
195     blk->ret = ret;
196
197     blk->time = qemu_get_clock_ns(rt_clock) - blk->time;
198
199     add_avg_read_time(blk->time);
200
201     QSIMPLEQ_INSERT_TAIL(&block_mig_state.blk_list, blk, entry);
202     bmds_set_aio_inflight(blk->bmds, blk->sector, blk->nr_sectors, 0);
203
204     block_mig_state.submitted--;
205     block_mig_state.read_done++;
206     assert(block_mig_state.submitted >= 0);
207 }
208
209 static int mig_save_device_bulk(Monitor *mon, QEMUFile *f,
210                                 BlkMigDevState *bmds)
211 {
212     int64_t total_sectors = bmds->total_sectors;
213     int64_t cur_sector = bmds->cur_sector;
214     BlockDriverState *bs = bmds->bs;
215     BlkMigBlock *blk;
216     int nr_sectors;
217
218     if (bmds->shared_base) {
219         while (cur_sector < total_sectors &&
220                !bdrv_is_allocated(bs, cur_sector, MAX_IS_ALLOCATED_SEARCH,
221                                   &nr_sectors)) {
222             cur_sector += nr_sectors;
223         }
224     }
225
226     if (cur_sector >= total_sectors) {
227         bmds->cur_sector = bmds->completed_sectors = total_sectors;
228         return 1;
229     }
230
231     bmds->completed_sectors = cur_sector;
232
233     cur_sector &= ~((int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK - 1);
234
235     /* we are going to transfer a full block even if it is not allocated */
236     nr_sectors = BDRV_SECTORS_PER_DIRTY_CHUNK;
237
238     if (total_sectors - cur_sector < BDRV_SECTORS_PER_DIRTY_CHUNK) {
239         nr_sectors = total_sectors - cur_sector;
240     }
241
242     blk = qemu_malloc(sizeof(BlkMigBlock));
243     blk->buf = qemu_malloc(BLOCK_SIZE);
244     blk->bmds = bmds;
245     blk->sector = cur_sector;
246     blk->nr_sectors = nr_sectors;
247
248     blk->iov.iov_base = blk->buf;
249     blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
250     qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);
251
252     blk->time = qemu_get_clock_ns(rt_clock);
253
254     blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov,
255                                 nr_sectors, blk_mig_read_cb, blk);
256     if (!blk->aiocb) {
257         goto error;
258     }
259     block_mig_state.submitted++;
260
261     bdrv_reset_dirty(bs, cur_sector, nr_sectors);
262     bmds->cur_sector = cur_sector + nr_sectors;
263
264     return (bmds->cur_sector >= total_sectors);
265
266 error:
267     monitor_printf(mon, "Error reading sector %" PRId64 "\n", cur_sector);
268     qemu_file_set_error(f);
269     qemu_free(blk->buf);
270     qemu_free(blk);
271     return 0;
272 }
273
274 static void set_dirty_tracking(int enable)
275 {
276     BlkMigDevState *bmds;
277
278     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
279         bdrv_set_dirty_tracking(bmds->bs, enable);
280     }
281 }
282
283 static void init_blk_migration_it(void *opaque, BlockDriverState *bs)
284 {
285     Monitor *mon = opaque;
286     BlkMigDevState *bmds;
287     int64_t sectors;
288
289     if (!bdrv_is_read_only(bs)) {
290         sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS;
291         if (sectors <= 0) {
292             return;
293         }
294
295         bmds = qemu_mallocz(sizeof(BlkMigDevState));
296         bmds->bs = bs;
297         bmds->bulk_completed = 0;
298         bmds->total_sectors = sectors;
299         bmds->completed_sectors = 0;
300         bmds->shared_base = block_mig_state.shared_base;
301         alloc_aio_bitmap(bmds);
302
303         block_mig_state.total_sector_sum += sectors;
304
305         if (bmds->shared_base) {
306             monitor_printf(mon, "Start migration for %s with shared base "
307                                 "image\n",
308                            bs->device_name);
309         } else {
310             monitor_printf(mon, "Start full migration for %s\n",
311                            bs->device_name);
312         }
313
314         QSIMPLEQ_INSERT_TAIL(&block_mig_state.bmds_list, bmds, entry);
315     }
316 }
317
318 static void init_blk_migration(Monitor *mon, QEMUFile *f)
319 {
320     block_mig_state.submitted = 0;
321     block_mig_state.read_done = 0;
322     block_mig_state.transferred = 0;
323     block_mig_state.total_sector_sum = 0;
324     block_mig_state.prev_progress = -1;
325     block_mig_state.bulk_completed = 0;
326     block_mig_state.total_time = 0;
327     block_mig_state.reads = 0;
328
329     bdrv_iterate(init_blk_migration_it, mon);
330 }
331
332 static int blk_mig_save_bulked_block(Monitor *mon, QEMUFile *f)
333 {
334     int64_t completed_sector_sum = 0;
335     BlkMigDevState *bmds;
336     int progress;
337     int ret = 0;
338
339     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
340         if (bmds->bulk_completed == 0) {
341             if (mig_save_device_bulk(mon, f, bmds) == 1) {
342                 /* completed bulk section for this device */
343                 bmds->bulk_completed = 1;
344             }
345             completed_sector_sum += bmds->completed_sectors;
346             ret = 1;
347             break;
348         } else {
349             completed_sector_sum += bmds->completed_sectors;
350         }
351     }
352
353     if (block_mig_state.total_sector_sum != 0) {
354         progress = completed_sector_sum * 100 /
355                    block_mig_state.total_sector_sum;
356     } else {
357         progress = 100;
358     }
359     if (progress != block_mig_state.prev_progress) {
360         block_mig_state.prev_progress = progress;
361         qemu_put_be64(f, (progress << BDRV_SECTOR_BITS)
362                          | BLK_MIG_FLAG_PROGRESS);
363         monitor_printf(mon, "Completed %d %%\r", progress);
364         monitor_flush(mon);
365     }
366
367     return ret;
368 }
369
370 static void blk_mig_reset_dirty_cursor(void)
371 {
372     BlkMigDevState *bmds;
373
374     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
375         bmds->cur_dirty = 0;
376     }
377 }
378
379 static int mig_save_device_dirty(Monitor *mon, QEMUFile *f,
380                                  BlkMigDevState *bmds, int is_async)
381 {
382     BlkMigBlock *blk;
383     int64_t total_sectors = bmds->total_sectors;
384     int64_t sector;
385     int nr_sectors;
386
387     for (sector = bmds->cur_dirty; sector < bmds->total_sectors;) {
388         if (bmds_aio_inflight(bmds, sector)) {
389             qemu_aio_flush();
390         }
391         if (bdrv_get_dirty(bmds->bs, sector)) {
392
393             if (total_sectors - sector < BDRV_SECTORS_PER_DIRTY_CHUNK) {
394                 nr_sectors = total_sectors - sector;
395             } else {
396                 nr_sectors = BDRV_SECTORS_PER_DIRTY_CHUNK;
397             }
398             blk = qemu_malloc(sizeof(BlkMigBlock));
399             blk->buf = qemu_malloc(BLOCK_SIZE);
400             blk->bmds = bmds;
401             blk->sector = sector;
402             blk->nr_sectors = nr_sectors;
403
404             if (is_async) {
405                 blk->iov.iov_base = blk->buf;
406                 blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
407                 qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);
408
409                 blk->time = qemu_get_clock_ns(rt_clock);
410
411                 blk->aiocb = bdrv_aio_readv(bmds->bs, sector, &blk->qiov,
412                                             nr_sectors, blk_mig_read_cb, blk);
413                 if (!blk->aiocb) {
414                     goto error;
415                 }
416                 block_mig_state.submitted++;
417                 bmds_set_aio_inflight(bmds, sector, nr_sectors, 1);
418             } else {
419                 if (bdrv_read(bmds->bs, sector, blk->buf,
420                               nr_sectors) < 0) {
421                     goto error;
422                 }
423                 blk_send(f, blk);
424
425                 qemu_free(blk->buf);
426                 qemu_free(blk);
427             }
428
429             bdrv_reset_dirty(bmds->bs, sector, nr_sectors);
430             break;
431         }
432         sector += BDRV_SECTORS_PER_DIRTY_CHUNK;
433         bmds->cur_dirty = sector;
434     }
435
436     return (bmds->cur_dirty >= bmds->total_sectors);
437
438 error:
439     monitor_printf(mon, "Error reading sector %" PRId64 "\n", sector);
440     qemu_file_set_error(f);
441     qemu_free(blk->buf);
442     qemu_free(blk);
443     return 0;
444 }
445
446 static int blk_mig_save_dirty_block(Monitor *mon, QEMUFile *f, int is_async)
447 {
448     BlkMigDevState *bmds;
449     int ret = 0;
450
451     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
452         if (mig_save_device_dirty(mon, f, bmds, is_async) == 0) {
453             ret = 1;
454             break;
455         }
456     }
457
458     return ret;
459 }
460
461 static void flush_blks(QEMUFile* f)
462 {
463     BlkMigBlock *blk;
464
465     DPRINTF("%s Enter submitted %d read_done %d transferred %d\n",
466             __FUNCTION__, block_mig_state.submitted, block_mig_state.read_done,
467             block_mig_state.transferred);
468
469     while ((blk = QSIMPLEQ_FIRST(&block_mig_state.blk_list)) != NULL) {
470         if (qemu_file_rate_limit(f)) {
471             break;
472         }
473         if (blk->ret < 0) {
474             qemu_file_set_error(f);
475             break;
476         }
477         blk_send(f, blk);
478
479         QSIMPLEQ_REMOVE_HEAD(&block_mig_state.blk_list, entry);
480         qemu_free(blk->buf);
481         qemu_free(blk);
482
483         block_mig_state.read_done--;
484         block_mig_state.transferred++;
485         assert(block_mig_state.read_done >= 0);
486     }
487
488     DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTION__,
489             block_mig_state.submitted, block_mig_state.read_done,
490             block_mig_state.transferred);
491 }
492
493 static int64_t get_remaining_dirty(void)
494 {
495     BlkMigDevState *bmds;
496     int64_t dirty = 0;
497
498     QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
499         dirty += bdrv_get_dirty_count(bmds->bs);
500     }
501
502     return dirty * BLOCK_SIZE;
503 }
504
505 static int is_stage2_completed(void)
506 {
507     int64_t remaining_dirty;
508     long double bwidth;
509
510     if (block_mig_state.bulk_completed == 1) {
511
512         remaining_dirty = get_remaining_dirty();
513         if (remaining_dirty == 0) {
514             return 1;
515         }
516
517         bwidth = compute_read_bwidth();
518
519         if ((remaining_dirty / bwidth) <=
520             migrate_max_downtime()) {
521             /* finish stage2 because we think that we can finish remaing work
522                below max_downtime */
523
524             return 1;
525         }
526     }
527
528     return 0;
529 }
530
531 static void blk_mig_cleanup(Monitor *mon)
532 {
533     BlkMigDevState *bmds;
534     BlkMigBlock *blk;
535
536     while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {
537         QSIMPLEQ_REMOVE_HEAD(&block_mig_state.bmds_list, entry);
538         qemu_free(bmds->aio_bitmap);
539         qemu_free(bmds);
540     }
541
542     while ((blk = QSIMPLEQ_FIRST(&block_mig_state.blk_list)) != NULL) {
543         QSIMPLEQ_REMOVE_HEAD(&block_mig_state.blk_list, entry);
544         qemu_free(blk->buf);
545         qemu_free(blk);
546     }
547
548     set_dirty_tracking(0);
549
550     monitor_printf(mon, "\n");
551 }
552
553 static int block_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
554 {
555     DPRINTF("Enter save live stage %d submitted %d transferred %d\n",
556             stage, block_mig_state.submitted, block_mig_state.transferred);
557
558     if (stage < 0) {
559         blk_mig_cleanup(mon);
560         return 0;
561     }
562
563     if (block_mig_state.blk_enable != 1) {
564         /* no need to migrate storage */
565         qemu_put_be64(f, BLK_MIG_FLAG_EOS);
566         return 1;
567     }
568
569     if (stage == 1) {
570         init_blk_migration(mon, f);
571
572         /* start track dirty blocks */
573         set_dirty_tracking(1);
574     }
575
576     flush_blks(f);
577
578     if (qemu_file_has_error(f)) {
579         blk_mig_cleanup(mon);
580         return 0;
581     }
582
583     blk_mig_reset_dirty_cursor();
584
585     if (stage == 2) {
586         /* control the rate of transfer */
587         while ((block_mig_state.submitted +
588                 block_mig_state.read_done) * BLOCK_SIZE <
589                qemu_file_get_rate_limit(f)) {
590             if (block_mig_state.bulk_completed == 0) {
591                 /* first finish the bulk phase */
592                 if (blk_mig_save_bulked_block(mon, f) == 0) {
593                     /* finished saving bulk on all devices */
594                     block_mig_state.bulk_completed = 1;
595                 }
596             } else {
597                 if (blk_mig_save_dirty_block(mon, f, 1) == 0) {
598                     /* no more dirty blocks */
599                     break;
600                 }
601             }
602         }
603
604         flush_blks(f);
605
606         if (qemu_file_has_error(f)) {
607             blk_mig_cleanup(mon);
608             return 0;
609         }
610     }
611
612     if (stage == 3) {
613         /* we know for sure that save bulk is completed and
614            all async read completed */
615         assert(block_mig_state.submitted == 0);
616
617         while (blk_mig_save_dirty_block(mon, f, 0) != 0);
618         blk_mig_cleanup(mon);
619
620         /* report completion */
621         qemu_put_be64(f, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS);
622
623         if (qemu_file_has_error(f)) {
624             return 0;
625         }
626
627         monitor_printf(mon, "Block migration completed\n");
628     }
629
630     qemu_put_be64(f, BLK_MIG_FLAG_EOS);
631
632     return ((stage == 2) && is_stage2_completed());
633 }
634
635 static int block_load(QEMUFile *f, void *opaque, int version_id)
636 {
637     static int banner_printed;
638     int len, flags;
639     char device_name[256];
640     int64_t addr;
641     BlockDriverState *bs, *bs_prev = NULL;
642     uint8_t *buf;
643     int64_t total_sectors = 0;
644     int nr_sectors;
645
646     do {
647         addr = qemu_get_be64(f);
648
649         flags = addr & ~BDRV_SECTOR_MASK;
650         addr >>= BDRV_SECTOR_BITS;
651
652         if (flags & BLK_MIG_FLAG_DEVICE_BLOCK) {
653             int ret;
654             /* get device name */
655             len = qemu_get_byte(f);
656             qemu_get_buffer(f, (uint8_t *)device_name, len);
657             device_name[len] = '\0';
658
659             bs = bdrv_find(device_name);
660             if (!bs) {
661                 fprintf(stderr, "Error unknown block device %s\n",
662                         device_name);
663                 return -EINVAL;
664             }
665
666             if (bs != bs_prev) {
667                 bs_prev = bs;
668                 total_sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS;
669                 if (total_sectors <= 0) {
670                     error_report("Error getting length of block device %s\n",
671                                  device_name);
672                     return -EINVAL;
673                 }
674             }
675
676             if (total_sectors - addr < BDRV_SECTORS_PER_DIRTY_CHUNK) {
677                 nr_sectors = total_sectors - addr;
678             } else {
679                 nr_sectors = BDRV_SECTORS_PER_DIRTY_CHUNK;
680             }
681
682             buf = qemu_malloc(BLOCK_SIZE);
683
684             qemu_get_buffer(f, buf, BLOCK_SIZE);
685             ret = bdrv_write(bs, addr, buf, nr_sectors);
686
687             qemu_free(buf);
688             if (ret < 0) {
689                 return ret;
690             }
691         } else if (flags & BLK_MIG_FLAG_PROGRESS) {
692             if (!banner_printed) {
693                 printf("Receiving block device images\n");
694                 banner_printed = 1;
695             }
696             printf("Completed %d %%%c", (int)addr,
697                    (addr == 100) ? '\n' : '\r');
698             fflush(stdout);
699         } else if (!(flags & BLK_MIG_FLAG_EOS)) {
700             fprintf(stderr, "Unknown flags\n");
701             return -EINVAL;
702         }
703         if (qemu_file_has_error(f)) {
704             return -EIO;
705         }
706     } while (!(flags & BLK_MIG_FLAG_EOS));
707
708     return 0;
709 }
710
711 static void block_set_params(int blk_enable, int shared_base, void *opaque)
712 {
713     block_mig_state.blk_enable = blk_enable;
714     block_mig_state.shared_base = shared_base;
715
716     /* shared base means that blk_enable = 1 */
717     block_mig_state.blk_enable |= shared_base;
718 }
719
720 void blk_mig_init(void)
721 {
722     QSIMPLEQ_INIT(&block_mig_state.bmds_list);
723     QSIMPLEQ_INIT(&block_mig_state.blk_list);
724
725     register_savevm_live(NULL, "block", 0, 1, block_set_params,
726                          block_save_live, NULL, block_load, &block_mig_state);
727 }
This page took 0.063696 seconds and 4 git commands to generate.