]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Add dir type for listing volumes with vol-list
authorPeter Krempa <pkrempa@redhat.com>
Thu, 11 Aug 2011 09:37:18 +0000 (11:37 +0200)
committerEric Blake <eblake@redhat.com>
Thu, 11 Aug 2011 19:39:20 +0000 (13:39 -0600)
Fix of output of detailed volume list. BZ #727088

tools/virsh.c

index ee08c012059e8043e7ec6cd022ecfc45e57707e8..44a728864c2003aa02f5e21874d629afcd1e3b46 100644 (file)
@@ -8989,10 +8989,19 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
                 /* Convert the returned volume info into output strings */
 
                 /* Volume type */
-                if (volumeInfo.type == VIR_STORAGE_VOL_FILE)
-                    volInfoTexts[i].type = vshStrdup(ctl, _("file"));
-                else
-                    volInfoTexts[i].type = vshStrdup(ctl, _("block"));
+                switch (volumeInfo.type) {
+                        case VIR_STORAGE_VOL_FILE:
+                            volInfoTexts[i].type = vshStrdup(ctl, _("file"));
+                            break;
+                        case VIR_STORAGE_VOL_BLOCK:
+                            volInfoTexts[i].type = vshStrdup(ctl, _("block"));
+                            break;
+                        case VIR_STORAGE_VOL_DIR:
+                            volInfoTexts[i].type = vshStrdup(ctl, _("dir"));
+                            break;
+                        default:
+                            volInfoTexts[i].type = vshStrdup(ctl, _("unknown"));
+                }
 
                 /* Create the capacity output string */
                 val = prettyCapacity(volumeInfo.capacity, &unit);