public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console'
@ 2011-05-11 18:01 Pekka Enberg
  2011-05-11 18:01 ` [PATCH 2/2] kvm tools: Print out important command line options at startup Pekka Enberg
  2011-05-12  1:09 ` [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console' Asias He
  0 siblings, 2 replies; 5+ messages in thread
From: Pekka Enberg @ 2011-05-11 18:01 UTC (permalink / raw)
  To: kvm
  Cc: Pekka Enberg, Asias He, Avi Kivity, Cyrill Gorcunov, Ingo Molnar,
	Prasad Joshi, Sasha Levin

This patch changes the '-c' command line option to specify the number of CPUs
because it's used more often than console switching.

Cc: Asias He <asias.hejun@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
 tools/kvm/kvm-run.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/kvm-run.c b/tools/kvm/kvm-run.c
index 829b33f..9b5176f 100644
--- a/tools/kvm/kvm-run.c
+++ b/tools/kvm/kvm-run.c
@@ -97,10 +97,10 @@ static int img_name_parser(const struct option *opt, const char *arg, int unset)
 
 static const struct option options[] = {
 	OPT_GROUP("Basic options:"),
-	OPT_INTEGER('\0', "cpus", &nrcpus, "Number of CPUs"),
+	OPT_INTEGER('c', "cpus", &nrcpus, "Number of CPUs"),
 	OPT_U64('m', "mem", &ram_size, "Virtual machine memory size in MiB."),
 	OPT_CALLBACK('i', "image", NULL, "image", "Disk image", img_name_parser),
-	OPT_STRING('c', "console", &console, "serial or virtio",
+	OPT_STRING('\0', "console", &console, "serial or virtio",
 			"Console to use"),
 	OPT_BOOLEAN('\0', "virtio-rng", &virtio_rng,
 			"Enable virtio Random Number Generator"),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] kvm tools: Print out important command line options at startup
  2011-05-11 18:01 [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console' Pekka Enberg
@ 2011-05-11 18:01 ` Pekka Enberg
  2011-05-12  1:09 ` [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console' Asias He
  1 sibling, 0 replies; 5+ messages in thread
From: Pekka Enberg @ 2011-05-11 18:01 UTC (permalink / raw)
  To: kvm
  Cc: Pekka Enberg, Asias He, Avi Kivity, Cyrill Gorcunov, Ingo Molnar,
	Prasad Joshi, Sasha Levin

It's important to know what the guest configuration looks like when debugging
issues so print out important command line options at startup:

  $ ./kvm run -k ../../arch/x86/boot/bzImage -m 512
    # kvm run -k ../../arch/x86/boot/bzImage -m 512 -c 1

Suggested-by: Ingo Molnar <mingo@elte.hu>
Cc: Asias He <asias.hejun@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
 tools/kvm/kvm-run.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/kvm-run.c b/tools/kvm/kvm-run.c
index 9b5176f..5b56779 100644
--- a/tools/kvm/kvm-run.c
+++ b/tools/kvm/kvm-run.c
@@ -476,6 +476,8 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 	}
 	free(hi);
 
+	printf("  # kvm run -k %s -m %Lu -c %d\n", kernel_filename, ram_size / 1023 / 1024, nrcpus);
+
 	if (!kvm__load_kernel(kvm, kernel_filename, initrd_filename,
 				real_cmdline))
 		die("unable to load kernel %s", kernel_filename);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console'
  2011-05-11 18:01 [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console' Pekka Enberg
  2011-05-11 18:01 ` [PATCH 2/2] kvm tools: Print out important command line options at startup Pekka Enberg
@ 2011-05-12  1:09 ` Asias He
  2011-05-12  7:17   ` Ingo Molnar
  1 sibling, 1 reply; 5+ messages in thread
From: Asias He @ 2011-05-12  1:09 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: kvm, Avi Kivity, Cyrill Gorcunov, Ingo Molnar, Prasad Joshi,
	Sasha Levin

On 05/12/2011 02:01 AM, Pekka Enberg wrote:
> This patch changes the '-c' command line option to specify the number of CPUs
> because it's used more often than console switching.

I'd like to tune the command line option further.

1)
Change
    -i, --image <image>   Disk image
to
    -d, --disk  <disk>	  Disk image
2)
Change
    -r, --initrd <initrd>
                          Initial RAM disk image
to
    -i, --initrd <initrd>
                          Initial RAM disk image
3)
Change
    -d, --kvm-dev <kvm-dev>
                          KVM device file
    -s, --single-step     Enable single stepping
    -g, --ioport-debug    Enable ioport debugging
to
        --kvm-dev <kvm-dev>
                          KVM device file
        --single-step     Enable single stepping
        --ioport-debug    Enable ioport debugging
.

So we can have
	-c --cpus
	-m --mem
	-d --disk
	-k --kernel
	-i --initrd
which is more consistent and easy to remember.


-- 
Best Regards,
Asias He

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console'
  2011-05-12  1:09 ` [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console' Asias He
@ 2011-05-12  7:17   ` Ingo Molnar
  2011-05-12 13:20     ` Asias He
  0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2011-05-12  7:17 UTC (permalink / raw)
  To: Asias He
  Cc: Pekka Enberg, kvm, Avi Kivity, Cyrill Gorcunov, Prasad Joshi,
	Sasha Levin


* Asias He <asias.hejun@gmail.com> wrote:

> On 05/12/2011 02:01 AM, Pekka Enberg wrote:
> > This patch changes the '-c' command line option to specify the number of CPUs
> > because it's used more often than console switching.
> 
> I'd like to tune the command line option further.
> 
> 1)
> Change
>     -i, --image <image>   Disk image
> to
>     -d, --disk  <disk>	  Disk image

Agreed.

> 2)
> Change
>     -r, --initrd <initrd>
>                           Initial RAM disk image
> to
>     -i, --initrd <initrd>
>                           Initial RAM disk image

Agreed.

> 3)
> Change
>     -d, --kvm-dev <kvm-dev>
>                           KVM device file
>     -s, --single-step     Enable single stepping
>     -g, --ioport-debug    Enable ioport debugging
> to
>         --kvm-dev <kvm-dev>
>                           KVM device file
>         --single-step     Enable single stepping
>         --ioport-debug    Enable ioport debugging

Yeah, it would be nice to free up -d, -s, -g.

The debug options should probably be concentrated under a --debug option 
anyway, to allow things like:

 --debug single-step,ioport

Even if the debug options are kept they should be streamlined along the same 
pattern:

>         --debug-single-step     Enable single stepping
>         --debug-ioport          Enable ioport debugging

But having a --debug option that recognizes all the debug flags would be nicer.

It would also allow future enhancements to group debug features, like:

  --debug all                # turn on everything and the kitchen sink for early hangs
  --debug all,-single-step   # turn on everything except single-step debugging
  --debug nonverbose         # turn on all non-noisy debug options we have

Maybe even:

  --debug memcheck

... could run kvm under valgrind automatically - that way we can hide any 
secondary tool complexities from the user and turn those tools into simple 
debug options :-)

etc.

> So we can have
> 	-c --cpus
> 	-m --mem
> 	-d --disk
> 	-k --kernel
> 	-i --initrd
> which is more consistent and easy to remember.

Very nice plans!

The sooner we do this the fewer people will have to change their scripts and 
practices.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console'
  2011-05-12  7:17   ` Ingo Molnar
@ 2011-05-12 13:20     ` Asias He
  0 siblings, 0 replies; 5+ messages in thread
From: Asias He @ 2011-05-12 13:20 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Pekka Enberg, kvm, Avi Kivity, Cyrill Gorcunov, Prasad Joshi,
	Sasha Levin

On 05/12/2011 03:17 PM, Ingo Molnar wrote:
> 
> * Asias He <asias.hejun@gmail.com> wrote:
> 
>> On 05/12/2011 02:01 AM, Pekka Enberg wrote:
>>> This patch changes the '-c' command line option to specify the number of CPUs
>>> because it's used more often than console switching.
>>
>> I'd like to tune the command line option further.
>>
>> 1)
>> Change
>>     -i, --image <image>   Disk image
>> to
>>     -d, --disk  <disk>	  Disk image
> 
> Agreed.
> 
>> 2)
>> Change
>>     -r, --initrd <initrd>
>>                           Initial RAM disk image
>> to
>>     -i, --initrd <initrd>
>>                           Initial RAM disk image
> 
> Agreed.
> 
>> 3)
>> Change
>>     -d, --kvm-dev <kvm-dev>
>>                           KVM device file
>>     -s, --single-step     Enable single stepping
>>     -g, --ioport-debug    Enable ioport debugging
>> to
>>         --kvm-dev <kvm-dev>
>>                           KVM device file
>>         --single-step     Enable single stepping
>>         --ioport-debug    Enable ioport debugging
> 
> Yeah, it would be nice to free up -d, -s, -g.
> 
> The debug options should probably be concentrated under a --debug option 
> anyway, to allow things like:
> 
>  --debug single-step,ioport
> 
> Even if the debug options are kept they should be streamlined along the same 
> pattern:
> 
>>         --debug-single-step     Enable single stepping
>>         --debug-ioport          Enable ioport debugging
> 
> But having a --debug option that recognizes all the debug flags would be nicer.
> 
> It would also allow future enhancements to group debug features, like:
> 
>   --debug all                # turn on everything and the kitchen sink for early hangs
>   --debug all,-single-step   # turn on everything except single-step debugging
>   --debug nonverbose         # turn on all non-noisy debug options we have
> 
> Maybe even:
> 
>   --debug memcheck
> 
> ... could run kvm under valgrind automatically - that way we can hide any 
> secondary tool complexities from the user and turn those tools into simple 
> debug options :-)

Great idea.

> 
> etc.
> 
>> So we can have
>> 	-c --cpus
>> 	-m --mem
>> 	-d --disk
>> 	-k --kernel
>> 	-i --initrd
>> which is more consistent and easy to remember.
> 
> Very nice plans!
> 
> The sooner we do this the fewer people will have to change their scripts and 
> practices.

Sure! I will cook a patch.

-- 
Best Regards,
Asias He

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-12 13:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-11 18:01 [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console' Pekka Enberg
2011-05-11 18:01 ` [PATCH 2/2] kvm tools: Print out important command line options at startup Pekka Enberg
2011-05-12  1:09 ` [PATCH 1/2] kvm tools: Use '-c' for '--cpus', not '--console' Asias He
2011-05-12  7:17   ` Ingo Molnar
2011-05-12 13:20     ` Asias He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox