From ff941ffc167dec0fd2b952d4c3f6ebec2833e9d0 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 18 Feb 2002 11:25:43 +0000 Subject: [PATCH] o small bug in the format1 export code for snapshots. o tidied newlines in the snapshot section of format text. --- lib/format1/import-export.c | 8 +++++--- lib/format_text/export.c | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/format1/import-export.c b/lib/format1/import-export.c index d58f3c0e3..35f1f8c11 100644 --- a/lib/format1/import-export.c +++ b/lib/format1/import-export.c @@ -506,7 +506,7 @@ int export_lvs(struct disk_list *dl, struct volume_group *vg, lvdl->lvd.lv_dev = MKDEV(0, lv_num); lvdl->lvd.lv_number = lv_num; - if (!hash_insert(lvd_hash, lvdl->lvd.lv_name, &lvdl->lvd)) { + if (!hash_insert(lvd_hash, ll->lv->name, &lvdl->lvd)) { stack; goto out; } @@ -531,12 +531,14 @@ int export_lvs(struct disk_list *dl, struct volume_group *vg, struct snapshot_list)->snapshot; if (!(org = hash_lookup(lvd_hash, s->origin->name))) { - stack; + log_err("Couldn't find snapshot origin '%s'.", + s->origin->name); goto out; } if (!(cow = hash_lookup(lvd_hash, s->cow->name))) { - stack; + log_err("Couldn't find snapshot cow store '%s'.", + s->cow->name); goto out; } diff --git a/lib/format_text/export.c b/lib/format_text/export.c index c322a5d78..adf7d7231 100644 --- a/lib/format_text/export.c +++ b/lib/format_text/export.c @@ -345,12 +345,12 @@ static int _print_lvs(struct formatter *f, struct volume_group *vg) return 1; _out(f, "logical_volumes {"); - _nl(f); _inc_indent(f); list_iterate (lvh, &vg->lvs) { lv = list_item(lvh, struct lv_list)->lv; + _nl(f); _out(f, "%s {", lv->name); _inc_indent(f); @@ -418,7 +418,6 @@ static int _print_snapshots(struct formatter *f, struct volume_group *vg) return 1; _out(f, "snapshots {"); - _nl(f); _inc_indent(f); list_iterate (sh, &vg->snapshots) {