diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 602cbee2d..8f77851c2 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -7,12 +7,14 @@ #include "activate.h" 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) { diff --git a/lib/activate/activate.h b/lib/activate/activate.h index 921fa5f68..90d045fb6 100644 --- a/lib/activate/activate.h +++ b/lib/activate/activate.h @@ -10,9 +10,11 @@ #include "dmfs-driver.h" 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); #endif diff --git a/lib/format1/format1.c b/lib/format1/format1.c index b8377bd31..729f9b8fd 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -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) { 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"); return NULL; } + dl = list_entry(pvs->next, struct disk_list, list); + if (!vg) { stack; return NULL; diff --git a/old-tests/format1/read_vg_t.c b/old-tests/format1/read_vg_t.c index ca700b9ac..a5c93a2a6 100644 --- a/old-tests/format1/read_vg_t.c +++ b/old-tests/format1/read_vg_t.c @@ -31,7 +31,7 @@ int main(int argc, char **argv) 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"); exit(1); }