vhost-user-blk: fix the resize crash
authorLi Feng <fengli@smartx.com>
Mon, 19 Sep 2022 12:18:16 +0000 (20:18 +0800)
committerKevin Wolf <kwolf@redhat.com>
Thu, 27 Oct 2022 18:14:11 +0000 (20:14 +0200)
commitab6075d849f4285fc730d3ae6e17418d65d09998
tree818c8d1ed4a5af3e0249e2f5aa8ffed06fc74dac
parent7845e731471365663dea8e34338f93791d31ea44
vhost-user-blk: fix the resize crash

If the os is not installed and doesn't have the virtio guest driver,
the vhost dev isn't started, so the dev->vdev is NULL.

Reproduce: mount a Win 2019 iso, go into the install ui, then resize
the virtio-blk device, qemu crash.

Signed-off-by: Li Feng <fengli@smartx.com>
Message-Id: <20220919121816.3252223-1-fengli@smartx.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/vhost-user-blk.c