diff options
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1040,8 +1040,12 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp) error_free(local_err); return ret; } - pstrcpy(bs->backing_file, sizeof(bs->backing_file), - bs->backing_hd->file->filename); + + if (bs->backing_hd->file) { + pstrcpy(bs->backing_file, sizeof(bs->backing_file), + bs->backing_hd->file->filename); + } + return 0; } |