libvirt rm-all --stop deletes the base disk of a running transient VM

未关闭 适合新手
#429 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend

调研方向

阅读 crates/kit/src/libvirt/rm_all.rs 中的“Remove disk manually if it exists”步骤,然后将其行为与 crates/kit/src/libvirt/rm.rs 中对临时域的处理,以及 crates/kit/src/libvirt/run.rs 中的磁盘克隆分支进行比较。使用 issue 中的两个 bcvk 命令复现问题。完成标准是:rm-all --stop --force 保留临时域共用的基础磁盘,同时仍删除符合条件的磁盘。

由索引模型根据 Issue 内容生成。

描述

bcvk libvirt rm-all --stop deletes the cached base disk when a transient VM is running.

A transient VM uses the base disk directly (crates/kit/src/libvirt/run.rs, the opts.transient branch of the disk clone), so its domain's disk_path is the shared base image. rm handles this: after virsh destroy it returns early for a transient domain without touching the disk. rm-all doesn't check, so after destroying the VM it calls remove_file on that path (crates/kit/src/libvirt/rm_all.rs, "Remove disk manually if it exists"), then fails to undefine the domain, which no longer exists.

Steps:

  1. bcvk libvirt run --transient --detach --name t1 quay.io/centos-bootc/centos-bootc:stream10
  2. bcvk libvirt rm-all --stop --force

The base disk in the pool is gone, and any other VM cloned from it or running transient on it loses its backing image.

Fix: skip disk removal for transient domains in rm-all, as rm does (ideally by sharing rm's removal path).

主要语言
Rust
星标
142
派生
40
平均合并
4 天 3 小时
30 天内合并 PR
5

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bootc-dev/bcvk 的其他 Issue

查看 bootc-dev/bcvk 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。