Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] block: Warn if an if=something drive was also connected manually

2015-06-22 Thread Peter Maydell
On 22 June 2015 at 10:59, Markus Armbruster arm...@redhat.com wrote: What about this instead: 1. When -device creation connects a qdev_prop_drive property to a backend, fail when the backend has a DriveInfo and the DriveInfo has type != IF_NONE. Note: the connection is made in parse_drive().

Re: [Qemu-block] [Qemu-devel] [PATCH v7 00/11] Support streaming to an intermediate layer

2015-06-22 Thread Stefan Hajnoczi
On Wed, May 13, 2015 at 04:27:30PM +0300, Alberto Garcia wrote: v7: - Rebased against the current master - Updated bdrv_drain_all() to use the new block_job_next() API. Please rebase onto https://github.com/stefanha/qemu 'block' branch and check that qemu-iotests 015 030 032 038 046 pass:

Re: [Qemu-block] [PATCH 08/16] ahci: clear error register before NCQ cmd

2015-06-22 Thread John Snow
On 06/22/2015 10:38 AM, Stefan Hajnoczi wrote: On Fri, Jun 19, 2015 at 09:50:39PM -0400, John Snow wrote: The legacy ide command execution layer will clear any errors outstanding before execution, but the NCQ layer doesn't. Even on success, this register will remain clogged. Clear it out

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] block: Warn if an if=something drive was also connected manually

2015-06-22 Thread Markus Armbruster
Peter Maydell peter.mayd...@linaro.org writes: On 22 June 2015 at 10:59, Markus Armbruster arm...@redhat.com wrote: What about this instead: 1. When -device creation connects a qdev_prop_drive property to a backend, fail when the backend has a DriveInfo and the DriveInfo has type !=

Re: [Qemu-block] [PATCH 00/16] ahci: ncq cleanup, part 1

2015-06-22 Thread Stefan Hajnoczi
On Fri, Jun 19, 2015 at 09:50:31PM -0400, John Snow wrote: requires: 1434470575-21625-1-git-send-email-js...@redhat.com [PATCH v2 0/4] ahci: misc fixes/tests for 2.4 This series adds a couple of tests to exercise the NCQ pathways and establish a baseline for us. Most of these

Re: [Qemu-block] [PATCH 08/16] ahci: clear error register before NCQ cmd

2015-06-22 Thread John Snow
On 06/22/2015 10:43 AM, John Snow wrote: On 06/22/2015 10:38 AM, Stefan Hajnoczi wrote: On Fri, Jun 19, 2015 at 09:50:39PM -0400, John Snow wrote: The legacy ide command execution layer will clear any errors outstanding before execution, but the NCQ layer doesn't. Even on success, this

[Qemu-block] [PATCH v8 05/11] block: Add QMP support for streaming to an intermediate layer

2015-06-22 Thread Alberto Garcia
This patch makes the 'device' parameter of the 'block-stream' command accept a node name as well as a device name. In addition to that, operation blockers will be checked in all intermediate nodes between the top and the base node. Since qmp_block_stream() now uses the error from

[Qemu-block] [PATCH v8 04/11] block: Support streaming to an intermediate layer

2015-06-22 Thread Alberto Garcia
This makes sure that the image we are steaming into is open in read-write mode during the operation. Operation blockers are also set in all intermediate nodes, since they will be removed from the chain afterwards. Finally, this also unblocks the stream operation in backing files. Signed-off-by:

[Qemu-block] [PATCH v8 07/11] qemu-iotests: fix test_stream_partial()

2015-06-22 Thread Alberto Garcia
This test is streaming to the top layer using the intermediate image as the base. This is a mistake since block-stream never copies data from the base image and its backing chain, so this is effectively a no-op. In addition to fixing the base parameter, this patch also writes some data to the

[Qemu-block] [PATCH v8 00/11] Support streaming to an intermediate layer

2015-06-22 Thread Alberto Garcia
v8: - Rebased on top of Stefan's block branch (0a35bce416) - The loop that pauses the block jobs in bdrv_drain_all() is now split in two: one that iterates the list of block jobs to stop them, and one that iterates the root bds in order to get the aio contexts. v7:

[Qemu-block] [PATCH v8 09/11] qemu-iotests: test streaming to an intermediate layer

2015-06-22 Thread Alberto Garcia
This adds test_stream_intermediate(), similar to test_stream() but streams to the intermediate image instead. Signed-off-by: Alberto Garcia be...@igalia.com Reviewed-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/030 | 18 +- tests/qemu-iotests/030.out | 4 ++-- 2

[Qemu-block] [PATCH v8 08/11] qemu-iotests: add no-op streaming test

