1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-02 04:22:02 +03:00

Add lvm_pv_get_property() generic function to obtain value of any pv property.

Add a generic PV property function to lvm2app, similar to VG function.
Return lvm_property_value and require caller to check 'is_valid' flag
before using the value.  If 'is_valid' is not set, then lvm_errno()
should be used to obtain the specific error.
This commit is contained in:
Dave Wysochanski
2010-10-25 14:08:55 +00:00
parent 3c1febe0a8
commit 4e92d7c9ae
2 changed files with 44 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include "lvm2app.h"
#include "metadata.h"
#include "lvm-string.h"
#include "lvm_misc.h"
const char *lvm_pv_get_uuid(const pv_t pv)
{
@ -48,6 +49,11 @@ uint64_t lvm_pv_get_free(const pv_t pv)
return (uint64_t) SECTOR_SIZE * pv_free(pv);
}
struct lvm_property_value lvm_pv_get_property(const pv_t pv, const char *name)
{
return get_property(pv, NULL, NULL, name);
}
int lvm_pv_resize(const pv_t pv, uint64_t new_size)
{
/* FIXME: add pv resize code here */