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

Wido den Hollander wido at widodh.nl
Thu Sep 12 08:31:41 UTC 2013


On 08/30/2013 12:30 PM, Wido den Hollander wrote:
> RBD images are always in RAW format and should be displayed that way
>

Did anyone get the chance yet to review it?

Thanks!

Wido

> Signed-off-by: Wido den Hollander <wido at widodh.nl>
> ---
>   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",
>




More information about the libvir-list mailing list