2015-06-22 Thread Alberto Garcia
This patch tests that in a partial block-stream operation, no data is ever copied from the base image. Signed-off-by: Alberto Garcia be...@igalia.com Reviewed-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/030 | 18 ++ tests/qemu-iotests/030.out | 4 ++-- 2 files

[Qemu-block] [PATCH v2 02/16] ahci: use shorter variables

2015-06-22 Thread John Snow
Trivial cleanup that I didn't want to tack-on to anything else. Signed-off-by: John Snow js...@redhat.com --- hw/ide/ahci.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 26df2ca..14eccb8 100644 --- a/hw/ide/ahci.c +++

[Qemu-block] [PATCH v2 04/16] ahci: check for ncq prdtl overflow

2015-06-22 Thread John Snow
Don't attempt the NCQ transfer if the PRDT we were given is not big enough to perform the entire transfer. Signed-off-by: John Snow js...@redhat.com --- hw/ide/ahci.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index

[Qemu-block] [PATCH v2 01/16] ahci: Rename NCQFIS structure fields

2015-06-22 Thread John Snow
Several fields of the NCQFIS structure are ambiguously named. This patch clarifies the intended (if unsupported) usage of the NCQ fields to aid in creating more meaningful debug messages through the NCQ codepaths. Signed-off-by: John Snow js...@redhat.com --- hw/ide/ahci.h | 35

[Qemu-block] [PATCH 05/16] ahci: factor ncq_finish out of ncq_cb

2015-06-22 Thread John Snow
When we add werror=stop or rerror=stop support to NCQ, we'll want to take a codepath where we don't actually complete the command, so factor that out into a new routine. Signed-off-by: John Snow js...@redhat.com --- hw/ide/ahci.c | 32 +++- 1 file changed, 19

[Qemu-block] [PATCH 02/16] ahci: stash ncq command

2015-06-22 Thread John Snow
For migration and werror=stop/rerror=stop resume purposes, it will be convenient to have the command handy inside of ncq_tfs. Eventually, we'd like to avoid reading from the FIS entirely after the initial read, so this is a byte (hah!) sized step in that direction. Signed-off-by: John Snow

Re: [Qemu-block] [Qemu-devel] RFC cdrom in own thread?

2015-06-22 Thread John Snow
On 06/22/2015 09:09 AM, Peter Lieven wrote: Am 22.06.2015 um 11:25 schrieb Stefan Hajnoczi: On Fri, Jun 19, 2015 at 2:14 PM, Peter Lieven p...@kamp.de wrote: Am 18.06.2015 um 11:36 schrieb Stefan Hajnoczi: On Thu, Jun 18, 2015 at 10:29 AM, Peter Lieven p...@kamp.de wrote: Am 18.06.2015 um

[Qemu-block] [PATCH 12/16] ahci: ncq migration

2015-06-22 Thread John Snow
Migrate the NCQ queue. This is solely for the benefit of halted commands, since anything else should have completed and had any relevant status flushed to the HBA registers already. Signed-off-by: John Snow js...@redhat.com --- hw/ide/ahci.c | 49 -

[Qemu-block] [PATCH 14/16] ahci: Do not map cmd_fis to generate response

2015-06-22 Thread John Snow
The Register D2H FIS should copy the current values of the registers instead of just parroting back the same values the guest sent back to it. In this case, the SECTOR COUNT variables are actually not generally meaningful in terms of standard commands (See ATA8-AC3 Section 9.2 Normal Outputs), so

Re: [Qemu-block] [PATCH] block/iscsi: add support for request timeouts

2015-06-22 Thread ronnie sahlberg
LGTM It is good to finally have timeouts that work in libiscsi, and a consumer that can use and benefit from it. On Tue, Jun 16, 2015 at 4:45 AM, Peter Lieven p...@kamp.de wrote: libiscsi starting with 1.15 will properly support timeout of iscsi commands. The default will remain no timeout,

[Qemu-block] [PATCH v2 10/16] libqos/ahci: add NCQ frame support

2015-06-22 Thread John Snow
NCQ frames are generated a little differently than their non-NCQ cousins. Add support for them. Signed-off-by: John Snow js...@redhat.com --- tests/libqos/ahci.c | 44 +++- tests/libqos/ahci.h | 29 - 2 files changed, 63

[Qemu-block] [PATCH v2 09/16] libqos/ahci: fix cmd_sanity for ncq

2015-06-22 Thread John Snow
NCQ commands should not / do not update the byte count in the command header post command, so this field is meaningless for NCQ tests. Signed-off-by: John Snow js...@redhat.com --- tests/libqos/ahci.c | 46 -- tests/libqos/ahci.h | 3 +-- 2 files

