diff mbox series

[kvmtool,02/10] builtin-run: Warn when ignoring initrd because --firmware was specified

Message ID 20210923144505.60776-3-alexandru.elisei@arm.com (mailing list archive)
State New, archived
Headers show
Series Run kvm-unit-tests with --kernel | expand

Commit Message

Alexandru Elisei Sept. 23, 2021, 2:44 p.m. UTC
The firmware image is copied into the guest memory with the arch specific
function kvm__load_firmware() in kvm__init(). That function ignores the
initrd file, if the user specified one. Let the user know that the file is
ignored by KVM and the --initrd argument does nothing with --firmware.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 builtin-run.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/builtin-run.c b/builtin-run.c
index 8bb8051680b1..083c7a2abea7 100644
--- a/builtin-run.c
+++ b/builtin-run.c
@@ -516,6 +516,9 @@  static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
 	if (kvm->cfg.kernel_filename && kvm->cfg.firmware_filename)
 		die("Only one of --kernel or --firmware can be specified");
 
+	if (kvm->cfg.firmware_filename && kvm->cfg.initrd_filename)
+		pr_warning("Ignoring initrd file when loading a firmware image");
+
 	if (!kvm->cfg.kernel_filename && !kvm->cfg.firmware_filename) {
 		kvm->cfg.kernel_filename = find_kernel();