]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Create macro for "file" option
authorJohn Ferlan <jferlan@redhat.com>
Wed, 25 Nov 2015 14:08:54 +0000 (09:08 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 17 Dec 2015 16:56:18 +0000 (11:56 -0500)
Rather than continually cut/paste the "file" option for pool command
option structures, generate a macro which will commonly define it for
any command.  Then of course use that macro.

tools/virsh-pool.c

index 28a525cc1d01cfd941fb25966f397346098280cb..06f69d81783ce0f60ac8ba7dd8f226b89585a9fb 100644 (file)
      .help = N_("pool name or uuid")                          \
     }                                                         \
 
+#define VSH_POOL_FILE_OPT_COMMON                              \
+    {.name = "file",                                          \
+     .type = VSH_OT_DATA,                                     \
+     .flags = VSH_OFLAG_REQ,                                  \
+     .help = N_("file containing an XML pool description")    \
+    }                                                         \
+
 virStoragePoolPtr
 virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
                       const char **name, unsigned int flags)
@@ -145,11 +152,8 @@ static const vshCmdInfo info_pool_create[] = {
 };
 
 static const vshCmdOptDef opts_pool_create[] = {
-    {.name = "file",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("file containing an XML pool description")
-    },
+    VSH_POOL_FILE_OPT_COMMON,
+
     {.name = NULL}
 };
 
@@ -410,11 +414,8 @@ static const vshCmdInfo info_pool_define[] = {
 };
 
 static const vshCmdOptDef opts_pool_define[] = {
-    {.name = "file",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("file containing an XML pool description")
-    },
+    VSH_POOL_FILE_OPT_COMMON,
+
     {.name = NULL}
 };