kvm-test: add the option to "overwrite" an existing installation without recreating the disk from scratch #2093
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.
When running
kvm-test
with--install
, we currently have two options related to the target disk:--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 selectingBoot Manager
->UEFI QEMU DVD-ROM
). Suggestions welcome :)