[Qemu-block] [PATCH v2 16/16] qtest/ahci: ncq migration test

2015-06-22 Thread John Snow
Signed-off-by: John Snow js...@redhat.com --- tests/ahci-test.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 0d117fe..3f06fd9 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1146,9 +1146,9 @@ static

[Qemu-block] [PATCH v2 14/16] libqos/ahci: Force all NCQ commands to be LBA48

2015-06-22 Thread John Snow
NCQ commands are LBA48 by definition. See SATA 3.2 13.6.4.1 READ FPDMA QUEUED, or SATA 3.2 13.6.5.1 WRITE FPDMA QUEUED. Signed-off-by: John Snow js...@redhat.com --- tests/libqos/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/ahci.c

[Qemu-block] [PATCH 09/16] ahci: correct ncq sector count

2015-06-22 Thread John Snow
uint16_t isn't enough to hold the real sector count, since a value of zero implies a full 64K sectors, so we need a uint32_t here. We *could* cheat and pretend that this value is 0-based and fit it in a uint16_t, but I'd rather waste 2 bytes instead of a future dev's 10 minutes when they forget

[Qemu-block] [PATCH 01/16] ide: add limit to .prepare_buf()

2015-06-22 Thread John Snow
prepare_buf should not always grab as many descriptors as it can, sometimes it should self-limit. For example, an NCQ transfer of 1 sector with a PRDT that describes 4GiB of data should not copy 4GiB of data, it should just transfer that first 512 bytes. PIO is not affected, because the

[Qemu-block] [PATCH 04/16] ahci: refactor process_ncq_command

2015-06-22 Thread John Snow
Split off execute_ncq_command so that we can call it separately later if we desire. Signed-off-by: John Snow js...@redhat.com --- hw/ide/ahci.c | 73 ++- 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/hw/ide/ahci.c

[Qemu-block] [PATCH 00/16] ahci: ncq cleanup, part 2

2015-06-22 Thread John Snow
requires: 1434470575-21625-1-git-send-email-js...@redhat.com 1435016308-6150-1-git-send-email-js...@redhat.com [PATCH v2 0/4] ahci: misc fixes/tests for 2.4 [PATCH v2 00/16] ahci: ncq cleanup, part 1 This chunk gets NCQ migration and and resume support working.

Re: [Qemu-block] [Qemu-devel] [PATCH 3/4] qdev-properties-system: Improve error message for drive assignment conflict

2015-06-22 Thread Markus Armbruster
Peter Maydell peter.mayd...@linaro.org writes: On 22 June 2015 at 10:12, Markus Armbruster arm...@redhat.com wrote: We generally do not end error messages with a period. The message for auto_claimed drives is of the form LOCATION: This went wrong. Advice on how to fix it. All in one

Re: [Qemu-block] RFC cdrom in own thread?

2015-06-22 Thread Stefan Hajnoczi
On Fri, Jun 19, 2015 at 2:14 PM, Peter Lieven p...@kamp.de wrote: Am 18.06.2015 um 11:36 schrieb Stefan Hajnoczi: On Thu, Jun 18, 2015 at 10:29 AM, Peter Lieven p...@kamp.de wrote: Am 18.06.2015 um 10:42 schrieb Kevin Wolf: Am 18.06.2015 um 10:30 hat Peter Lieven geschrieben: Am 18.06.2015 um

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] block: Warn if an if=something drive was also connected manually

2015-06-22 Thread Markus Armbruster
Peter Maydell peter.mayd...@linaro.org writes: Improve the diagnosis of command line errors where the user requested an automatic connection of a drive (via if=something, or by not setting if= and using the board-default-if). We already fail this case if the board actually handles

Re: [Qemu-block] [Qemu-devel] [PATCH 3/4] qdev-properties-system: Improve error message for drive assignment conflict

2015-06-22 Thread Peter Maydell
On 22 June 2015 at 10:12, Markus Armbruster arm...@redhat.com wrote: I think we should just bite the bullet and extend Error to support additional helpful information for humans. ...I thought all of the string was already just helpful information for humans? I certainly hope we aren't expecting

Re: [Qemu-block] [Qemu-devel] [PATCH 2/4] qdev-properties-system: Change set_pointer's parse callback to use Error

2015-06-22 Thread Markus Armbruster
Peter Maydell peter.mayd...@linaro.org writes: Instead of having set_pointer() call a parse callback which returns an error number that we then convert to an Error string with error_set_from_qdev_prop_error(), make the parse callback take an Error** and set the error itself. This will allow

Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/5] raw-posix: Introduce hdev_is_sg()

