diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/xen_disk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 36d7398f4f..1bbc111939 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -931,9 +931,11 @@ static int blk_connect(struct XenDevice *xendev) blk_attach_dev_nofail(blkdev->blk, blkdev); blkdev->file_size = blk_getlength(blkdev->blk); if (blkdev->file_size < 0) { + BlockDriverState *bs = blk_bs(blkdev->blk); + const char *drv_name = bs ? bdrv_get_format_name(bs) : NULL; xen_be_printf(&blkdev->xendev, 1, "blk_getlength: %d (%s) | drv %s\n", (int)blkdev->file_size, strerror(-blkdev->file_size), - bdrv_get_format_name(blk_bs(blkdev->blk)) ?: "-"); + drv_name ?: "-"); blkdev->file_size = 0; } |