11.15小结

1.python

http://docs.python.org/2.7/library/index.html看了前5章,远远不够阿。

2.bug7234:after delete dg, unquailifed disk appear

首先编译的时候碰到问题,关于不同目录下函数调用。

MAKEFILE要深入

相关代码记录一下

int set_disks_type(di_itf_t *pitf, di_ctlr_t *ctlr, di_dg_t *dg, uint32_t scsi_type)
{
    dg_scsi_disk_t  *dg_disk, *ctlr_disk;
    uint32_t        major, minor;
    uint32_t        i, j, id;

    dg_disk = dg->di_sb.dg_scsi_disks;

    for (i=0; i < dg->di_sb.dg_desired_num_members; i++, dg_disk++) {

        if (dg_disk->valid) {

            major = dg_disk->scsi_major;
            minor = dg_disk->scsi_minor;

            ctlr_disk = ctlr->di_disk;

            for (j = 0; j < MAX_SCSI_DISKS; j++, ctlr_disk++) {
                if ((ctlr_disk->scsi_major == major) &&
                    (ctlr_disk->scsi_minor == minor)) {
                    /*//EricDebug
                    syslog(LOG_ERR, "EricDebug:: %s %d: disk type change: minor:%d: org :0x%x set %s:0x%x",
                        __FILE__, __LINE__,
                        minor, ctlr_disk->scsi_type,
                        dg->di_sb.dg_name, scsi_type);
                    */
                    if (ctlr_disk->scsi_type == DI_DISK_TYPE_IN_DG) {
                        ctlr_disk->scsi_type = scsi_type;
                        if (scsi_type == DI_DISK_TYPE_SPARE) {
                            //conclude_disk_state(pitf, ctlr->id, j, NULL);    //conclude the disk is spare or unqualifed
                            id = ctlr->id;
                            green_state_t ctlr_state = pitf->di_ctlr[id].ctlr_state;
                            green_state_t disk_state = pitf->di_ctlr[id].disk_state[j];
                            if (disk_state != TYPE_UNKNOWN && disk_state != ctlr_state) {
                                syslog(LOG_ERR, "%s %d: slot %d is concluded as UNQUALIFIED(%d,%d)",
                                    __FILE__, __LINE__, j, ctlr_state, disk_state);
                                pitf->di_ctlr[id].di_disk[j].scsi_type = DI_DISK_TYPE_UNQUALIFIED;
                                pitf->di_ctlr[!id].di_disk[j].scsi_type = DI_DISK_TYPE_UNQUALIFIED;
                            }    
                            reset_spare_block(pitf, ctlr->id, j);
                        }    
                        break;
                    } else if (ctlr_disk->scsi_type == DI_DISK_TYPE_FAULTY_IN_DG) {
                        ctlr_disk->scsi_type = DI_DISK_TYPE_FAULTY;
                        break;
                    } else {
                        syslog(LOG_INFO, "%s %d: disk type mismatch: major:%d minor:%d: ctlr:0x%x dg %s:0x%x",
                            __FILE__, __LINE__,
                            major, minor, ctlr_disk->scsi_type,
                            dg->di_sb.dg_name, dg_disk->scsi_type);
                        continue;
                        //return 1;
                    }
                }
            }
        }
    }
    return 0;
}



3.iptv ->bug7233

调试相关

cat /proc/ebuf/devices
echo unbind 8 16 >/proc/rc_ebuf 
dmesg |tail

+       xmlDocPtr       doc = NULL;
+       xmlNodePtr      node = NULL;
+       xmlNodePtr      child_ma = NULL;
+       xmlNodePtr      child_mi = NULL;
+
+       xmlChar         *pval = NULL;
+       int             major = 0;
+       int                     minor = 0;
+       doc = xmlParseFile(CONF_FILE);
+       node = xmlDocGetRootElement(doc);
+       node = node->xmlChildrenNode;
+       while(node) {
+               if(!xmlStrcmp(node->name, (const xmlChar *)EBUF)) {
+                       child_ma = node->xmlChildrenNode;
+                       while(child_ma){
+                       if(!xmlStrcmp(child_ma->name, (const xmlChar *)EMAJOR)) {
+                               pval = xmlGetProp(child_ma, (const xmlChar *)VAL);
+                                       if(!pval)
+                                               return 1;
+                                       major = atoi((char*)pval);
+                                       child_mi = child_ma->xmlChildrenNode;
+                                       while(child_mi) {
+                                               if(!xmlStrcmp(child_mi->name, (const xmlChar *)EMINOR)) {
+                                                       pval = xmlGetProp(child_mi, (const xmlChar *)VAL);
+                                                       if(!pval)
+                                                               return 1;
+                                                       minor = atoi((char*)pval);
+                                               }  
+                                               child_mi = child_mi->next;
+                                       }
+                               }
+                               child_ma = child_ma->next;
+                       }         
+               }
+               node = node->next;
+       }
+       ebuf = find_ebuf_dev(info, MKDEV(major, minor), NULL);
好久前写风扇检测模块的时候用到过xml库,当时赶工没看细节。这次又用到了,有空要单独把这个库拿出来练习一下。

改c的时候也出现了好多问题,好久没用就会陌生,需要加强的地方有:a 函数里的结构体指针调用 b xml库使用 c 结构设计(终于了解了结构不好的C要改内部结构有多么的纠结。。)ps:GDB只会简单用用,文件一多就搜不来,要改进= =

4.网站建设http://learn.shayhowe.com/html-css/

http://argcv.com/wp-content/uploads/2012/05/linux-command.png

好多坑,以上。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值