2015-06-22 Thread Dimitris Aragiorgis
Hello Stefan, Yes, you are right. Using realpath() is a workaround for supporting symlinks, as long as they point to a path starting with /dev/sg. I will remove this reference in the revised version of this patch. However, it still holds that determining whether a filename is an SG device or not

Re: [Qemu-block] [Qemu-devel] [PATCH 2/4] qdev-properties-system: Change set_pointer's parse callback to use Error

2015-06-22 Thread Peter Maydell
On 22 June 2015 at 10:39, Markus Armbruster arm...@redhat.com wrote: Peter Maydell peter.mayd...@linaro.org writes: Instead of having set_pointer() call a parse callback which returns an error number that we then convert to an Error string with error_set_from_qdev_prop_error(), make the parse

Re: [Qemu-block] RFC cdrom in own thread?

2015-06-22 Thread Peter Lieven
Am 22.06.2015 um 11:25 schrieb Stefan Hajnoczi: On Fri, Jun 19, 2015 at 2:14 PM, Peter Lieven p...@kamp.de wrote: Am 18.06.2015 um 11:36 schrieb Stefan Hajnoczi: On Thu, Jun 18, 2015 at 10:29 AM, Peter Lieven p...@kamp.de wrote: Am 18.06.2015 um 10:42 schrieb Kevin Wolf: Am 18.06.2015 um

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] block: Warn if an if=something drive was also connected manually

2015-06-22 Thread Peter Maydell
On 22 June 2015 at 10:59, Markus Armbruster arm...@redhat.com wrote: What about this instead: 1. When -device creation connects a qdev_prop_drive property to a backend, fail when the backend has a DriveInfo and the DriveInfo has type != IF_NONE. Note: the connection is made in parse_drive().

Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/5] raw-posix: Introduce hdev_is_sg()

2015-06-22 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 01:18:43PM +0300, Dimitris Aragiorgis wrote: So I suggest we go with the submitted patch taking into account Eric's proposal: The code first stat()s the given filename to ensure it is a character device node, and then it issues the SG_GET_VERSION_NUM and SG_GET_SCSI_ID

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-Block v6 07/16] Add new block driver interface to connect/disconnect the remote target

2015-06-22 Thread Stefan Hajnoczi
On Sat, Jun 20, 2015 at 11:31:52AM +0800, Wen Congyang wrote: At 2015/6/19 18:49, Stefan Hajnoczi Wrote: On Fri, Jun 19, 2015 at 08:54:56AM +0800, Wen Congyang wrote: On 06/19/2015 12:06 AM, Stefan Hajnoczi wrote: On Thu, Jun 18, 2015 at 10:36:39PM +0800, Wen Congyang wrote: At 2015/6/18

Re: [Qemu-block] [PATCH 06/16] ahci: add ncq debug checks

2015-06-22 Thread Stefan Hajnoczi
On Fri, Jun 19, 2015 at 09:50:37PM -0400, John Snow wrote: @@ -1003,6 +1003,27 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, (uint64_t)ncq_fis-lba0; ncq_tfs-tag = tag; +#ifdef DEBUG_AHCI These sorts of debug ifdefs have a tendency

Re: [Qemu-block] [PATCH 04/16] ahci: check for ncq prdtl overflow

2015-06-22 Thread Stefan Hajnoczi
On Fri, Jun 19, 2015 at 09:50:35PM -0400, John Snow wrote: -/* Note: We calculate the sector count, but don't currently rely on it. - * The total size of the DMA buffer tells us the transfer size instead. */ ncq_tfs-sector_count = ((uint16_t)ncq_fis-sector_count_high 8) |

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-Block v6 07/16] Add new block driver interface to connect/disconnect the remote target

2015-06-22 Thread Wen Congyang
At 2015/6/22 20:39, Stefan Hajnoczi Wrote: On Sat, Jun 20, 2015 at 11:31:52AM +0800, Wen Congyang wrote: At 2015/6/19 18:49, Stefan Hajnoczi Wrote: On Fri, Jun 19, 2015 at 08:54:56AM +0800, Wen Congyang wrote: On 06/19/2015 12:06 AM, Stefan Hajnoczi wrote: On Thu, Jun 18, 2015 at 10:36:39PM

Re: [Qemu-block] [PATCH 04/16] ahci: check for ncq prdtl overflow

2015-06-22 Thread Stefan Hajnoczi
On Fri, Jun 19, 2015 at 09:50:35PM -0400, John Snow wrote: @@ -999,20 +1000,28 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, ((uint64_t)ncq_fis-lba2 16) | ((uint64_t)ncq_fis-lba1 8) |