mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-23 21:35:29 +03:00
Update lvm_vg_create to use NULL / non-NULL return for the time being.
Some of the error interface is still TBD. Rather than exporting a lot of codes, etc, just use a simple pass / fail. The allows our unit test to not segfault if trying to create a VG that already exists.
This commit is contained in:
parent
c0d270947f
commit
4bc79321a7
@ -110,8 +110,7 @@ const char *lvm_errmsg(lvm_t libh);
|
||||
* \param libh
|
||||
* Handle obtained from lvm_create.
|
||||
*
|
||||
* \return A VG handle with error code set appropriately.
|
||||
* FIXME: Update error handling description after errno and logging patches
|
||||
* \return non-NULL vg handle (success) or NULL (failure)
|
||||
*/
|
||||
vg_t *lvm_vg_create(lvm_t libh, const char *vg_name);
|
||||
|
||||
|
@ -24,7 +24,15 @@
|
||||
|
||||
vg_t *lvm_vg_create(lvm_t libh, const char *vg_name)
|
||||
{
|
||||
return vg_create((struct cmd_context *)libh, vg_name);
|
||||
vg_t *vg;
|
||||
|
||||
vg = vg_create((struct cmd_context *)libh, vg_name);
|
||||
/* FIXME: error handling is still TBD */
|
||||
if (vg_read_error(vg)) {
|
||||
vg_release(vg);
|
||||
return NULL;
|
||||
}
|
||||
return vg;
|
||||
}
|
||||
|
||||
int lvm_vg_extend(vg_t *vg, const char *device)
|
||||
|
Loading…
Reference in New Issue
Block a user