More fixes to error paths.
lib/snapshot \
po \
test/mm test/device test/format1 test/regex test/filters
+ DISTCLEAN_TARGETS += lib/misc/configure.h
endif
include make.tmpl
Version 2.02.07 -
=================================
+ Add DISTCLEAN_TARGETS to make template for configure.h.
+ More fixes to error paths.
Fix lvcreate corelog validation.
Add --config for overriding most config file settings from cmdline.
Quote arguments when printing command line.
if (segtype->ops->target_percent &&
!segtype->ops->target_percent(&dm->target_state, dm->mem,
- dm->cmd->cft, seg, params,
+ dm->cmd, seg, params,
&total_numerator,
&total_denominator,
percent))
struct physical_volume *pv;
char buffer[32], *name;
- if (!(f->mem = dm_pool_create("text pv_names", 512))) {
- stack;
- goto bad;
- }
+ if (!(f->mem = dm_pool_create("text pv_names", 512)))
+ return_0;
- if (!(f->pv_names = dm_hash_create(128))) {
- stack;
- goto bad;
- }
+ if (!(f->pv_names = dm_hash_create(128)))
+ return_0;
list_iterate_items(pvl, &vg->pvs) {
pv = pvl->pv;
/* FIXME But skip if there's already an LV called pv%d ! */
- if (lvm_snprintf(buffer, sizeof(buffer), "pv%d", count++) < 0) {
- stack;
- goto bad;
- }
+ if (lvm_snprintf(buffer, sizeof(buffer), "pv%d", count++) < 0)
+ return_0;
- if (!(name = dm_pool_strdup(f->mem, buffer))) {
- stack;
- goto bad;
- }
+ if (!(name = dm_pool_strdup(f->mem, buffer)))
+ return_0;
- if (!dm_hash_insert(f->pv_names, dev_name(pv->dev), name)) {
- stack;
- goto bad;
- }
+ if (!dm_hash_insert(f->pv_names, dev_name(pv->dev), name))
+ return_0;
}
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,
stack;
goto out;
}
-#define fail do {stack; goto out;} while(0)
if (f->header && !_print_header(f, desc))
- fail;
+ goto_out;
if (!out_text(f, "%s {", vg->name))
- fail;
+ goto_out;
_inc_indent(f);
if (!_print_vg(f, vg))
- fail;
+ goto_out;
outnl(f);
if (!_print_pvs(f, vg))
- fail;
+ goto_out;
outnl(f);
if (!_print_lvs(f, vg))
- fail;
+ goto_out;
_dec_indent(f);
if (!out_text(f, "}"))
- fail;
+ goto_out;
if (!f->header && !_print_header(f, desc))
- fail;
+ goto_out;
-#undef fail
r = 1;
out:
struct dm_tree_node *node, uint64_t len,
uint32_t *pvmove_mirror_count);
int (*target_percent) (void **target_state, struct dm_pool * mem,
- struct config_tree *cft,
+ struct cmd_context *cmd,
struct lv_segment *seg, char *params,
uint64_t *total_numerator,
uint64_t *total_denominator, float *percent);
#ifdef DEVMAPPER_SUPPORT
static int _snap_target_percent(void **target_state __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)),
char *params, uint64_t *total_numerator,
uint64_t *total_denominator, float *percent)
$(SOURCES:%.c=%.pot) $(LDDEPS)
distclean: $(SUBDIRS.distclean)
- $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
- $(SOURCES:%.c=%.pot) $(LDDEPS) \
+ $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(DISTCLEAN_TARGETS) \
+ $(SOURCES:%.c=%.d) $(SOURCES:%.c=%.pot) $(LDDEPS) \
config.cache config.log config.status \
Makefile make.tmpl core \
version.h lvm2.po