public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Julien Thierry <julien.thierry@arm.com>
Cc: Sami.Mujawar@arm.com, will.deacon@arm.com,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH kvmtool 3/6] builtin-run: Do not look for default kernel when firmware is provided
Date: Wed, 12 Dec 2018 18:16:23 +0000	[thread overview]
Message-ID: <20181212181623.00007bb0@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <1543922073-55530-4-git-send-email-julien.thierry@arm.com>

On Tue,  4 Dec 2018 11:14:30 +0000
Julien Thierry <julien.thierry@arm.com> wrote:

Hi,

> 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: Julien Thierry <julien.thierry@arm.com>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Just wondering whether we actually need this unconditional printf in
the first place ...

Cheers,
Andre.

> ---
>  builtin-run.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/builtin-run.c b/builtin-run.c
> index 443c10b..82e2b2e 100644
> --- a/builtin-run.c
> +++ b/builtin-run.c
> @@ -512,12 +512,13 @@ 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);
> +		if (!kvm->cfg.kernel_filename) {
> +			kernel_usage_with_options();
> +			return ERR_PTR(-EINVAL);
> +		}
>  	}
>  
>  	kvm->cfg.vmlinux_filename = find_vmlinux();
> @@ -639,10 +640,17 @@ static struct kvm *kvm_cmd_run_init(int argc,
> const char **argv) 
>  	kvm->cfg.real_cmdline = real_cmdline;
>  
> -	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);
> +	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");

  reply	other threads:[~2018-12-12 18:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 11:14 [PATCH kvmtool 0/6] arm: Add support for firmware booting Julien Thierry
2018-12-04 11:14 ` [PATCH kvmtool 1/6] rtc: Initialize the Register D for MC146818 RTC Julien Thierry
2018-12-12 18:16   ` Andre Przywara
2018-12-14 18:58     ` Sami Mujawar
2018-12-04 11:14 ` [PATCH kvmtool 2/6] arm: Move firmware function Julien Thierry
2018-12-12 18:16   ` Andre Przywara
2018-12-04 11:14 ` [PATCH kvmtool 3/6] builtin-run: Do not look for default kernel when firmware is provided Julien Thierry
2018-12-12 18:16   ` Andre Przywara [this message]
2018-12-04 11:14 ` [PATCH kvmtool 4/6] arm: Support firmware loading Julien Thierry
2018-12-14 18:08   ` Andre Przywara
2018-12-17 10:05     ` Julien Thierry
2018-12-17 12:01       ` André Przywara
2018-12-04 11:14 ` [PATCH kvmtool 5/6] kvm: Add arch specific reset Julien Thierry
2018-12-14 18:11   ` Andre Przywara
2018-12-17 10:25     ` Julien Thierry
2018-12-04 11:14 ` [PATCH kvmtool 6/6] arm: Support non-volatile memory Julien Thierry
2018-12-14 18:09   ` Andre Przywara
2018-12-17 10:31     ` Julien Thierry
2018-12-17 12:04       ` André Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181212181623.00007bb0@donnerap.cambridge.arm.com \
    --to=andre.przywara@arm.com \
    --cc=Sami.Mujawar@arm.com \
    --cc=julien.thierry@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox