Commit 13498576 authored by Julien Thierry's avatar Julien Thierry Committed by Will Deacon
Browse files

builtin-run: Do not look for default kernel when firmware is provided



When a firmware file is provided, kvmtool is not responsible for loading
a kernel image.

There is no reason for looking for a default kernel image when loading
a firmware.
Signed-off-by: default avatarJulien Thierry <julien.thierry@arm.com>
Reviewed-by: Andre Przywara's avatarAndre Przywara <andre.przywara@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent f269c81d
......@@ -512,13 +512,14 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
kvm->nr_disks = kvm->cfg.image_count;
if (!kvm->cfg.kernel_filename)
if (!kvm->cfg.kernel_filename && !kvm->cfg.firmware_filename) {
kvm->cfg.kernel_filename = find_kernel();
if (!kvm->cfg.kernel_filename) {
kernel_usage_with_options();
return ERR_PTR(-EINVAL);
}
}
kvm->cfg.vmlinux_filename = find_vmlinux();
kvm->vmlinux = kvm->cfg.vmlinux_filename;
......@@ -639,10 +640,17 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
kvm->cfg.real_cmdline = real_cmdline;
if (kvm->cfg.kernel_filename) {
printf(" # %s run -k %s -m %Lu -c %d --name %s\n", KVM_BINARY_NAME,
kvm->cfg.kernel_filename,
(unsigned long long)kvm->cfg.ram_size / 1024 / 1024,
kvm->cfg.nrcpus, kvm->cfg.guest_name);
} else if (kvm->cfg.firmware_filename) {
printf(" # %s run --firmware %s -m %Lu -c %d --name %s\n", KVM_BINARY_NAME,
kvm->cfg.firmware_filename,
(unsigned long long)kvm->cfg.ram_size / 1024 / 1024,
kvm->cfg.nrcpus, kvm->cfg.guest_name);
}
if (init_list__init(kvm) < 0)
die ("Initialisation failed");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment