1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

Add DISTCLEAN_TARGETS to make template for configure.h.

More fixes to error paths.
This commit is contained in:
Alasdair Kergon 2006-05-16 20:53:13 +00:00
parent f7dd14588f
commit aba30ebcdb
7 changed files with 25 additions and 43 deletions

View File

@ -38,6 +38,7 @@ ifeq ($(MAKECMDGOALS),distclean)
lib/snapshot \ lib/snapshot \
po \ po \
test/mm test/device test/format1 test/regex test/filters test/mm test/device test/format1 test/regex test/filters
DISTCLEAN_TARGETS += lib/misc/configure.h
endif endif
include make.tmpl include make.tmpl

View File

@ -1,5 +1,7 @@
Version 2.02.07 - Version 2.02.07 -
================================= =================================
Add DISTCLEAN_TARGETS to make template for configure.h.
More fixes to error paths.
Fix lvcreate corelog validation. Fix lvcreate corelog validation.
Add --config for overriding most config file settings from cmdline. Add --config for overriding most config file settings from cmdline.
Quote arguments when printing command line. Quote arguments when printing command line.

View File

@ -329,7 +329,7 @@ static int _percent_run(struct dev_manager *dm, const char *name,
if (segtype->ops->target_percent && if (segtype->ops->target_percent &&
!segtype->ops->target_percent(&dm->target_state, dm->mem, !segtype->ops->target_percent(&dm->target_state, dm->mem,
dm->cmd->cft, seg, params, dm->cmd, seg, params,
&total_numerator, &total_numerator,
&total_denominator, &total_denominator,
percent)) percent))

View File

@ -613,46 +613,27 @@ static int _build_pv_names(struct formatter *f, struct volume_group *vg)
struct physical_volume *pv; struct physical_volume *pv;
char buffer[32], *name; char buffer[32], *name;
if (!(f->mem = dm_pool_create("text pv_names", 512))) { if (!(f->mem = dm_pool_create("text pv_names", 512)))
stack; return_0;
goto bad;
}
if (!(f->pv_names = dm_hash_create(128))) { if (!(f->pv_names = dm_hash_create(128)))
stack; return_0;
goto bad;
}
list_iterate_items(pvl, &vg->pvs) { list_iterate_items(pvl, &vg->pvs) {
pv = pvl->pv; pv = pvl->pv;
/* FIXME But skip if there's already an LV called pv%d ! */ /* FIXME But skip if there's already an LV called pv%d ! */
if (lvm_snprintf(buffer, sizeof(buffer), "pv%d", count++) < 0) { if (lvm_snprintf(buffer, sizeof(buffer), "pv%d", count++) < 0)
stack; return_0;
goto bad;
}
if (!(name = dm_pool_strdup(f->mem, buffer))) { if (!(name = dm_pool_strdup(f->mem, buffer)))
stack; return_0;
goto bad;
}
if (!dm_hash_insert(f->pv_names, dev_name(pv->dev), name)) { if (!dm_hash_insert(f->pv_names, dev_name(pv->dev), name))
stack; return_0;
goto bad;
}
} }
return 1; return 1;
bad:
if (f->mem)
dm_pool_destroy(f->mem);
if (f->pv_names)
dm_hash_destroy(f->pv_names);
return 0;
} }
static int _text_vg_export(struct formatter *f, static int _text_vg_export(struct formatter *f,
@ -664,35 +645,33 @@ static int _text_vg_export(struct formatter *f,
stack; stack;
goto out; goto out;
} }
#define fail do {stack; goto out;} while(0)
if (f->header && !_print_header(f, desc)) if (f->header && !_print_header(f, desc))
fail; goto_out;
if (!out_text(f, "%s {", vg->name)) if (!out_text(f, "%s {", vg->name))
fail; goto_out;
_inc_indent(f); _inc_indent(f);
if (!_print_vg(f, vg)) if (!_print_vg(f, vg))
fail; goto_out;
outnl(f); outnl(f);
if (!_print_pvs(f, vg)) if (!_print_pvs(f, vg))
fail; goto_out;
outnl(f); outnl(f);
if (!_print_lvs(f, vg)) if (!_print_lvs(f, vg))
fail; goto_out;
_dec_indent(f); _dec_indent(f);
if (!out_text(f, "}")) if (!out_text(f, "}"))
fail; goto_out;
if (!f->header && !_print_header(f, desc)) if (!f->header && !_print_header(f, desc))
fail; goto_out;
#undef fail
r = 1; r = 1;
out: out:

View File

@ -72,7 +72,7 @@ struct segtype_handler {
struct dm_tree_node *node, uint64_t len, struct dm_tree_node *node, uint64_t len,
uint32_t *pvmove_mirror_count); uint32_t *pvmove_mirror_count);
int (*target_percent) (void **target_state, struct dm_pool * mem, int (*target_percent) (void **target_state, struct dm_pool * mem,
struct config_tree *cft, struct cmd_context *cmd,
struct lv_segment *seg, char *params, struct lv_segment *seg, char *params,
uint64_t *total_numerator, uint64_t *total_numerator,
uint64_t *total_denominator, float *percent); uint64_t *total_denominator, float *percent);

View File

@ -89,7 +89,7 @@ static int _snap_text_export(const struct lv_segment *seg, struct formatter *f)
#ifdef DEVMAPPER_SUPPORT #ifdef DEVMAPPER_SUPPORT
static int _snap_target_percent(void **target_state __attribute((unused)), static int _snap_target_percent(void **target_state __attribute((unused)),
struct dm_pool *mem __attribute((unused)), struct dm_pool *mem __attribute((unused)),
struct config_tree *cft __attribute((unused)), struct cmd_context *cmd __attribute((unused)),
struct lv_segment *seg __attribute((unused)), struct lv_segment *seg __attribute((unused)),
char *params, uint64_t *total_numerator, char *params, uint64_t *total_numerator,
uint64_t *total_denominator, float *percent) uint64_t *total_denominator, float *percent)

View File

@ -195,8 +195,8 @@ clean: $(SUBDIRS.clean)
$(SOURCES:%.c=%.pot) $(LDDEPS) $(SOURCES:%.c=%.pot) $(LDDEPS)
distclean: $(SUBDIRS.distclean) distclean: $(SUBDIRS.distclean)
$(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \ $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(DISTCLEAN_TARGETS) \
$(SOURCES:%.c=%.pot) $(LDDEPS) \ $(SOURCES:%.c=%.d) $(SOURCES:%.c=%.pot) $(LDDEPS) \
config.cache config.log config.status \ config.cache config.log config.status \
Makefile make.tmpl core \ Makefile make.tmpl core \
version.h lvm2.po version.h lvm2.po