0:0:0:0 is a valid host/bus/target/lun tuple, so don't print that for disappeared paths that are kept in the map in case they come back up.
print_path now prints #:#:#:# instead.
struct path *
alloc_path (void)
{
- return (struct path *)MALLOC(sizeof(struct path));
+ struct path * pp;
+
+ pp = (struct path *)MALLOC(sizeof(struct path));
+
+ if (pp) {
+ pp->sg_id.host_no = -1;
+ pp->sg_id.channel = -1;
+ pp->sg_id.scsi_id = -1;
+ pp->sg_id.lun = -1;
+ }
+ return pp;
}
void
else
printf (" \\_ ");
- printf("%i:%i:%i:%i ",
- pp->sg_id.host_no,
- pp->sg_id.channel,
- pp->sg_id.scsi_id,
- pp->sg_id.lun);
-
+ if (pp->sg_id.host_no < 0)
+ printf("#:#:#:# ");
+ else {
+ printf("%i:%i:%i:%i ",
+ pp->sg_id.host_no,
+ pp->sg_id.channel,
+ pp->sg_id.scsi_id,
+ pp->sg_id.lun);
+ }
if (pp->dev)
printf("%-4s ", pp->dev);