Introduce stable disk/iso filenames with symlink-based migration#4587
Open
jandubois wants to merge 1 commit intolima-vm:masterfrom
Open
Introduce stable disk/iso filenames with symlink-based migration#4587jandubois wants to merge 1 commit intolima-vm:masterfrom
jandubois wants to merge 1 commit intolima-vm:masterfrom
Conversation
Member
Author
|
Things for maybe a follow-up PR:
|
AkihiroSuda
reviewed
Feb 16, 2026
AkihiroSuda
reviewed
Feb 16, 2026
Replace the legacy basedisk/diffdisk naming with self-documenting filenames: "image" (downloaded VM image), "disk" (VM disk), and "iso" (optional CDROM). New instances download to "image" and create symlinks: non-ISO images get disk→image; ISO images get iso→image plus a real empty disk. QEMU no longer creates a qcow2 overlay backed by basedisk; it symlinks disk→image directly. Existing instances are migrated by MigrateDiskLayout, which creates disk→diffdisk and (for ISO basedisks) iso→basedisk symlinks. The original files remain so older Lima versions can still use them. Boot paths now check for the "iso" symlink via osutil.FileExists instead of calling iso9660util.IsISO9660 at startup. Both QEMU and VZ attach the VM disk before the ISO. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
AkihiroSuda
reviewed
Feb 16, 2026
| return nil | ||
| // EnsureDisk creates the VM disk from the downloaded image. | ||
| // For ISO images, it symlinks the ISO and creates an empty disk in the target format. | ||
| // For non-ISO images, it converts the image in place and symlinks disk to it. |
Member
There was a problem hiding this comment.
Why not just rename image to disk
AkihiroSuda
reviewed
Feb 16, 2026
| disk: | ||
| - `basedisk`: the base image | ||
| - `diffdisk`: the diff image (QCOW2) | ||
| - `image`: the downloaded VM image (raw, qcow2, or ISO9660) |
Member
There was a problem hiding this comment.
Can we mark image non-mutable (but deletable) ?
AkihiroSuda
reviewed
Feb 16, 2026
| - `basedisk`: the base image | ||
| - `diffdisk`: the diff image (QCOW2) | ||
| - `image`: the downloaded VM image (raw, qcow2, or ISO9660) | ||
| - `disk`: the VM disk (symlink to `image` or legacy `diffdisk`) |
Member
There was a problem hiding this comment.
Suggested change
| - `disk`: the VM disk (symlink to `image` or legacy `diffdisk`) | |
| - `disk`: the VM disk (can be a symlink to legacy `diffdisk`) |
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.
Alternative to #4206.
Replace the legacy basedisk/diffdisk naming with self-documenting filenames: "image" (downloaded VM image), "disk" (VM disk), and "iso" (optional CDROM).
New instances download to "image" and create symlinks: non-ISO images get disk→image; ISO images get iso→image plus a real empty disk. QEMU no longer creates a qcow2 overlay backed by basedisk; it symlinks disk→image directly.
Existing instances are migrated by
MigrateDiskLayout, which creates disk→diffdisk and (for ISO basedisks) iso→basedisk symlinks. The original files remain so older Lima versions can still use them.Boot paths now check for the "iso" symlink via
osutil.FileExistsinstead of callingiso9660util.IsISO9660at startup.Comparing existing instance vs. one created with this PR
Using ISO image
Regular non-ISO image