[libvirt] [PATCH 06/13] virsh-interface.c: Switch to c99 initialization of vshCmdInfo

Michal Privoznik mprivozn at redhat.com
Thu Feb 7 16:51:50 UTC 2013


---
 tools/virsh-interface.c | 142 +++++++++++++++++++++++++++++++++---------------
 1 file changed, 99 insertions(+), 43 deletions(-)

diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c
index 3a6eb95..445ca17 100644
--- a/tools/virsh-interface.c
+++ b/tools/virsh-interface.c
@@ -83,9 +83,13 @@ vshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd,
  * "iface-edit" command
  */
 static const vshCmdInfo info_interface_edit[] = {
-    {"help", N_("edit XML configuration for a physical host interface")},
-    {"desc", N_("Edit the XML configuration for a physical host interface.")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("edit XML configuration for a physical host interface")
+    },
+    {.name = "desc",
+     .data = N_("Edit the XML configuration for a physical host interface.")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_edit[] = {
@@ -309,9 +313,13 @@ cleanup:
  * "iface-list" command
  */
 static const vshCmdInfo info_interface_list[] = {
-    {"help", N_("list physical host interfaces")},
-    {"desc", N_("Returns list of physical host interfaces.")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("list physical host interfaces")
+    },
+    {.name = "desc",
+     .data = N_("Returns list of physical host interfaces.")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_list[] = {
@@ -367,9 +375,13 @@ cmdInterfaceList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
  * "iface-name" command
  */
 static const vshCmdInfo info_interface_name[] = {
-    {"help", N_("convert an interface MAC address to interface name")},
-    {"desc", ""},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("convert an interface MAC address to interface name")
+    },
+    {.name = "desc",
+     .data = ""
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_name[] = {
@@ -399,9 +411,13 @@ cmdInterfaceName(vshControl *ctl, const vshCmd *cmd)
  * "iface-mac" command
  */
 static const vshCmdInfo info_interface_mac[] = {
-    {"help", N_("convert an interface name to interface MAC address")},
-    {"desc", ""},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("convert an interface name to interface MAC address")
+    },
+    {.name = "desc",
+     .data = ""
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_mac[] = {
@@ -431,9 +447,13 @@ cmdInterfaceMAC(vshControl *ctl, const vshCmd *cmd)
  * "iface-dumpxml" command
  */
 static const vshCmdInfo info_interface_dumpxml[] = {
-    {"help", N_("interface information in XML")},
-    {"desc", N_("Output the physical host interface information as an XML dump to stdout.")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("interface information in XML")
+    },
+    {.name = "desc",
+     .data = N_("Output the physical host interface information as an XML dump to stdout.")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_dumpxml[] = {
@@ -481,9 +501,13 @@ cmdInterfaceDumpXML(vshControl *ctl, const vshCmd *cmd)
  * "iface-define" command
  */
 static const vshCmdInfo info_interface_define[] = {
-    {"help", N_("define (but don't start) a physical host interface from an XML file")},
-    {"desc", N_("Define a physical host interface.")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("define (but don't start) a physical host interface from an XML file")
+    },
+    {.name = "desc",
+     .data = N_("Define a physical host interface.")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_define[] = {
@@ -527,9 +551,13 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd)
  * "iface-undefine" command
  */
 static const vshCmdInfo info_interface_undefine[] = {
-    {"help", N_("undefine a physical host interface (remove it from configuration)")},
-    {"desc", N_("undefine an interface.")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("undefine a physical host interface (remove it from configuration)")
+    },
+    {.name = "desc",
+     .data = N_("undefine an interface.")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_undefine[] = {
@@ -566,9 +594,13 @@ cmdInterfaceUndefine(vshControl *ctl, const vshCmd *cmd)
  * "iface-start" command
  */
 static const vshCmdInfo info_interface_start[] = {
-    {"help", N_("start a physical host interface (enable it / \"if-up\")")},
-    {"desc", N_("start a physical host interface.")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("start a physical host interface (enable it / \"if-up\")")
+    },
+    {.name = "desc",
+     .data = N_("start a physical host interface.")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_start[] = {
@@ -605,9 +637,13 @@ cmdInterfaceStart(vshControl *ctl, const vshCmd *cmd)
  * "iface-destroy" command
  */
 static const vshCmdInfo info_interface_destroy[] = {
-    {"help", N_("destroy a physical host interface (disable it / \"if-down\")")},
-    {"desc", N_("forcefully stop a physical host interface.")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("destroy a physical host interface (disable it / \"if-down\")")
+    },
+    {.name = "desc",
+     .data = N_("forcefully stop a physical host interface.")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_destroy[] = {
@@ -644,11 +680,15 @@ cmdInterfaceDestroy(vshControl *ctl, const vshCmd *cmd)
  * "iface-begin" command
  */
 static const vshCmdInfo info_interface_begin[] = {
-    {"help", N_("create a snapshot of current interfaces settings, "
+    {.name = "help",
+     .data = N_("create a snapshot of current interfaces settings, "
                 "which can be later committed (iface-commit) or "
-                "restored (iface-rollback)")},
-    {"desc", N_("Create a restore point for interfaces settings")},
-    {NULL, NULL}
+                "restored (iface-rollback)")
+    },
+    {.name = "desc",
+     .data = N_("Create a restore point for interfaces settings")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_begin[] = {
@@ -671,9 +711,13 @@ cmdInterfaceBegin(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
  * "iface-commit" command
  */
 static const vshCmdInfo info_interface_commit[] = {
-    {"help", N_("commit changes made since iface-begin and free restore point")},
-    {"desc", N_("commit changes and free restore point")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("commit changes made since iface-begin and free restore point")
+    },
+    {.name = "desc",
+     .data = N_("commit changes and free restore point")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_commit[] = {
@@ -696,9 +740,13 @@ cmdInterfaceCommit(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
  * "iface-rollback" command
  */
 static const vshCmdInfo info_interface_rollback[] = {
-    {"help", N_("rollback to previous saved configuration created via iface-begin")},
-    {"desc", N_("rollback to previous restore point")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("rollback to previous saved configuration created via iface-begin")
+    },
+    {.name = "desc",
+     .data = N_("rollback to previous restore point")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_rollback[] = {
@@ -721,9 +769,13 @@ cmdInterfaceRollback(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
  * "iface-bridge" command
  */
 static const vshCmdInfo info_interface_bridge[] = {
-    {"help", N_("create a bridge device and attach an existing network device to it")},
-    {"desc", N_("bridge an existing network device")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("create a bridge device and attach an existing network device to it")
+    },
+    {.name = "desc",
+     .data = N_("bridge an existing network device")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_bridge[] = {
@@ -956,9 +1008,13 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd)
  * "iface-unbridge" command
  */
 static const vshCmdInfo info_interface_unbridge[] = {
-    {"help", N_("undefine a bridge device after detaching its slave device")},
-    {"desc", N_("unbridge a network device")},
-    {NULL, NULL}
+    {.name = "help",
+     .data = N_("undefine a bridge device after detaching its slave device")
+    },
+    {.name = "desc",
+     .data = N_("unbridge a network device")
+    },
+    {.name = NULL}
 };
 
 static const vshCmdOptDef opts_interface_unbridge[] = {
-- 
1.8.0.2




More information about the libvir-list mailing list