feat(axvirtio-blk): add virtio-mmio block device core - #1935
Draft
luodeb wants to merge 6 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
依赖关系
debin/virtio-net-featurehead 上,因此 feat(axvisor): add dual-guest virtio-net support #1927 合入dev后会重新 rebase,并刷新本 PR 的最终差异。问题
#1927 为 AxVisor 引入了可复用的 VirtIO MMIO/virtqueue 公共层,但其中原先附带的 block device crate 没有真实消费者,因此已从网络功能 PR 中移除。block 功能需要作为独立变更维护和审查,避免扩大 #1927 的功能边界。
修改
axvirtio-blkno_std crate。axvirtio-common实现 VirtIO MMIO block transport、设备配置空间和单队列请求处理。BlockBackendcapability boundary,使存储实现与 VirtIO 协议核心解耦。Cargo.lock。实现逻辑
VirtIO transport 与 split virtqueue 复用 #1927 提供的
axvirtio-common。axvirtio-blk只负责 block 配置和请求语义,实际存储通过BlockBackend注入;guest descriptor 经 VirtIO queue 解析后转换为读、写或 flush 操作,完成后更新 used ring、状态字节和中断状态。后续完善
Draft 阶段还会补齐 AxVisor 的生产 consumer、配置驱动设备注册、guest FDT 节点和独立 QEMU block I/O 回归。完成这些运行时证据且 #1927 合入后,再将本 PR 标记为 Ready for review。
验证
cargo test -p axvirtio-blk cargo xtask clippy --package axvirtio-blk cargo fmt --all --check git diff --check当前结果:33 个集成测试和 1 个 doctest 通过,targeted clippy 通过。