[sheepdog] [PATCH V4 2/2] collie: optimize 'collie vdi check' command

Yunkai Zhang yunkai.me at gmail.com
Mon Sep 3 12:54:50 CEST 2012


On Mon, Sep 3, 2012 at 6:48 PM, Liu Yuan <namei.unix at gmail.com> wrote:
> On 09/03/2012 06:38 PM, Yunkai Zhang wrote:
>> collie/vdi.c need to use this function, if we put it in
>> ../farm/sha1_file.c, we should modify collie/Makefie.am to include
>> farm/sha1_file.c, it seems werid.
>> +diff:
>> +     fprintf(stderr, "Failed oid: %"PRIx64"\n", oid);
>> +     for (i = 0; i < nr_copies; i++) {
>> +             addr_to_str(host, sizeof(host), nids[i].addr, 0);
>> +             fprintf(stderr, ">> copy[%d], sha1: %s, from: %s:%d\n",
>> +                     i, sha1_to_hex(sha1[i]), host, nids[i].port);
>> +     }
>
> So only fprintf() needs it. why user need this information? I think for
> now end user don't need these hex strings. Showing hash value of data to
> end users isn't useful as far as I know.

We can compare this result with comand line tools: sha1sum, which can
also help us to verify program's correction I think.

>
> Thanks,
> Yuan



-- 
Yunkai Zhang
Work at Taobao



More information about the sheepdog mailing list