qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/5] qdev: Add new '-device help' option, shows


From: Amit Shah
Subject: Re: [Qemu-devel] [PATCH 5/5] qdev: Add new '-device help' option, shows all devices and properties
Date: Tue, 8 Jun 2010 10:43:47 +0530
User-agent: Mutt/1.5.20 (2009-12-10)

On (Mon) Jun 07 2010 [16:43:05], Markus Armbruster wrote:
> 
> There is "-device \?" and "-device help", but the user interface
> provides no clue about the difference between them.
> 
> "-device help" loses when we ever pick up a device model with name
> "help".  Not that "?" was a particularly smart choice...
> 
> Do we really need two kinds of help output?  Where the second is
> basically the same as "-device FOO,\?" for all FOO?  Is that convenience
> worth the extra UI complexity?

OK, so my big plan is to have something like this:

---

./qemu -device help

...
name "virtserialport", bus virtio-serial-bus
        nr=uint32, The 'number' for the port for predictable port numbers.
        chardev=chr, The chardev to associate this port with.
        name=string, Name for the port that's exposed to the guest for port 
discovery.
...

---

./qemu -device virtserialport,?

virtserialport.nr=uint32, The 'number' for the port for predictable port 
numbers.

   Use this to spawn ports if you plan to migrate the guest and perform
   hot-plug and unplug operations.

virtserialport.chardev=chr, The chardev to associate this port with.

   External programs can communicate with the guest side of the channel
   using chardev

virtserialport.name=string, Name for the port that's exposed to the guest for 
port discovery.

   The name is exposed in Linux guests via sysfs and udev rules can be
   written to create symlinks to the ports. Apps in the guest can then
   easily find these ports and start communication.

---

So basically -device help gives a short, one-liner help message and the
-device ? option gives a slightly detailed message, if one is available.

How to do that: I'm thinking of two ways:

1)

    DEFINE_PROP_UINT32("nr", VirtConsole, port.id, VIRTIO_CONSOLE_BAD_ID,
                       "The 'number' for the port for predictable port 
numbers.",
                       "Use this to spawn ports if you plan to migrate the 
guest and perform \n"
                       "hot-plug and unplug operations." ),

ie, two different strings for the short and long descriptions

2)

    DEFINE_PROP_UINT32("nr", VirtConsole, port.id, VIRTIO_CONSOLE_BAD_ID,
                       "The 'number' for the port for predictable port 
numbers.\n"
                       "Use this to spawn ports if you plan to migrate the 
guest and perform \n"
                       "hot-plug and unplug operations." ),

ie, the same string, but the short and long descriptions are separated
by a '\n'.

Doing it the adds parsing to the printing routine for no extra benefit,
so I'm inclined to go with 1. Thoughts?

                Amit



reply via email to

[Prev in Thread] Current Thread [Next in Thread]