[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/35] scsi: remove devs array from SCSIBus
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 15/35] scsi: remove devs array from SCSIBus |
Date: |
Fri, 21 Oct 2011 14:31:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 |
Am 13.10.2011 13:03, schrieb Paolo Bonzini:
> Change the devs array into a linked list, and add a scsi_device_find
> function to navigate the children list instead. This lets the SCSI
> bus use more complex addressing.
>
> scsi_device_find may return another LUN on the same target if none is
> found that matches exactly.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> hw/esp.c | 5 +++--
> hw/lsi53c895a.c | 22 +++++++---------------
> hw/qdev.h | 2 +-
> hw/scsi-bus.c | 53 ++++++++++++++++++++++++++++++-----------------------
> hw/scsi.h | 3 +--
> hw/spapr_vscsi.c | 14 ++++++--------
> 6 files changed, 48 insertions(+), 51 deletions(-)
>
> diff --git a/hw/esp.c b/hw/esp.c
> index d3fb1c6..8e17005 100644
> --- a/hw/esp.c
> +++ b/hw/esp.c
> @@ -217,7 +217,8 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf)
> s->async_len = 0;
> }
>
> - if (target >= ESP_MAX_DEVS || !s->bus.devs[target]) {
> + s->current_dev = scsi_device_find(&s->bus, target, 0);
> + if (!s->current_dev) {
> // No such drive
> s->rregs[ESP_RSTAT] = 0;
> s->rregs[ESP_RINTR] = INTR_DC;
> @@ -225,7 +226,6 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf)
> esp_raise_irq(s);
> return 0;
> }
> - s->current_dev = s->bus.devs[target];
> return dmalen;
> }
>
> @@ -236,6 +236,7 @@ static void do_busid_cmd(ESPState *s, uint8_t *buf,
> uint8_t busid)
>
> trace_esp_do_busid_cmd(busid);
> lun = busid & 7;
> + s->current_dev = scsi_device_find(&s->bus, s->current_dev->id, lun);
This is new, and I can't see an explanation in the commit log.
Kevin
- [Qemu-devel] [PATCH 19/35] scsi-disk: fail READ CAPACITY if LBA != 0 but PMI == 0, (continued)
- [Qemu-devel] [PATCH 12/35] scsi-disk: report media changed via GET EVENT STATUS NOTIFICATION, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 34/35] scsi: pass cdb to alloc_req, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 15/35] scsi: remove devs array from SCSIBus, Paolo Bonzini, 2011/10/13
- Re: [Qemu-devel] [PATCH 15/35] scsi: remove devs array from SCSIBus,
Kevin Wolf <=
- [Qemu-devel] [PATCH 28/35] scsi-disk: do not duplicate BlockDriverState member, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 21/35] scsi-disk: bump SCSIRequest reference count until aio completion runs, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 31/35] scsi: move max_lba to SCSIDevice, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 29/35] scsi-disk: remove cluster_size, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 27/35] scsi-generic: snoop READ CAPACITY commands to get block size, Paolo Bonzini, 2011/10/13