本文整理汇总了C++中condlog函数的典型用法代码示例。如果您正苦于以下问题:C++ condlog函数的具体用法?C++ condlog怎么用?C++ condlog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了condlog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: get_alua_info
int
get_alua_info(int fd)
{
int rc;
int tpg;
rc = get_target_port_group_support(fd);
if (rc < 0)
return -ALUA_PRIO_TPGS_FAILED;
if (rc == TPGS_NONE)
return -ALUA_PRIO_NOT_SUPPORTED;
tpg = get_target_port_group(fd);
if (tpg < 0)
return -ALUA_PRIO_RTPG_FAILED;
condlog(3, "reported target port group is %i", tpg);
rc = get_asymmetric_access_state(fd, tpg);
if (rc < 0)
return -ALUA_PRIO_GETAAS_FAILED;
condlog(3, "aas = %02x [%s]%s", rc, aas_print_string(rc),
(rc & 0x80) ? " [preferred]" : "");
return rc;
}
开发者ID:krisman,项目名称:multipath-tools,代码行数:26,代码来源:alua.c
示例2: start_waiter_thread
int start_waiter_thread (struct multipath *mpp, struct vectors *vecs)
{
struct event_thread *wp;
if (!mpp)
return 0;
wp = alloc_waiter();
if (!wp)
goto out;
mpp->waiter = (void *)wp;
strncpy(wp->mapname, mpp->alias, WWID_SIZE);
wp->vecs = vecs;
wp->mpp = mpp;
if (pthread_create(&wp->thread, &waiter_attr, waitevent, wp)) {
condlog(0, "%s: cannot create event checker", wp->mapname);
goto out1;
}
condlog(2, "%s: event checker started", wp->mapname);
return 0;
out1:
free_waiter(wp);
mpp->waiter = NULL;
out:
condlog(0, "failed to start waiter thread");
return 1;
}
开发者ID:gebi,项目名称:multipath-tools,代码行数:31,代码来源:waiter.c
示例3: select_minio_bio
int
select_minio_bio (struct multipath * mp)
{
if (mp->mpe && mp->mpe->minio) {
mp->minio = mp->mpe->minio;
condlog(3, "%s: minio = %i (LUN setting)",
mp->alias, mp->minio);
return 0;
}
if (mp->hwe && mp->hwe->minio) {
mp->minio = mp->hwe->minio;
condlog(3, "%s: minio = %i (controller setting)",
mp->alias, mp->minio);
return 0;
}
if (conf->minio) {
mp->minio = conf->minio;
condlog(3, "%s: minio = %i (config file default)",
mp->alias, mp->minio);
return 0;
}
mp->minio = DEFAULT_MINIO;
condlog(3, "%s: minio = %i (internal default)",
mp->alias, mp->minio);
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:26,代码来源:propsel.c
示例4: select_flush_on_last_del
extern int
select_flush_on_last_del(struct multipath *mp)
{
if (mp->flush_on_last_del == FLUSH_IN_PROGRESS)
return 0;
if (mp->mpe && mp->mpe->flush_on_last_del != FLUSH_UNDEF) {
mp->flush_on_last_del = mp->mpe->flush_on_last_del;
condlog(3, "%s: flush_on_last_del = %i (multipath setting)",
mp->alias, mp->flush_on_last_del);
return 0;
}
if (mp->hwe && mp->hwe->flush_on_last_del != FLUSH_UNDEF) {
mp->flush_on_last_del = mp->hwe->flush_on_last_del;
condlog(3, "%s: flush_on_last_del = %i (controler setting)",
mp->alias, mp->flush_on_last_del);
return 0;
}
if (conf->flush_on_last_del != FLUSH_UNDEF) {
mp->flush_on_last_del = conf->flush_on_last_del;
condlog(3, "%s: flush_on_last_del = %i (config file default)",
mp->alias, mp->flush_on_last_del);
return 0;
}
mp->flush_on_last_del = FLUSH_UNDEF;
condlog(3, "%s: flush_on_last_del = DISABLED (internal default)",
mp->alias);
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:28,代码来源:propsel.c
示例5: select_selector
extern int
select_selector (struct multipath * mp)
{
if (mp->mpe && mp->mpe->selector) {
mp->selector = mp->mpe->selector;
condlog(3, "%s: selector = %s (LUN setting)",
mp->alias, mp->selector);
return 0;
}
if (mp->hwe && mp->hwe->selector) {
mp->selector = mp->hwe->selector;
condlog(3, "%s: selector = %s (controller setting)",
mp->alias, mp->selector);
return 0;
}
if (conf->selector) {
mp->selector = conf->selector;
condlog(3, "%s: selector = %s (config file default)",
mp->alias, mp->selector);
return 0;
}
mp->selector = set_default(DEFAULT_SELECTOR);
condlog(3, "%s: selector = %s (internal default)",
mp->alias, mp->selector);
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:26,代码来源:propsel.c
示例6: condlog
void *tur_thread(void *ctx)
{
struct checker *c = ctx;
struct tur_checker_context *ct = c->context;
int state;
condlog(3, "%d:%d: tur checker starting up", TUR_DEVT(ct));
/* This thread can be canceled, so setup clean up */
tur_thread_cleanup_push(ct)
/* TUR checker start up */
pthread_mutex_lock(&ct->lock);
ct->state = PATH_PENDING;
pthread_mutex_unlock(&ct->lock);
state = tur_check(c);
/* TUR checker done */
pthread_mutex_lock(&ct->lock);
ct->state = state;
pthread_mutex_unlock(&ct->lock);
pthread_cond_signal(&ct->active);
condlog(3, "%d:%d: tur checker finished, state %s",
TUR_DEVT(ct), checker_state_name(state));
tur_thread_cleanup_pop(ct);
return ((void *)0);
}
开发者ID:unakatsuo,项目名称:multipath-tools,代码行数:29,代码来源:tur.c
示例7: select_pgfailback
extern int
select_pgfailback (struct multipath * mp)
{
if (mp->mpe && mp->mpe->pgfailback != FAILBACK_UNDEF) {
mp->pgfailback = mp->mpe->pgfailback;
condlog(3, "%s: pgfailback = %i (LUN setting)",
mp->alias, mp->pgfailback);
return 0;
}
if (mp->hwe && mp->hwe->pgfailback != FAILBACK_UNDEF) {
mp->pgfailback = mp->hwe->pgfailback;
condlog(3, "%s: pgfailback = %i (controller setting)",
mp->alias, mp->pgfailback);
return 0;
}
if (conf->pgfailback != FAILBACK_UNDEF) {
mp->pgfailback = conf->pgfailback;
condlog(3, "%s: pgfailback = %i (config file default)",
mp->alias, mp->pgfailback);
return 0;
}
mp->pgfailback = DEFAULT_FAILBACK;
condlog(3, "%s: pgfailover = %i (internal default)",
mp->alias, mp->pgfailback);
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:26,代码来源:propsel.c
示例8: should_multipath
int
should_multipath(struct path *pp1, vector pathvec)
{
int i;
struct path *pp2;
condlog(4, "checking if %s should be multipathed", pp1->dev);
vector_foreach_slot(pathvec, pp2, i) {
if (pp1->dev == pp2->dev)
continue;
if (strncmp(pp1->wwid, pp2->wwid, WWID_SIZE) == 0) {
condlog(3, "found multiple paths with wwid %s, "
"multipathing %s", pp1->wwid, pp1->dev);
return 1;
}
}
if (check_wwids_file(pp1->wwid, 0) < 0) {
condlog(3, "wwid %s not in wwids file, skipping %s",
pp1->wwid, pp1->dev);
return 0;
}
condlog(3, "found wwid %s in wwids file, multipathing %s", pp1->wwid,
pp1->dev);
return 1;
}
开发者ID:krisman,项目名称:multipath-tools,代码行数:25,代码来源:wwids.c
示例9: write_out_wwid
static int
write_out_wwid(int fd, char *wwid) {
int ret;
off_t offset;
char buf[WWID_SIZE + 3];
ret = snprintf(buf, WWID_SIZE + 3, "/%s/\n", wwid);
if (ret >= (WWID_SIZE + 3) || ret < 0){
condlog(0, "can't format wwid for writing (%d) : %s",
ret, strerror(errno));
return -1;
}
offset = lseek(fd, 0, SEEK_END);
if (offset < 0) {
condlog(0, "can't seek to the end of wwids file : %s",
strerror(errno));
return -1;
}
if (write_all(fd, buf, strlen(buf)) != strlen(buf)) {
condlog(0, "cannot write wwid to wwids file : %s",
strerror(errno));
if (ftruncate(fd, offset))
condlog(0, "cannot truncate failed wwid write : %s",
strerror(errno));
return -1;
}
return 1;
}
开发者ID:krisman,项目名称:multipath-tools,代码行数:28,代码来源:wwids.c
示例10: select_retain_hwhandler
extern int
select_retain_hwhandler (struct multipath * mp)
{
unsigned int minv_dm_retain[3] = {1, 5, 0};
if (!VERSION_GE(conf->version, minv_dm_retain)) {
mp->retain_hwhandler = RETAIN_HWHANDLER_OFF;
condlog(3, "%s: retain_attached_hw_hander disabled (requires kernel version >= 1.5.0)", mp->alias);
return 0;
}
if (mp->hwe && mp->hwe->retain_hwhandler) {
mp->retain_hwhandler = mp->hwe->retain_hwhandler;
condlog(3, "%s: retain_attached_hw_handler = %d (controller default)", mp->alias, mp->retain_hwhandler);
return 0;
}
if (conf->retain_hwhandler) {
mp->retain_hwhandler = conf->retain_hwhandler;
condlog(3, "%s: retain_attached_hw_handler = %d (config file default)", mp->alias, mp->retain_hwhandler);
return 0;
}
mp->retain_hwhandler = 0;
condlog(3, "%s: retain_attached_hw_handler = %d (compiled in default)", mp->alias, mp->retain_hwhandler);
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:25,代码来源:propsel.c
示例11: dm_lib_prereq
static int
dm_lib_prereq (void)
{
char version[64];
int v[3];
#if defined(LIBDM_API_DEFERRED)
int minv[3] = {1, 2, 89};
#elif defined(DM_SUBSYSTEM_UDEV_FLAG0)
int minv[3] = {1, 2, 82};
#elif defined(LIBDM_API_COOKIE)
int minv[3] = {1, 2, 38};
#else
int minv[3] = {1, 2, 8};
#endif
dm_get_library_version(version, sizeof(version));
condlog(3, "libdevmapper version %s", version);
if (sscanf(version, "%d.%d.%d ", &v[0], &v[1], &v[2]) != 3) {
condlog(0, "invalid libdevmapper version %s", version);
return 1;
}
if VERSION_GE(v, minv)
return 0;
condlog(0, "libdevmapper version must be >= %d.%.2d.%.2d",
minv[0], minv[1], minv[2]);
return 1;
}
开发者ID:cathay4t,项目名称:multipath-tools,代码行数:28,代码来源:devmapper.c
示例12: select_rr_weight
/*
* selectors :
* traverse the configuration layers from most specific to most generic
* stop at first explicit setting found
*/
extern int
select_rr_weight (struct multipath * mp)
{
if (mp->mpe && mp->mpe->rr_weight) {
mp->rr_weight = mp->mpe->rr_weight;
condlog(3, "%s: rr_weight = %i (LUN setting)",
mp->alias, mp->rr_weight);
return 0;
}
if (mp->hwe && mp->hwe->rr_weight) {
mp->rr_weight = mp->hwe->rr_weight;
condlog(3, "%s: rr_weight = %i (controller setting)",
mp->alias, mp->rr_weight);
return 0;
}
if (conf->rr_weight) {
mp->rr_weight = conf->rr_weight;
condlog(3, "%s: rr_weight = %i (config file default)",
mp->alias, mp->rr_weight);
return 0;
}
mp->rr_weight = RR_WEIGHT_NONE;
condlog(3, "%s: rr_weight = %i (internal default)",
mp->alias, mp->rr_weight);
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:31,代码来源:propsel.c
示例13: select_fast_io_fail
extern int
select_fast_io_fail(struct multipath *mp)
{
if (mp->hwe && mp->hwe->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
mp->fast_io_fail = mp->hwe->fast_io_fail;
if (mp->fast_io_fail == MP_FAST_IO_FAIL_OFF)
condlog(3, "%s: fast_io_fail_tmo = off "
"(controller setting)", mp->alias);
else
condlog(3, "%s: fast_io_fail_tmo = %d "
"(controller setting)", mp->alias,
mp->fast_io_fail == MP_FAST_IO_FAIL_ZERO ? 0 : mp->fast_io_fail);
return 0;
}
if (conf->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
mp->fast_io_fail = conf->fast_io_fail;
if (mp->fast_io_fail == MP_FAST_IO_FAIL_OFF)
condlog(3, "%s: fast_io_fail_tmo = off "
"(config file default)", mp->alias);
else
condlog(3, "%s: fast_io_fail_tmo = %d "
"(config file default)", mp->alias,
mp->fast_io_fail == MP_FAST_IO_FAIL_ZERO ? 0 : mp->fast_io_fail);
return 0;
}
mp->fast_io_fail = MP_FAST_IO_FAIL_UNSET;
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:28,代码来源:propsel.c
示例14: dm_suspend_and_flush_map
extern int
dm_suspend_and_flush_map (const char * mapname)
{
int s = 0, queue_if_no_path = 0;
unsigned long long mapsize;
char params[PARAMS_SIZE] = {0};
if (!dm_is_mpath(mapname))
return 0; /* nothing to do */
if (!dm_get_map(mapname, &mapsize, params)) {
if (strstr(params, "queue_if_no_path"))
queue_if_no_path = 1;
}
if (queue_if_no_path)
s = dm_queue_if_no_path((char *)mapname, 0);
/* Leave queue_if_no_path alone if unset failed */
if (s)
queue_if_no_path = 0;
else
s = dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0);
if (!dm_flush_map(mapname)) {
condlog(4, "multipath map %s removed", mapname);
return 0;
}
condlog(2, "failed to remove multipath map %s", mapname);
dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname, 0);
if (queue_if_no_path)
s = dm_queue_if_no_path((char *)mapname, 1);
return 1;
}
开发者ID:cathay4t,项目名称:multipath-tools,代码行数:33,代码来源:devmapper.c
示例15: _dm_flush_map
extern int
_dm_flush_map (const char * mapname, int need_sync, int deferred_remove)
{
int r;
if (!dm_is_mpath(mapname))
return 0; /* nothing to do */
/* If you aren't doing a deferred remove, make sure that no
* devices are in use */
if (!do_deferred(deferred_remove) && partmap_in_use(mapname, NULL))
return 1;
if (dm_remove_partmaps(mapname, need_sync, deferred_remove))
return 1;
if (!do_deferred(deferred_remove) && dm_get_opencount(mapname)) {
condlog(2, "%s: map in use", mapname);
return 1;
}
r = dm_device_remove(mapname, need_sync, deferred_remove);
if (r) {
if (do_deferred(deferred_remove) && dm_map_present(mapname)) {
condlog(4, "multipath map %s remove deferred",
mapname);
return 2;
}
condlog(4, "multipath map %s removed", mapname);
return 0;
}
return 1;
}
开发者ID:cathay4t,项目名称:multipath-tools,代码行数:34,代码来源:devmapper.c
示例16: dm_addmap_create
extern int
dm_addmap_create (struct multipath *mpp, char * params) {
int ro;
for (ro = 0; ro <= 1; ro++) {
int err;
if (dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, mpp, params, ro))
return 1;
/*
* DM_DEVICE_CREATE is actually DM_DEV_CREATE + DM_TABLE_LOAD.
* Failing the second part leaves an empty map. Clean it up.
*/
err = errno;
if (dm_map_present(mpp->alias)) {
condlog(3, "%s: failed to load map (a path might be in use)", mpp->alias);
dm_flush_map_nosync(mpp->alias);
}
if (err != EROFS) {
condlog(3, "%s: failed to load map, error %d",
mpp->alias, err);
break;
}
}
return 0;
}
开发者ID:cathay4t,项目名称:multipath-tools,代码行数:26,代码来源:devmapper.c
示例17: select_features
extern int
select_features (struct multipath * mp)
{
struct mpentry * mpe;
char *origin;
if ((mpe = find_mpe(mp->wwid)) && mpe->features) {
mp->features = STRDUP(mpe->features);
origin = "LUN setting";
} else if (mp->hwe && mp->hwe->features) {
mp->features = STRDUP(mp->hwe->features);
origin = "controller setting";
} else if (conf->features) {
mp->features = STRDUP(conf->features);
origin = "config file default";
} else {
mp->features = set_default(DEFAULT_FEATURES);
origin = "internal default";
}
condlog(3, "%s: features = %s (%s)",
mp->alias, mp->features, origin);
if (strstr(mp->features, "queue_if_no_path")) {
if (mp->no_path_retry == NO_PATH_RETRY_UNDEF)
mp->no_path_retry = NO_PATH_RETRY_QUEUE;
else if (mp->no_path_retry == NO_PATH_RETRY_FAIL) {
condlog(1, "%s: config error, overriding 'no_path_retry' value",
mp->alias);
mp->no_path_retry = NO_PATH_RETRY_QUEUE;
}
}
return 0;
}
开发者ID:Aidgas,项目名称:multipath-tools,代码行数:32,代码来源:propsel.c
示例18: remove_wwid
int
remove_wwid(char *wwid) {
int fd, len, can_write;
char *str;
int ret = -1;
len = strlen(wwid) + 4; /* two slashes the newline and a zero byte */
str = malloc(len);
if (str == NULL) {
condlog(0, "can't allocate memory to remove wwid : %s",
strerror(errno));
return -1;
}
if (snprintf(str, len, "/%s/\n", wwid) >= len) {
condlog(0, "string overflow trying to remove wwid");
goto out;
}
condlog(3, "removing line '%s' from wwids file", str);
fd = open_file(conf->wwids_file, &can_write, WWIDS_FILE_HEADER);
if (fd < 0)
goto out;
if (!can_write) {
condlog(0, "cannot remove wwid. wwids file is read-only");
goto out_file;
}
ret = do_remove_wwid(fd, str);
out_file:
close(fd);
out:
free(str);
return ret;
}
开发者ID:krisman,项目名称:multipath-tools,代码行数:33,代码来源:wwids.c
示例19: stop_waiter_thread
void stop_waiter_thread (struct multipath *mpp, struct vectors *vecs)
{
if (mpp->waiter == (pthread_t)0) {
condlog(3, "%s: event checker thread already stopped",
mpp->alias);
return;
}
condlog(2, "%s: stop event checker thread (%lu)", mpp->alias,
mpp->waiter);
pthread_kill(mpp->waiter, SIGUSR1);
mpp->waiter = (pthread_t)0;
}
开发者ID:unakatsuo,项目名称:multipath-tools,代码行数:12,代码来源:waiter.c
示例20: stop_waiter_thread
void stop_waiter_thread (struct multipath *mpp, struct vectors *vecs)
{
struct event_thread *wp = (struct event_thread *)mpp->waiter;
pthread_t thread;
if (!wp) {
condlog(3, "%s: no waiter thread", mpp->alias);
return;
}
thread = wp->thread;
condlog(2, "%s: stop event checker thread (%lu)", wp->mapname, thread);
pthread_kill(thread, SIGUSR1);
}
开发者ID:gebi,项目名称:multipath-tools,代码行数:14,代码来源:waiter.c
注:本文中的condlog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论