1 Star 0 Fork 131

clockguo/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vhost-user-blk-fix-the-resize-crash.patch 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
XuFei 提交于 2023-04-22 21:43 +08:00 . QEMU update to version 6.2.0-71(master)
From 17e6be412054ae22027a339614fca82d55e64973 Mon Sep 17 00:00:00 2001
From: qihao <qihao@cmss.chinamobile.com>
Date: Thu, 30 Mar 2023 17:45:11 +0800
Subject: [PATCH] vhost-user-blk: fix the resize crash
cheery-pick from ab6075d849f4285fc730d3ae6e17418d65d09998
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: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
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 eb1264afc7..bcc3f83c4b 100644
--- a/hw/block/vhost-user-blk.c
+++ b/hw/block/vhost-user-blk.c
@@ -95,6 +95,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,
sizeof(struct virtio_blk_config),
&local_err);
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/JianguoZhang/qemu.git
git@gitee.com:JianguoZhang/qemu.git
JianguoZhang
qemu
qemu
master

搜索帮助