1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

cleanup: improve messages

Add verbose message when we will not obtain devices from udev
(i.e. testing is using different udev dir, and the log was
giving misleading info about using udev)

Add proper error message if zalloc from pull would have failed.

Fix typo obolete -> obsolete
This commit is contained in:
Zdenek Kabelac 2013-04-23 11:58:50 +02:00
parent 35ab841ecf
commit 2925023411
3 changed files with 9 additions and 4 deletions

View File

@ -777,6 +777,9 @@ static int _init_dev_cache(struct cmd_context *cmd)
udev_dir_len != len; udev_dir_len != len;
if (len_diff || strncmp(DM_UDEV_DEV_DIR, cv->v.str, len)) { if (len_diff || strncmp(DM_UDEV_DEV_DIR, cv->v.str, len)) {
log_very_verbose("Non standard udev dir %s, resetting "
"devices/obtain_device_list_from_udev.",
cv->v.str);
device_list_from_udev = 0; device_list_from_udev = 0;
init_obtain_device_list_from_udev(0); init_obtain_device_list_from_udev(0);
} }

View File

@ -64,8 +64,10 @@ struct dm_config_tree *config_file_open(const char *filename, int keep_open)
if (!cft) if (!cft)
return NULL; return NULL;
cf = dm_pool_zalloc(cft->mem, sizeof(struct config_file)); if (!(cf = dm_pool_zalloc(cft->mem, sizeof(struct config_file)))) {
if (!cf) goto fail; log_error("Failed to allocate condig tree.");
goto fail;
}
cf->keep_open = keep_open; cf->keep_open = keep_open;
dm_config_set_custom(cft, cf); dm_config_set_custom(cft, cf);

View File

@ -103,8 +103,8 @@ int persistent_filter_load(struct dev_filter *f, struct dm_config_tree **cft_out
if (obtain_device_list_from_udev()) { if (obtain_device_list_from_udev()) {
if (!stat(pf->file, &info)) { if (!stat(pf->file, &info)) {
log_very_verbose("Obtaining device list from " log_very_verbose("Obtaining device list from udev. "
"udev. Removing obolete %s.", "Removing obsolete %s.",
pf->file); pf->file);
if (unlink(pf->file) < 0 && errno != EROFS) if (unlink(pf->file) < 0 && errno != EROFS)
log_sys_error("unlink", pf->file); log_sys_error("unlink", pf->file);