[PATCH] rbd: Use different formatter to display disk format

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

 



RBD images are always in RAW format and should be displayed that way

Signed-off-by: Wido den Hollander <wido@xxxxxxxxx>
---
 src/conf/storage_conf.c           |    3 ++-
 src/storage/storage_backend_rbd.c |    2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 002663f..e54fc64 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -230,7 +230,8 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
       },
       .volOptions = {
           .defaultFormat = VIR_STORAGE_FILE_RAW,
-          .formatToString = virStoragePoolFormatDiskTypeToString,
+          .formatFromString = virStorageVolumeFormatFromString,
+          .formatToString = virStorageFileFormatTypeToString,
       }
     },
     {.poolType = VIR_STORAGE_POOL_SHEEPDOG,
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index e5d720e..c435636 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -32,6 +32,7 @@
 #include "base64.h"
 #include "viruuid.h"
 #include "virstring.h"
+#include "virstoragefile.h"
 #include "rados/librados.h"
 #include "rbd/librbd.h"
 
@@ -271,6 +272,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
     vol->capacity = info.size;
     vol->allocation = info.obj_size * info.num_objs;
     vol->type = VIR_STORAGE_VOL_NETWORK;
+    vol->target.format = VIR_STORAGE_FILE_RAW;
 
     VIR_FREE(vol->target.path);
     if (virAsprintf(&vol->target.path, "%s/%s",
-- 
1.7.9.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]