[libvirt] [PATCH 02/50] list: Expose pool type via virStoragePoolGetInfo

Jiri Denemark jdenemar at redhat.com
Fri Jul 20 12:28:26 UTC 2012


On Fri, Jul 20, 2012 at 00:40:33 +0800, Osier Yang wrote:
> Mainly for later patches' use, to filter the pools by pool type.
> 
> include/libvirt/libvirt.h.in: Add enum virStoragePoolType; Add
> pool type to virStoragePoolInfo.
> 
> src/conf/storage_conf.h: Remove enum virStoragePoolType.
> 
> src/storage/storage_driver.c: Expose pool type via storagePoolGetInfo.
> ---
>  include/libvirt/libvirt.h.in |   17 +++++++++++++++++
>  src/conf/storage_conf.h      |   19 -------------------
>  src/storage/storage_driver.c |    2 ++
>  3 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index e34438c..2820b2a 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -2335,6 +2335,22 @@ typedef struct _virStoragePool virStoragePool;
>   */
>  typedef virStoragePool *virStoragePoolPtr;
>  
> +typedef enum {
> +    VIR_STORAGE_POOL_DIR,      /* Local directory */
> +    VIR_STORAGE_POOL_FS,       /* Local filesystem */
> +    VIR_STORAGE_POOL_NETFS,    /* Networked filesystem - eg NFS, GFS, etc */
> +    VIR_STORAGE_POOL_LOGICAL,  /* Logical volume groups / volumes */
> +    VIR_STORAGE_POOL_DISK,     /* Disk partitions */
> +    VIR_STORAGE_POOL_ISCSI,    /* iSCSI targets */
> +    VIR_STORAGE_POOL_SCSI,     /* SCSI HBA */
> +    VIR_STORAGE_POOL_MPATH,    /* Multipath devices */
> +    VIR_STORAGE_POOL_RBD,      /* RADOS Block Device */
> +    VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */
> +
> +#ifdef VIR_ENUM_SENTINELS
> +    VIR_STORAGE_POOL_LAST,
> +#endif
> +} virStoragePoolType;
>  
>  typedef enum {
>      VIR_STORAGE_POOL_INACTIVE = 0, /* Not running */
> @@ -2365,6 +2381,7 @@ typedef enum {
>  typedef struct _virStoragePoolInfo virStoragePoolInfo;
>  
>  struct _virStoragePoolInfo {
> +  int type;                      /* virStoragePoolType */
>    int state;                     /* virStoragePoolState flags */
>    unsigned long long capacity;   /* Logical size bytes */
>    unsigned long long allocation; /* Current allocation bytes */

Oops, you can't change public structs. Any combination of an app and libvirt
library that would not have the same definition of this struct would fail.

Jirka




More information about the libvir-list mailing list