aboutsummaryrefslogtreecommitdiff
path: root/migration/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration/block.c')
-rw-r--r--migration/block.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/migration/block.c b/migration/block.c
index ed865ed23b..f7bb1e0126 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -808,6 +808,11 @@ static int block_load(QEMUFile *f, void *opaque, int version_id)
return -EINVAL;
}
bs = blk_bs(blk);
+ if (!bs) {
+ fprintf(stderr, "Block device %s has no medium\n",
+ device_name);
+ return -EINVAL;
+ }
if (bs != bs_prev) {
bs_prev = bs;