fix(msd): 区分虚拟磁盘挂载能力与文件访问状态

使用原始文件元数据挂载虚拟磁盘,允许主机使用网页文件管理不支持的文件系统。连接期间只读取元数据;初始化和删除持有外层写锁,并同步控制器缓存。

API 的 used/free 改为可空值,新增 file_access 表示 available、unsupported、blocked_while_connected 或 unknown,需要前端配套处理。补充状态序列化、元数据校验和文件系统兼容测试。
This commit is contained in:
mofeng-git
2026-09-05 14:10:53 +08:00
parent d67a3ab7f8
commit b573f478fc
6 changed files with 300 additions and 90 deletions

View File

@@ -102,7 +102,9 @@ impl MsdErrorCode {
Self::MsdDownloadIncomplete => "The remote image download was incomplete.",
Self::MsdDriveNotInitialized => "The virtual drive is not initialized.",
Self::MsdDriveConnected => "The virtual drive is connected to the controlled computer.",
Self::MsdDriveFilesystemUnsupported => "The virtual drive filesystem is unsupported.",
Self::MsdDriveFilesystemUnsupported => {
"Web file management does not support this virtual drive format."
}
Self::MsdDriveSizeInvalid => "The virtual drive size is invalid.",
Self::MsdStorageSpaceUnavailable => {
"Available virtual media storage space could not be determined."
@@ -183,7 +185,7 @@ impl MsdErrorCode {
"Verify the remote server and network connection, then retry."
}
Self::MsdDriveFilesystemUnsupported => {
"Reinitialize the virtual drive with a supported filesystem, then retry."
"Mount the drive on the controlled computer, or use a supported format for web file management."
}
Self::MsdStorageSpaceUnavailable => {
"Verify that virtual media storage is available, then retry."
@@ -386,7 +388,7 @@ mod tests {
(
MsdDriveFilesystemUnsupported,
"MSD_DRIVE_FILESYSTEM_UNSUPPORTED",
"The virtual drive filesystem is unsupported.",
"Web file management does not support this virtual drive format.",
),
(
MsdDriveSizeInvalid,