[libvirt] [PATCH 3/3] Add virsh option for format flags

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

 



---
 tools/virsh.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index bd6b6be..de8c67d 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -4015,6 +4015,7 @@ static const vshCmdInfo info_pool_build[] = {

 static const vshCmdOptDef opts_pool_build[] = {
     {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("pool name or uuid")},
+    {"format", VSH_OT_BOOL, 0, gettext_noop("format the pool (destructive)")},
     {NULL, 0, 0, NULL}
 };

@@ -4023,6 +4024,7 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd)
 {
     virStoragePoolPtr pool;
     int ret = TRUE;
+    int flags = 0;
     char *name;

     if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
@@ -4031,7 +4033,10 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd)
     if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
         return FALSE;

-    if (virStoragePoolBuild(pool, 0) == 0) {
+    if (vshCommandOptBool (cmd, "format"))
+        flags |= VIR_STORAGE_POOL_CREATE_FORMAT;
+
+    if (virStoragePoolBuild(pool, flags) == 0) {
         vshPrint(ctl, _("Pool %s built\n"), name);
     } else {
         vshError(ctl, _("Failed to build pool %s"), name);
-- 
1.6.5.5

--
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]