1 Star 0 Fork 24

MendeZ/libvirt_anolis

forked from src-anolis-os/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libvirt-node_device-Treat-NVMe-disks-as-regular-disks.patch 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
From c04c7a986bd3514730e4169bf1a70bbec1fda006 Mon Sep 17 00:00:00 2001
Message-Id: <c04c7a986bd3514730e4169bf1a70bbec1fda006@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 26 Jan 2022 13:47:33 +0100
Subject: [PATCH] node_device: Treat NVMe disks as regular disks
Unfortunately, udev doesn't set ID_TYPE attribute for NVMe disks,
therefore we have to add another case into udevKludgeStorageType()
to treat /dev/nvme* devlinks as any other disk.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2045953
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit f103976ff34a52298df1810d82ececa3e7da4291)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2056673
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/node_device/node_device_udev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index dd18401e78..a9e8bf10da 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -903,6 +903,11 @@ udevKludgeStorageType(virNodeDeviceDef *def)
* ID_TYPE=disk does not exist on DASDs they fall through
* the udevProcessStorage detection logic. */
{ "/dev/dasd", "dasd" },
+
+ /* NVMe disk. While strictly speaking /dev/nvme is a
+ * controller not a disk, this function is called if and
+ * only if @def is of VIR_NODE_DEV_CAP_STORAGE type. */
+ { "/dev/nvme", "disk" },
};
VIR_DEBUG("Could not find definitive storage type for device "
--
2.35.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shuaijiakun/libvirt_anolis.git
git@gitee.com:shuaijiakun/libvirt_anolis.git
shuaijiakun
libvirt_anolis
libvirt_anolis
a8.9-virt-stream-an

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385