From: Hannes Reinecke Date: Mon, 12 Nov 2012 14:42:42 +0000 (+0100) Subject: megasas: Correct target/lun mapping X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4003e24fce1df84a2e8c992376ed2c294816c33c;p=people%2Fliuw%2Flibxenctrl-split%2Fqemu-xen.git megasas: Correct target/lun mapping The structure to reference a logical drive has an unused field, which can be used to carry the lun ID. This enabled seabios to establish the proper target/LUN mapping. Cc: Paolo Bonzini Cc: Gerd Hoffmann Signed-off-by: Hannes Reinecke Signed-off-by: Paolo Bonzini --- diff --git a/hw/megasas.c b/hw/megasas.c index b845ea7b4..291ff4040 100644 --- a/hw/megasas.c +++ b/hw/megasas.c @@ -1079,6 +1079,7 @@ static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd) /* Logical device size is in blocks */ bdrv_get_geometry(conf->bs, &ld_size); info.ld_list[num_ld_disks].ld.v.target_id = sdev->id; + info.ld_list[num_ld_disks].ld.v.lun_id = sdev->lun; info.ld_list[num_ld_disks].state = MFI_LD_STATE_OPTIMAL; info.ld_list[num_ld_disks].size = cpu_to_le64(ld_size); num_ld_disks++; diff --git a/hw/mfi.h b/hw/mfi.h index 436b6906b..cd8355bad 100644 --- a/hw/mfi.h +++ b/hw/mfi.h @@ -1085,7 +1085,7 @@ struct mfi_pd_list { union mfi_ld_ref { struct { uint8_t target_id; - uint8_t reserved; + uint8_t lun_id; uint16_t seq; } v; uint32_t ref;