arm - QEMU 找不到设备“nvme”的“PCI”总线
问题描述
我正在使用 QEMU 调试 NVME 代码,QEMU 返回错误消息:No 'PCI' bus found for device 'nvme'。
但是,我检查了设备信息,它显示支持 PCI。
root@linux:/home/#qemu-system-arm -machine vexpress-a9 -device help
Storage devices:
name "am53c974", bus PCI, desc "AMD Am53c974 PCscsi-PCI SCSI adapter"
name "nvme", bus PCI, desc "Non-Volatile Memory Express"
name "nvme-ns", bus nvme-bus, desc "Virtual NVMe namespace"
name "nvme-subsys", desc "Virtual NVMe subsystem"
有人可以给我一些提示吗?
QEMU 命令:
root@linux:~/run-kernel/$ qemu-system-arm -nographic -M vexpress-a9 -m 1024M -kernel arch/arm/boot/zImage -append "rdinit=/linuxrc console=ttyAMA0 loglevel=8" -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb -device nvme,drive=nvme0,serial=deadbeaf1,num_queues=8 -drive file=disk.qcow2,if=none,id=nvme0
输出:
WARNING: Image format was not specified for 'disk.qcow2' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-arm: -device nvme,drive=nvme0,serial=deadbeaf1,num_queues=8: No 'PCI' bus found for device 'nvme'
QEMU 版本:
root@linux:/home/# qemu-system-arm -version
QEMU emulator version 6.0.94
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
解决方案
您正在尝试在没有 PCI 总线 (vexpress-a9) 的机器类型上使用 PCI 设备 (nvme)。这不起作用,就像试图将真正的硬件 PCI 卡插入没有 PCI 插槽的机器一样是不可能的。
您可能对“-device help”输出感到困惑:该输出列出了编译到该 QEMU 二进制文件中的所有设备,并且不会根据您同时传递的任何其他“-machine”选项对其进行过滤。所以它总是会向你展示一切。
推荐阅读
- javascript - JS for 循环没有显示正确的结果
- kubernetes - 使用 Ingress 主机名的 Kubernetes 路由到服务 | 钥匙斗篷
- flutter - 如何从 Flutter 中的“ThemeData”中检索“MaterialColor”而不是“Color”?
- javascript - 如何使用 javascript 中的正则表达式返回字符串中的特定模式?
- html - 选择一个元素时遇到问题,而其他元素在 :target
- algorithm - 这种方法的操作次数是多少?
- azure-data-factory - Azure 数据工厂根据大小从文件夹中抓取文件
- javascript - 通过动态 Key、Value 格式化 JSON 数据
- javascript - ReactJS 组件中的简单 javascript 不起作用
- android - Android BillingClient:在 onBillingSetupFinished 之前处理 onBillingServiceDisconnected