]> xenbits.xensource.com Git - libvirt.git/commitdiff
virt-admin: Add some command aliases to provide syntax sugar over ugly commands
authorErik Skultety <eskultet@redhat.com>
Wed, 7 Sep 2016 15:27:52 +0000 (17:27 +0200)
committerErik Skultety <eskultet@redhat.com>
Tue, 20 Sep 2016 13:17:46 +0000 (15:17 +0200)
Make use of the new recently introduced alias handling for virt-admin srv-*
commands.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
tools/virt-admin.c
tools/virt-admin.pod

index 36c92f5aefcde6596bbdf3d9a6a3fbe9e81bc052..b749acbf727a94f1d85c36ad47830dbfc3b5b1bb 100644 (file)
@@ -1266,18 +1266,30 @@ static const vshCmdDef vshAdmCmds[] = {
 
 static const vshCmdDef monitoringCmds[] = {
     {.name = "srv-list",
+     .flags = VSH_CMD_FLAG_ALIAS,
+     .alias = "server-list"
+    },
+    {.name = "server-list",
      .handler = cmdSrvList,
      .opts = NULL,
      .info = info_srv_list,
      .flags = 0
     },
     {.name = "srv-threadpool-info",
+     .flags = VSH_CMD_FLAG_ALIAS,
+     .alias = "server-threadpool-info"
+    },
+    {.name = "server-threadpool-info",
      .handler = cmdSrvThreadpoolInfo,
      .opts = opts_srv_threadpool_info,
      .info = info_srv_threadpool_info,
      .flags = 0
     },
     {.name = "srv-clients-list",
+     .flags = VSH_CMD_FLAG_ALIAS,
+     .alias = "client-list"
+    },
+    {.name = "client-list",
      .handler = cmdSrvClientsList,
      .opts = opts_srv_clients_list,
      .info = info_srv_clients_list,
@@ -1290,6 +1302,10 @@ static const vshCmdDef monitoringCmds[] = {
      .flags = 0
     },
     {.name = "srv-clients-info",
+     .flags = VSH_CMD_FLAG_ALIAS,
+     .alias = "server-clients-info"
+    },
+    {.name = "server-clients-info",
      .handler = cmdSrvClientsInfo,
      .opts = opts_srv_clients_info,
      .info = info_srv_clients_info,
@@ -1300,6 +1316,10 @@ static const vshCmdDef monitoringCmds[] = {
 
 static const vshCmdDef managementCmds[] = {
     {.name = "srv-threadpool-set",
+     .flags = VSH_CMD_FLAG_ALIAS,
+     .alias = "server-threadpool-set"
+    },
+    {.name = "server-threadpool-set",
      .handler = cmdSrvThreadpoolSet,
      .opts = opts_srv_threadpool_set,
      .info = info_srv_threadpool_set,
@@ -1312,6 +1332,10 @@ static const vshCmdDef managementCmds[] = {
      .flags = 0
     },
     {.name = "srv-clients-set",
+     .flags = VSH_CMD_FLAG_ALIAS,
+     .alias = "server-clients-set"
+    },
+    {.name = "server-clients-set",
      .handler = cmdSrvClientsSet,
      .opts = opts_srv_clients_set,
      .info = info_srv_clients_set,
index 020eb5152b3a02b4fdbaa282ec7515622b9e43cc..443730ebf5e8b011b92095d31fdc64788216b89c 100644 (file)
@@ -150,7 +150,7 @@ change its internal configuration.
 
 =over 4
 
-=item B<srv-list>
+=item B<server-list>
 
 Lists all manageable servers contained within the daemon the client is
 currently connected to.
@@ -164,7 +164,7 @@ The I<server> is specified by its name.
 
 =over 4
 
-=item B<srv-threadpool-info> I<server>
+=item B<server-threadpool-info> I<server>
 
 Retrieve server's threadpool attributes. These attributes include:
 
@@ -207,11 +207,11 @@ control and libvirt guarantees that such a task cannot hang, thus will always
 finish. An example of such a task this would be destroying a domain:
     $ virsh destroy <domain>.
 
-=item B<srv-threadpool-set> I<server> [I<--min-workers> B<count>]
+=item B<server-threadpool-set> I<server> [I<--min-workers> B<count>]
 [I<--max-workers> B<count>] [I<--priority-workers> B<count>]
 
 Change threadpool attributes on a server. Only a fraction of all attributes as
-described in I<srv-threadpool-info> is supported for the setter.
+described in I<server-threadpool-info> is supported for the setter.
 
 =over 4
 
@@ -232,14 +232,7 @@ The current number of active priority workers in a threadpool.
 
 =back
 
-=item B<srv-clients-list> I<server>
-
-Print a table showing the list of clients connected to <server>, also providing
-information about transport type used on client's connection (supported
-transports include B<unix>, B<tcp>, and B<tls>), as well as providing
-information about client's connection time (system local time is used).
-
-=item B<srv-clients-info> I<server>
+=item B<server-clients-info> I<server>
 
 Get information about the current setting of limits regarding connections of new
 clients. This information comprises of the limits to the maximum number of
@@ -249,13 +242,13 @@ runtime values, more specifically, the current number of clients connected to
 I<server> and the current number of clients waiting for authentication.
 
 B<Example>
-    # virt-admin srv-clients-info libvirtd
+    # virt-admin server-clients-info libvirtd
     nclients_max        : 120
     nclients            : 3
     nclients_unauth_max : 20
     nclients_unauth     : 0
 
-=item B<srv-clients-set> I<server> [I<--max-clients> B<count>]
+=item B<server-clients-set> I<server> [I<--max-clients> B<count>]
 [I<--max-unauth-clients> B<count>]
 
 Set new client-related limits on I<server>.
@@ -284,10 +277,17 @@ I<--max-clients>.
 The following commands provide management and monitoring of clients connected to
 one of daemon's available servers. Clients are specified by their numeric ID
 which is obtained by listing all clients connected to a specified server
-(see command B<srv-clients-list>).
+(see command B<client-list>).
 
 =over 4
 
+=item B<client-list> I<server>
+
+Print a table showing the list of clients connected to <server>, also providing
+information about transport type used on client's connection (supported
+transports include B<unix>, B<tcp>, and B<tls>), as well as providing
+information about client's connection time (system local time is used).
+
 =item B<client-info> I<server> I<client>
 
 Retrieve identity information about I<client> from I<server>. The attributes