DDF: guid_str: convenience function to print GUID for debugging
For debugging DDF structure changes, it is important to be able to identify VCs by their GUIDs. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
ddf94a437e
commit
be9b9ef42e
14
super-ddf.c
14
super-ddf.c
|
@ -1296,6 +1296,17 @@ static void print_guid(char *guid, int tstamp)
|
||||||
printf(")");
|
printf(")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *guid_str(const char *guid)
|
||||||
|
{
|
||||||
|
static char buf[DDF_GUID_LEN*2+1];
|
||||||
|
int i;
|
||||||
|
char *p = buf;
|
||||||
|
for (i = 0; i < DDF_GUID_LEN; i++)
|
||||||
|
p += sprintf(p, "%02x", (unsigned char)guid[i]);
|
||||||
|
*p = '\0';
|
||||||
|
return (const char *) buf;
|
||||||
|
}
|
||||||
|
|
||||||
static void examine_vd(int n, struct ddf_super *sb, char *guid)
|
static void examine_vd(int n, struct ddf_super *sb, char *guid)
|
||||||
{
|
{
|
||||||
int crl = sb->conf_rec_len;
|
int crl = sb->conf_rec_len;
|
||||||
|
@ -2792,6 +2803,9 @@ static int __write_ddf_structure(struct dl *d, struct ddf_super *ddf, __u8 type,
|
||||||
&dummy);
|
&dummy);
|
||||||
}
|
}
|
||||||
if (c) {
|
if (c) {
|
||||||
|
dprintf("writing conf record %i on disk %08x for %s/%u\n",
|
||||||
|
i, d->disk.refnum, guid_str(vdc->guid),
|
||||||
|
vdc->sec_elmnt_seq);
|
||||||
vdc->seqnum = header->seq;
|
vdc->seqnum = header->seq;
|
||||||
vdc->crc = calc_crc(vdc, conf_size);
|
vdc->crc = calc_crc(vdc, conf_size);
|
||||||
if (write(fd, vdc, conf_size) < 0)
|
if (write(fd, vdc, conf_size) < 0)
|
||||||
|
|
Loading…
Reference in New Issue