]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
megasas: Correct target/lun mapping
authorHannes Reinecke <hare@suse.de>
Mon, 12 Nov 2012 14:42:42 +0000 (15:42 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Nov 2012 15:42:56 +0000 (16:42 +0100)
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 <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/megasas.c
hw/mfi.h

index b845ea7b481de0334c3d7dd6980796eea17cc547..291ff404030c540ddea8b2fc68668243684f8039 100644 (file)
@@ -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++;
index 436b6906b156abcd81540fe315476be5949b0a33..cd8355badfcc9c8811d2f48f11aa5ab8a8e3ec70 100644 (file)
--- 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;