|
|
c401cc |
From 4e9c6305c18f2501c21fef08c9b9589ef87dce1f Mon Sep 17 00:00:00 2001
|
|
|
c401cc |
Message-Id: <4e9c6305c18f2501c21fef08c9b9589ef87dce1f@dist-git>
|
|
|
c401cc |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
c401cc |
Date: Wed, 26 Feb 2014 14:55:14 +0100
|
|
|
c401cc |
Subject: [PATCH] storage: Add gluster pool filter and fix virsh pool listing
|
|
|
c401cc |
|
|
|
c401cc |
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
|
|
|
c401cc |
|
|
|
c401cc |
Recent addition of the gluster pool type omitted fixing the virsh and
|
|
|
c401cc |
virConnectListAllStoragePool filters. A typecast of the converting
|
|
|
c401cc |
function in virsh showed that also the sheepdog pool was omitted in the
|
|
|
c401cc |
command parser.
|
|
|
c401cc |
|
|
|
c401cc |
This patch adds gluster pool filtering support and fixes virsh to
|
|
|
c401cc |
properly convert all supported storage pool types. The added typecast
|
|
|
c401cc |
should avoid doing such mistakes in the future.
|
|
|
c401cc |
|
|
|
c401cc |
(cherry picked from commit b560946c19dfdf1ab04ad01baf4cf9624e6399cc)
|
|
|
c401cc |
|
|
|
c401cc |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
c401cc |
---
|
|
|
c401cc |
include/libvirt/libvirt.h.in | 1 +
|
|
|
c401cc |
src/conf/storage_conf.c | 4 +++-
|
|
|
c401cc |
tools/virsh-pool.c | 10 ++++++++--
|
|
|
c401cc |
tools/virsh.pod | 2 +-
|
|
|
c401cc |
4 files changed, 13 insertions(+), 4 deletions(-)
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
|
|
|
c401cc |
index 4e98bcc..3cacfcd 100644
|
|
|
c401cc |
--- a/include/libvirt/libvirt.h.in
|
|
|
c401cc |
+++ b/include/libvirt/libvirt.h.in
|
|
|
c401cc |
@@ -3042,6 +3042,7 @@ typedef enum {
|
|
|
c401cc |
VIR_CONNECT_LIST_STORAGE_POOLS_MPATH = 1 << 13,
|
|
|
c401cc |
VIR_CONNECT_LIST_STORAGE_POOLS_RBD = 1 << 14,
|
|
|
c401cc |
VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG = 1 << 15,
|
|
|
c401cc |
+ VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER = 1 << 16,
|
|
|
c401cc |
} virConnectListAllStoragePoolsFlags;
|
|
|
c401cc |
|
|
|
c401cc |
int virConnectListAllStoragePools(virConnectPtr conn,
|
|
|
c401cc |
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
|
|
|
c401cc |
index e64b331..8f9d820 100644
|
|
|
c401cc |
--- a/src/conf/storage_conf.c
|
|
|
c401cc |
+++ b/src/conf/storage_conf.c
|
|
|
c401cc |
@@ -2217,7 +2217,9 @@ virStoragePoolMatch(virStoragePoolObjPtr poolobj,
|
|
|
c401cc |
(MATCH(VIR_CONNECT_LIST_STORAGE_POOLS_RBD) &&
|
|
|
c401cc |
(poolobj->def->type == VIR_STORAGE_POOL_RBD)) ||
|
|
|
c401cc |
(MATCH(VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG) &&
|
|
|
c401cc |
- (poolobj->def->type == VIR_STORAGE_POOL_SHEEPDOG))))
|
|
|
c401cc |
+ (poolobj->def->type == VIR_STORAGE_POOL_SHEEPDOG)) ||
|
|
|
c401cc |
+ (MATCH(VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER) &&
|
|
|
c401cc |
+ (poolobj->def->type == VIR_STORAGE_POOL_GLUSTER))))
|
|
|
c401cc |
return false;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
|
|
|
c401cc |
index e52d676..0aaee43 100644
|
|
|
c401cc |
--- a/tools/virsh-pool.c
|
|
|
c401cc |
+++ b/tools/virsh-pool.c
|
|
|
c401cc |
@@ -1006,7 +1006,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|
|
c401cc |
return false;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
- switch (poolType) {
|
|
|
c401cc |
+ switch ((enum virStoragePoolType) poolType) {
|
|
|
c401cc |
case VIR_STORAGE_POOL_DIR:
|
|
|
c401cc |
flags |= VIR_CONNECT_LIST_STORAGE_POOLS_DIR;
|
|
|
c401cc |
break;
|
|
|
c401cc |
@@ -1034,7 +1034,13 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|
|
c401cc |
case VIR_STORAGE_POOL_RBD:
|
|
|
c401cc |
flags |= VIR_CONNECT_LIST_STORAGE_POOLS_RBD;
|
|
|
c401cc |
break;
|
|
|
c401cc |
- default:
|
|
|
c401cc |
+ case VIR_STORAGE_POOL_SHEEPDOG:
|
|
|
c401cc |
+ flags |= VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG;
|
|
|
c401cc |
+ break;
|
|
|
c401cc |
+ case VIR_STORAGE_POOL_GLUSTER:
|
|
|
c401cc |
+ flags |= VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER;
|
|
|
c401cc |
+ break;
|
|
|
c401cc |
+ case VIR_STORAGE_POOL_LAST:
|
|
|
c401cc |
break;
|
|
|
c401cc |
}
|
|
|
c401cc |
}
|
|
|
c401cc |
diff --git a/tools/virsh.pod b/tools/virsh.pod
|
|
|
c401cc |
index e866217..f1b09d9 100644
|
|
|
c401cc |
--- a/tools/virsh.pod
|
|
|
c401cc |
+++ b/tools/virsh.pod
|
|
|
c401cc |
@@ -2584,7 +2584,7 @@ with autostarting disabled.
|
|
|
c401cc |
You may also want to list pools with specified types using I<type>, the
|
|
|
c401cc |
pool types must be separated by comma, e.g. --type dir,disk. The valid pool
|
|
|
c401cc |
types include 'dir', 'fs', 'netfs', 'logical', 'disk', 'iscsi', 'scsi',
|
|
|
c401cc |
-'mpath', 'rbd', and 'sheepdog'.
|
|
|
c401cc |
+'mpath', 'rbd', 'sheepdog' and 'gluster'.
|
|
|
c401cc |
|
|
|
c401cc |
The I<--details> option instructs virsh to additionally
|
|
|
c401cc |
display pool persistence and capacity related information where available.
|
|
|
c401cc |
--
|
|
|
c401cc |
1.9.0
|
|
|
c401cc |
|