[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/58] vhost-user-blk: fix the resize crash
From: |
Kevin Wolf |
Subject: |
[PULL 07/58] vhost-user-blk: fix the resize crash |
Date: |
Thu, 27 Oct 2022 20:30:55 +0200 |
From: Li Feng <fengli@smartx.com>
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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
index 84902dde17..13bf5cc47a 100644
--- a/hw/block/vhost-user-blk.c
+++ b/hw/block/vhost-user-blk.c
@@ -97,6 +97,10 @@ static int vhost_user_blk_handle_config_change(struct
vhost_dev *dev)
VHostUserBlk *s = VHOST_USER_BLK(dev->vdev);
Error *local_err = NULL;
+ if (!dev->started) {
+ return 0;
+ }
+
ret = vhost_dev_get_config(dev, (uint8_t *)&blkcfg,
vdev->config_len, &local_err);
if (ret < 0) {
--
2.37.3
- [PULL 00/58] Block layer patches, Kevin Wolf, 2022/10/27
- [PULL 02/58] block: Ignore close() failure in get_tmp_filename(), Kevin Wolf, 2022/10/27
- [PULL 03/58] block: Refactor get_tmp_filename(), Kevin Wolf, 2022/10/27
- [PULL 01/58] MAINTAINERS: Fold "Block QAPI, monitor, ..." into "Block layer core", Kevin Wolf, 2022/10/27
- [PULL 07/58] vhost-user-blk: fix the resize crash,
Kevin Wolf <=
- [PULL 05/58] vvfat: allow spaces in file names, Kevin Wolf, 2022/10/27
- [PULL 04/58] vvfat: allow some writes to bootsector, Kevin Wolf, 2022/10/27
- [PULL 10/58] block/blklogwrites: don't care to remove bs->file child on failure, Kevin Wolf, 2022/10/27
- [PULL 12/58] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing, Kevin Wolf, 2022/10/27
- [PULL 14/58] block: document connection between child roles and bs->backing/bs->file, Kevin Wolf, 2022/10/27
- [PULL 08/58] block: BlockDriver: add .filtered_child_is_backing field, Kevin Wolf, 2022/10/27
- [PULL 11/58] test-bdrv-graph-mod: update test_parallel_perm_update test case, Kevin Wolf, 2022/10/27
- [PULL 15/58] block/snapshot: stress that we fallback to primary child, Kevin Wolf, 2022/10/27
- [PULL 06/58] block/io_uring: revert "Use io_uring_register_ring_fd() to skip fd operations", Kevin Wolf, 2022/10/27
- [PULL 17/58] Revert "block: Let replace_child_tran keep indirect pointer", Kevin Wolf, 2022/10/27