[Qemu-devel] [PATCH] scsi-bus: Remove tape command from scsi_req_xfer

2016-03-07 Thread Alex Pyrgiotis
Remove the RECOVER_BUFFERED_DATA command from the list of commands that are handled by scsi_req_xfer(). Given that this command is tape-specific, it should be handled only by scsi_stream_req_xfer(). Signed-off-by: Alex Pyrgiotis diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 6dcdbc0

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-25 Thread Alex Pyrgiotis
Hi Paolo, On 02/25/2016 12:22 PM, Paolo Bonzini wrote: > > > On 25/02/2016 11:10, Alex Pyrgiotis wrote: >> 8<... snip ...>8 >> >> Sure, you're right, there's no sensible way to break an ioctl() >> operation in many. However, I'd argue that

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-25 Thread Alex Pyrgiotis
/02/2016 12:50, Alex Pyrgiotis wrote: >> QEMU/Hardware space: >> 5. The SCSI controller code will create a QEMUSGList that points to >>the memory regions of the SCSI request. This QEMUSGList will also >>include the MMIO regions. >> 6. The QEMU device implementatio

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-19 Thread Alex Pyrgiotis
Hi Paolo, Sorry for the late reply and thanks for the review. See my comments inline: On 02/11/2016 01:17 PM, Paolo Bonzini wrote: > > > On 16/12/2015 17:55, Alex Pyrgiotis wrote: >> +/* >> + * Create a QEMUIOVector from a scatter-gather list. >> + * >> + * Thi

Re: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2016-01-11 Thread Alex Pyrgiotis
On 12/17/2015 03:13 PM, Paolo Bonzini wrote: > > > On 17/12/2015 14:10, Alex Pyrgiotis wrote: >>>>>> Which commands have large payloads and are on the data path, for >>>>>> scsi-block? Or is the use case just scsi-generic (e.g. tape devices?)? >&g

Re: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2015-12-21 Thread Alex Pyrgiotis
Hi Paolo, On 12/17/2015 03:13 PM, Paolo Bonzini wrote: > > > On 17/12/2015 14:10, Alex Pyrgiotis wrote: >>>>>> Which commands have large payloads and are on the data path, for >>>>>> scsi-block? Or is the use case just scsi-generic (e.g. tape dev

Re: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2015-12-17 Thread Alex Pyrgiotis
Hi Paolo, On 12/17/2015 12:31 PM, Paolo Bonzini wrote: > > > On 17/12/2015 09:47, Alex Pyrgiotis wrote: >>>> Which commands have large payloads and are on the data path, for >>>> scsi-block? Or is the use case just scsi-generic (e.g. tape devices?)? >>&g

Re: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2015-12-17 Thread Alex Pyrgiotis
Hi Paolo, On 12/16/2015 08:16 PM, Paolo Bonzini wrote: > > > On 16/12/2015 17:55, Alex Pyrgiotis wrote: >> Hi all, >> >> This patch is an attempt to boost the performance of "scsi-generic" and >> "scsi-block" device types, by removing an e

[Qemu-devel] [PATCH 8/9] scsi-generic: Factor out response interception

2015-12-16 Thread Alex Pyrgiotis
scsi_get_buf() function and alter the buffer that it returns. This is also required for the support of scatter-gather lists. Signed-off-by: Alex Pyrgiotis Signed-off-by: Dimitris Aragiorgis diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index 6c0cfa5..6704861 100644 --- a/hw/scsi/scsi

[Qemu-devel] [PATCH 4/9] scsi-generic: Add common functions

2015-12-16 Thread Alex Pyrgiotis
t; functions can be used later on as a common entry point for the read/write operations, in which we can decide whether the device will use an intermediate buffer for requests or the controller's scatter-gather list. Signed-off-by: Alex Pyrgiotis Signed-off-by: Dimitris Aragiorgis diff --git

[Qemu-devel] [PATCH 9/9] scsi-generic: Allow full scatter-gather support

2015-12-16 Thread Alex Pyrgiotis
hdr' struct for scatter-gather operations does not include the `SG_FLAG_DIRECT_IO' flag, since it does not work with iovecs, as explained here [1]. [1]: http://www.tldp.org/HOWTO/SCSI-Generic-HOWTO/x192.html Signed-off-by: Alex Pyrgiotis Signed-off-by: Dimitris Aragiorgis diff --git

[Qemu-devel] [PATCH 7/9] scsi-generic: Make data-copying logic clearer

2015-12-16 Thread Alex Pyrgiotis
d an explanation for what it does. Signed-off-by: Alex Pyrgiotis Signed-off-by: Dimitris Aragiorgis diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index 8e2058d..6c0cfa5 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -54,7 +54,23 @@ typedef struct SCSIGenericRe

[Qemu-devel] [PATCH 2/9] dma-helpers: Add support for ioctl operations

2015-12-16 Thread Alex Pyrgiotis
the iovec stored in the qiov. Signed-off-by: Alex Pyrgiotis Signed-off-by: Dimitris Aragiorgis diff --git a/dma-helpers.c b/dma-helpers.c index c38661e..e1ea7b3 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -79,10 +79,14 @@ typedef struct { QEMUIOVector iov; QEMUBH *bh;

[Qemu-devel] [PATCH 6/9] scsi-generic: Make request execution buf-specific

2015-12-16 Thread Alex Pyrgiotis
support of requests with scatter-gather lists. Signed-off-by: Alex Pyrgiotis Signed-off-by: Dimitris Aragiorgis diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index 71c0110..8e2058d 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -175,20 +175,6 @@ static void

[Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2015-12-16 Thread Alex Pyrgiotis
else. In order to pave the way for the DMA support of ioctl commands, expose the aforementioned logic in a separate function called "dma_map_sg". Also, expose some other important pieces too, such as the initialization of the dbs structure. Signed-off-by: Alex Pyrgiotis Signed-off-by

[Qemu-devel] [PATCH] os-posix: Log to logfile in case of daemonize

2015-12-16 Thread Alex Pyrgiotis
From: Dimitris Aragiorgis In case of daemonize, use the logfile passed with the -D option in order to redirect stdout/stderr to a file instead of /dev/null. Signed-off-by: Dimitris Aragiorgis Signed-off-by: Alex Pyrgiotis diff --git a/include/qemu/log.h b/include/qemu/log.h index 362cbc4

[Qemu-devel] [PATCH 3/9] dma-helpers: Do not truncate small qiovs

2015-12-16 Thread Alex Pyrgiotis
If the size of the qiov is smaller than the sector size, do not truncate the qiov, which would effectively make it empty. Instead, allow it to pass as is. This is necessary for SCSI requests like READ CAPACITY which have small buffers, e.g. 32 bytes. Signed-off-by: Alex Pyrgiotis Signed-off-by

[Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2015-12-16 Thread Alex Pyrgiotis
process and use the resulting iovec as the buffer for the ioctl request. You'll find that the logic is quite similar to the one used in scsi-disk.c. Cheers, Alex Alex Pyrgiotis (9): dma-helpers: Expose the sg mapping logic dma-helpers: Add support for ioctl operations dma-helpers: Do not tr

[Qemu-devel] [PATCH 5/9] scsi-generic: Separate `sg_io_hdr' initializations

2015-12-16 Thread Alex Pyrgiotis
lists. Signed-off-by: Alex Pyrgiotis Signed-off-by: Dimitris Aragiorgis diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index f24f472..71c0110 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -58,6 +58,30 @@ typedef struct SCSIGenericReq { sg_io_hdr_t io_h