Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvm-test: add the option to "overwrite" an existing installation without recreating the disk from scratch #2093

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ogayot
Copy link
Member

@ogayot ogayot commented Sep 25, 2024

When running kvm-test with --install, we currently have two options related to the target disk:

  • Abort if the target already exists, This is the default behavior.
  • If the --overwrite option (or -o) is passed, we instead recreate the target image from scratch.

This makes us unable to supply an already partitioned disk to kvm-test, which is a bit of a shame considering the use-cases we have currently.

This change adds 3 new options (well, only one is truly new):

  • --preserve-target which is an explicit way to abort if the target image already exists (this is the default behavior)
  • --recreate-target which mimics what -o / --overwrite does.
  • --reuse-target which is the new one. When the option is supplied, we will reuse the disk without recreating it (if it already exists).

When we install to an existing disk with --reuse-target, we need to ask the firmware to boot from the installation media (or it will prefer booting from the disk if there is something installed to it). In BIOS mode, this means adding the -boot order=d option. However, in UEFI mode, it is more difficult to do. For now, I've added a note to stderr to tell how to proceed with UEFI (i.e., mashing ESC and then selecting Boot Manager -> UEFI QEMU DVD-ROM). Suggestions welcome :)

kvm-test has three new options (with only the third one being really
new).

* `--preserve-target` which is an explicit way to abort if the target
  image already exists (this is the default behavior)
* `--recreate-target` which mimics what `-o` / `--overwrite` does (i.e.,
  recreating the target image even if it already exists).
* `--reuse-target` which is the new one. When the option is supplied, we
  will reuse the disk without recreating it (if it already exists).

When using the --reuse-target option, the firmware will try to boot from
the disk. To work around the issue, quickly hit ESC and select
`Boot Manager -> UEFI QEMU DVD-ROM`.

Signed-off-by: Olivier Gayot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant