[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/21] pc-bios/s390-ccw: Move SCSI block factor to ou
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 02/21] pc-bios/s390-ccw: Move SCSI block factor to outer read |
Date: |
Tue, 23 May 2017 13:12:47 +0200 |
From: Eric Farman <address@hidden>
Simple refactoring so that the blk_factor adjustment is
moved into virtio_scsi_read_many routine, in preparation
for another change.
Signed-off-by: Eric Farman <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
pc-bios/s390-ccw/virtio-scsi.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c
index 69b7a93b29..6d070e2f73 100644
--- a/pc-bios/s390-ccw/virtio-scsi.c
+++ b/pc-bios/s390-ccw/virtio-scsi.c
@@ -142,14 +142,13 @@ static bool scsi_report_luns(VDev *vdev, void *data,
uint32_t data_size)
}
static bool scsi_read_10(VDev *vdev,
- ulong sector, int sectors, void *data)
+ ulong sector, int sectors, void *data,
+ unsigned int data_size)
{
- int f = vdev->blk_factor;
- unsigned int data_size = sectors * virtio_get_block_size() * f;
ScsiCdbRead10 cdb = {
.command = 0x28,
- .lba = sector * f,
- .xfer_length = sectors * f,
+ .lba = sector,
+ .xfer_length = sectors,
};
VirtioCmd read_10[] = {
{ &req, sizeof(req), VRING_DESC_F_NEXT },
@@ -255,7 +254,10 @@ static void virtio_scsi_locate_device(VDev *vdev)
int virtio_scsi_read_many(VDev *vdev,
ulong sector, void *load_addr, int sec_num)
{
- if (!scsi_read_10(vdev, sector, sec_num, load_addr)) {
+ int f = vdev->blk_factor;
+ unsigned int data_size = sec_num * virtio_get_block_size() * f;
+
+ if (!scsi_read_10(vdev, sector * f, sec_num * f, load_addr, data_size)) {
virtio_scsi_verify_response(&resp, "virtio-scsi:read_many");
}
--
2.13.0
- [Qemu-devel] [PULL 00/21] s390x patches, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 01/21] pc-bios/s390-ccw: Remove duplicate blk_factor adjustment, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 02/21] pc-bios/s390-ccw: Move SCSI block factor to outer read,
Cornelia Huck <=
- [Qemu-devel] [PULL 04/21] pc-bios/s390-ccw: Refactor scsi_inquiry function, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 05/21] pc-bios/s390-ccw: Get list of supported VPD pages, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 06/21] pc-bios/s390-ccw: Get Block Limits VPD device data, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 07/21] pc-bios/s390-ccw: Build a reasonable max_sectors limit, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 03/21] pc-bios/s390-ccw: Break up virtio-scsi read into multiples, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 08/21] pc-bios/s390-ccw.img: rebuild image, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 09/21] linux-headers: update, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 10/21] s390x/css: add s390-squash-mcss machine option, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 13/21] s390x/css: device support for s390-ccw passthrough, Cornelia Huck, 2017/05/23
- [Qemu-devel] [PULL 12/21] s390x/css: realize css_create_sch, Cornelia Huck, 2017/05/23