[PATCH 4/6] virsh: Create macro for "overwrite" and no-overwrite" options

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

 



Although not currently used in more than one command, it soon will be
so create a common macro to be used in the new command location.

Additionally, add the ".flags = 0," for both to match the expections
of the structure being predefined.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 tools/virsh-pool.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index 4b4fea0..ff77039 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -47,6 +47,20 @@
      .help = N_("file containing an XML pool description")    \
     },                                                        \
 
+#define OPT_NO_OVERWRITE_COMMON                                   \
+    {.name = "no-overwrite",                                      \
+     .type = VSH_OT_BOOL,                                         \
+     .flags = 0,                                                  \
+     .help = N_("do not overwrite an existing pool of this type") \
+    },                                                            \
+
+#define OPT_OVERWRITE_COMMON                                      \
+    {.name = "overwrite",                                         \
+     .type = VSH_OT_BOOL,                                         \
+     .flags = 0,                                                  \
+     .help = N_("overwrite any existing data")                    \
+    },                                                            \
+
 virStoragePoolPtr
 virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
                       const char **name, unsigned int flags)
@@ -506,15 +520,9 @@ static const vshCmdInfo info_pool_build[] = {
 
 static const vshCmdOptDef opts_pool_build[] = {
     OPT_POOL_COMMON
+    OPT_NO_OVERWRITE_COMMON
+    OPT_OVERWRITE_COMMON
 
-    {.name = "no-overwrite",
-     .type = VSH_OT_BOOL,
-     .help = N_("do not overwrite an existing pool of this type")
-    },
-    {.name = "overwrite",
-     .type = VSH_OT_BOOL,
-     .help = N_("overwrite any existing data")
-    },
     {.name = NULL}
 };
 
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]