qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] megasas: Correct target/lun mapping
@ 2012-11-12 14:42 Hannes Reinecke
  2012-11-12 15:43 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2012-11-12 14:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Hannes Reinecke, Gerd Hofmann

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.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hofmann <kraxel@redhat.com>

diff --git a/hw/megasas.c b/hw/megasas.c
index 7a2036e..395feb3 100644
--- a/hw/megasas.c
+++ b/hw/megasas.c
@@ -1080,6 +1080,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 436b690..cd8355b 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] megasas: Correct target/lun mapping
  2012-11-12 14:42 [Qemu-devel] [PATCH] megasas: Correct target/lun mapping Hannes Reinecke
@ 2012-11-12 15:43 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2012-11-12 15:43 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: qemu-devel, Gerd Hofmann

Il 12/11/2012 15:42, Hannes Reinecke ha scritto:
> 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.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Gerd Hofmann <kraxel@redhat.com>

Applied to scsi-next branch.

Paolo

> 
> diff --git a/hw/megasas.c b/hw/megasas.c
> index 7a2036e..395feb3 100644
> --- a/hw/megasas.c
> +++ b/hw/megasas.c
> @@ -1080,6 +1080,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 436b690..cd8355b 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;
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-12 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-12 14:42 [Qemu-devel] [PATCH] megasas: Correct target/lun mapping Hannes Reinecke
2012-11-12 15:43 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).