1
0
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:
Joe Thornber 2001-10-09 17:09:46 +00:00
parent 5cffeebbaa
commit e15559aa3c
4 changed files with 15 additions and 8 deletions

View File

@ -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)
{

View File

@ -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

View File

@ -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;

View File

@ -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);
}