COL_RO,
COL_RM,
COL_MODEL,
+ COL_SERIAL,
COL_SIZE,
COL_STATE,
COL_OWNER,
[COL_ROTA] = { "ROTA", 1, TT_FL_RIGHT, N_("rotational device") },
[COL_RAND] = { "RAND", 1, TT_FL_RIGHT, N_("adds randomness") },
[COL_MODEL] = { "MODEL", 0.1, TT_FL_TRUNC, N_("device identifier") },
+ [COL_SERIAL] = { "SERIAL", 0.1, TT_FL_TRUNC, N_("disk serial number") },
[COL_SIZE] = { "SIZE", 5, TT_FL_RIGHT, N_("size of the device") },
[COL_STATE] = { "STATE", 7, TT_FL_TRUNC, N_("state of the device") },
[COL_OWNER] = { "OWNER", 0.1, TT_FL_TRUNC, N_("user name"), },
char *partuuid; /* partition UUID */
char *partlabel; /* partiton label */
char *wwn; /* storage WWN */
+ char *serial; /* disk serial number */
int npartitions; /* # of partitions this device has */
int nholders; /* # of devices mapped directly to this device
free(cxt->partuuid);
free(cxt->partlabel);
free(cxt->wwn);
+ free(cxt->serial);
sysfs_deinit(&cxt->sysfs);
cxt->partuuid = xstrdup(data);
if ((data = udev_device_get_property_value(dev, "ID_WWN")))
cxt->wwn = xstrdup(data);
-
+ if ((data = udev_device_get_property_value(dev, "ID_SERIAL_SHORT")))
+ cxt->serial = xstrdup(data);
udev_device_unref(dev);
cxt->probed = 1;
}
tt_line_set_data(ln, col, p);
}
break;
+ case COL_SERIAL:
+ if (!cxt->partition && cxt->nslaves == 0) {
+ get_udev_properties(cxt);
+ if (cxt->serial)
+ tt_line_set_data(ln, col, xstrdup(cxt->serial));
+ }
+ break;
case COL_REV:
if (!cxt->partition && cxt->nslaves == 0) {
p = sysfs_strdup(&cxt->sysfs, "device/rev");