本文整理汇总了C++中ConfigReader::get_devno_by_host_id方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigReader::get_devno_by_host_id方法的具体用法?C++ ConfigReader::get_devno_by_host_id怎么用?C++ ConfigReader::get_devno_by_host_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigReader
的用法示例。
在下文中一共展示了ConfigReader::get_devno_by_host_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_summary_report
int print_summary_report(FILE *fp, char *filename, ConfigReader &cfg)
{
int rc = 0;
int lrc=0;
struct file_header f_hdr;
struct aggr_data *a_hdr;
DeviceFilter dev_filt;
if (get_initial_data(filename, &f_hdr, &a_hdr, dev_filt, cfg))
return -1;
rc += fprintf(fp, "Data Summary\n");
rc += fprintf(fp, "------------\n");
rc += fprintf(fp, "Aggregated range: ");
if (a_hdr) {
rc += fprintf(fp, "%s to ",
print_time_formatted(a_hdr->begin_time - f_hdr.interval_length));
rc += fprintf(fp, "%s\n",
print_time_formatted(a_hdr->end_time));
}
else
rc += fprintf(fp, "none\n");
discard_aggr_data_struct(a_hdr);
free(a_hdr);
a_hdr = NULL;
rc += fprintf(fp, "Detailed range: %s to ",
print_time_formatted(f_hdr.begin_time - f_hdr.interval_length));
rc += fprintf(fp, "%s\n", print_time_formatted(f_hdr.end_time));
rc += fprintf(fp, "Interval length: %d seconds\n",
f_hdr.interval_length);
list<__u32> disks = dev_filt.get_mm_list();
list<__u32> host_ids = dev_filt.get_host_id_list();
int first = 1;
const char *frmt;
for (list<__u32>::const_iterator i = host_ids.begin();
i != host_ids.end(); ++i) {
if (first) {
frmt = "HBA/CHPID: 0.0.%04x/%x\n";
first = 0;
}
else
frmt = " 0.0.%04x/%x\n";
rc += fprintf(fp, frmt, cfg.get_devno_by_host_id(*i, &lrc),
cfg.get_chpid_by_host_id(*i, &lrc));
if (lrc)
return -1;
}
first = 1;
for (list<__u32>::const_iterator i = disks.begin();
i != disks.end(); ++i) {
if (first) {
frmt = "WWPN/LUN (dev): 0x%016Lx/0x%016Lx (%s)\n";
first = 0;
}
else
frmt = " 0x%016Lx/0x%016Lx (%s)\n";
rc += fprintf(fp, frmt, cfg.get_wwpn_by_mm_internal(*i, &lrc),
cfg.get_lun_by_mm_internal(*i, &lrc),
cfg.get_dev_by_mm_internal(*i, &lrc));
if (lrc)
return -1;
}
return rc;
}