On 07/04/2011 05:59 PM, Stefan Hajnoczi wrote:
On Mon, Jul 4, 2011 at 11:43 AM, Supriya Kannery
<supri...@linux.vnet.ibm.com>  wrote:

     {
+        .name       = "block_set",
+        .args_type  = "device:B,name:s,enable:b",
+        .params     = "device name enable",

Perhaps:

.args_type  = "device:B,name:s,enable:b?",
.params     = "device name [enable]",

But I am not sure what the best way to express this is.

+        .help       = "Enable/Disable block device params like hostcache",

Arguments (like "enable") should depend on the block parameter that is
being set:

.help = "Set block device parameter"

If there is no good way to support different optional arguments and
types then a json-string "value" argument would be best.


"device_add" is defined and implemented to handle multiple types of
optional arguments. Will work on to see whether that approach
can be adopted for block_set
    {
        .name       = "device_add",
        .args_type  = "device:O",
        .params     = "driver[,prop=value][,...]",
        .help       = "add device, like -device on the command line",
        .user_print = monitor_user_noop,
        .mhandler.cmd_new = do_device_add,
    },




Stefan


Reply via email to