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

[libvirt] RFC? finding potential storage pool resources



Hi -

  I'm looking into using (which I think means extending) libvirt to
enumerate "potential" storage pool resources, in particular:
  * existing physical disk device names (for creating "disk" pools)
  * existing logical volume group names (for creating "logical" pools)

Note that List{Defined,Active}StorageGroups don't do the trick.  Suppose
this is a new host and I'm trying to start defining the storage pools
(and I want to be able to use existing volume groups, for example).  I
don't see how to do that within the current libvirt framework.  If I'm
missing something, please let me know (and ignore the rest of this
message ...).

This could be done by adding some new calls like:
   int virConnectListPhysDisks(virConnectPtr conn, char ** const name, int maxnames)
   int virConnectListLogicalVolGroups(virConnectPtr conn, char ** const name, int maxnames)
    ... plus a pair of NumOf functions ...

But these are each storage-driver specific.  For example, if I'm not
using the "logical" storage driver, I have no need (or means) of listing
volume groups.  So maybe it's cleaner to fold these two functions into
one, now parameterized by storage driver type:
  int virConnectListStorageSources(virConnectPtr conn, const char *type, char ** const name, int maxnames)
   ... plus a NumOf function ...
where <type> is one of the supported storage pool types.

So, if <type> is "disk", ListStorageSources acts like ListPhysDisks,
and if <type> is "logical", ListStorageSources acts like ListLogicalVolumeGroups,
(and we return empty lists or some sort of "unsupported" error for any
other types ... can't list all possible network servers, for instance).

What do you all think?

Thanks,
Dave






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