mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
o spot empty list in build_vg
This commit is contained in:
parent
5cffeebbaa
commit
e15559aa3c
@ -7,12 +7,14 @@
|
|||||||
#include "activate.h"
|
#include "activate.h"
|
||||||
|
|
||||||
int lv_activate(struct dmfs *dm,
|
int lv_activate(struct dmfs *dm,
|
||||||
struct volume_group *vg, struct logical_volume *lv)
|
struct volume_group *vg,
|
||||||
|
struct logical_volume *lv)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int lv_deactivate(struct dmfs *dm, struct volume_group *vg,
|
int lv_deactivate(struct dmfs *dm,
|
||||||
|
struct volume_group *vg,
|
||||||
struct logical_volume *lv)
|
struct logical_volume *lv)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -10,9 +10,11 @@
|
|||||||
#include "dmfs-driver.h"
|
#include "dmfs-driver.h"
|
||||||
|
|
||||||
int lv_activate(struct dmfs *dm,
|
int lv_activate(struct dmfs *dm,
|
||||||
struct volume_group *vg, struct logical_volume *lv);
|
struct volume_group *vg,
|
||||||
|
struct logical_volume *lv);
|
||||||
|
|
||||||
int lv_deactivate(struct dmfs *dm, struct volume_group *vg,
|
int lv_deactivate(struct dmfs *dm,
|
||||||
|
struct volume_group *vg,
|
||||||
struct logical_volume *lv);
|
struct logical_volume *lv);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,13 +35,16 @@ static int _check_vgs(struct list_head *pvs)
|
|||||||
static struct volume_group *_build_vg(struct pool *mem, struct list_head *pvs)
|
static struct volume_group *_build_vg(struct pool *mem, struct list_head *pvs)
|
||||||
{
|
{
|
||||||
struct volume_group *vg = pool_alloc(mem, sizeof(*vg));
|
struct volume_group *vg = pool_alloc(mem, sizeof(*vg));
|
||||||
struct disk_list *dl = list_entry(pvs->next, struct disk_list, list);
|
struct disk_list *dl;
|
||||||
|
|
||||||
if (!dl) {
|
|
||||||
|
if (list_empty(pvs)) {
|
||||||
log_err("no pv's in volume group");
|
log_err("no pv's in volume group");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dl = list_entry(pvs->next, struct disk_list, list);
|
||||||
|
|
||||||
if (!vg) {
|
if (!vg) {
|
||||||
stack;
|
stack;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -31,7 +31,7 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dev_cache_add_dir("/dev/")) {
|
if (!dev_cache_add_dir("/dev/loop")) {
|
||||||
fprintf(stderr, "couldn't add /dev to dir-cache\n");
|
fprintf(stderr, "couldn't add /dev to dir-cache\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user