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
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 20:55, Stefan Hajnoczi Wrote: >>> On Thu, Jun 18, 2015 at 04:49:12PM +0800, Wen Congyang wrote: +void bdrv_connect(BlockDriverState *bs, Error **errp) +{ +

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

2015-06-22 Thread Peter Lieven
Am 22.06.2015 um 23:54 schrieb 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 wrote: Am 18.06.2015 um 11:36 schrieb Stefan Hajnoczi: On Thu, Jun 18, 2015 at 10:29 AM, Peter Lieven wrote:

[Qemu-block] PIO Setup FIS and Clairvoyance Registers

2015-06-22 Thread John Snow
The PIO Setup FIS specification in the SATA 3.2 spec is an odd one for me: It specifies that, due to the stringent timing of the ATA/PIO protocols that the Setup FIS is always sent immediately prior to the Data FIS. The Setup FIS in this case contains both the value of the register before the dat

[Qemu-block] [PATCH 16/16] ahci: fix sdb fis semantics

2015-06-22 Thread John Snow
There are two things to fix here: The first one is subtle: the PxSACT register in the AHCI HBA has different semantics from the field it is shadowing, the ACT field in the Set Device Bits FIS. In the HBA register, PxSACT acts as a bitfield indicating outstanding NCQ commands where a set bit indic

[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

[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 --- hw/ide/ahci.c | 49 - 1 file changed,

[Qemu-block] [PATCH 13/16] ahci: add get_cmd_header helper

2015-06-22 Thread John Snow
cur_cmd is an internal bookmark that points to the current AHCI Command Header being processed by the AHCI state machine. With NCQ needing to occasionally rely on some of the same AHCI helpers, we cannot use cur_cmd and will need to grab explicit pointers instead. In an attempt to begin relying on

[Qemu-block] [PATCH 10/16] qtest/ahci: halted NCQ test

2015-06-22 Thread John Snow
Signed-off-by: John Snow --- 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 3f06fd9..c30837b 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1200,13 +1200,13 @@ static void test_migr

[Qemu-block] [PATCH 11/16] ahci: add cmd header to ncq transfer state

2015-06-22 Thread John Snow
While the rest of the AHCI device can rely on a single bookmarked pointer for the AHCI Command Header currently being processed, NCQ is asynchronous and may have many commands in flight simultaneously. Add a cmdh pointer to the ncq_tfs object and make the sglist prepare function take an AHCICmdHea

[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 to

[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 dma_buf_r

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

2015-06-22 Thread John Snow
Signed-off-by: John Snow --- 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 c30837b..87d7691 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1269,13 +1269,13 @@ static void test_halt

[Qemu-block] [PATCH 08/16] ahci: correct types in NCQTransferState

2015-06-22 Thread John Snow
Signed-off-by: John Snow --- hw/ide/ahci.c | 10 +- hw/ide/ahci.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 6233059..7fcc6a2 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -45,7 +45,7 @@ do { \ } while (0) static v

[Qemu-block] [PATCH 07/16] ahci: kick NCQ queue

2015-06-22 Thread John Snow
Upon a VM state change, retry the halted NCQ commands. Signed-off-by: John Snow --- hw/ide/ahci.c | 18 ++ hw/ide/core.c | 7 +++ hw/ide/internal.h | 1 + 3 files changed, 26 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index a838317..6233059 100644 ---

[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 ---

[Qemu-block] [PATCH 06/16] ahci: record ncq failures

2015-06-22 Thread John Snow
Handle NCQ failures for cases where we want to halt the VM on IO errors. Signed-off-by: John Snow --- hw/ide/ahci.c | 17 +++-- hw/ide/ahci.h | 1 + hw/ide/internal.h | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index

[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 --- hw/ide/ahci.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletio

[Qemu-block] [PATCH 03/16] ahci: assert is_ncq for process_ncq

2015-06-22 Thread John Snow
We already checked this in the handle_cmd phase, so just change this to an assertion and simplify the error logic. (Also, fix the switch indent, because checkpatch.pl yelled.) ((Sorry for churn.)) Signed-off-by: John Snow --- hw/ide/ahci.c | 60 ++

[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 --- hw/ide/ahci.c | 73 ++- 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 2d7

[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. There

[Qemu-block] [PATCH v2 11/16] libqos/ahci: edit wait to be ncq aware

2015-06-22 Thread John Snow
The wait command should check to make sure SACT is clear as well as the Command Issue register. Signed-off-by: John Snow --- tests/libqos/ahci.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 9a4d510..da02e2e 100644

[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 --- tests/libqos/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 7c

[Qemu-block] [PATCH v2 13/16] libqos/ahci: set the NCQ tag on command_commit

2015-06-22 Thread John Snow
NCQ commands have the concept of a "TAG" that they need to set, but in the AHCI world, it is mandated that the TAG always match the command slot that you executed the NCQ from. See AHCI 9.3.1.1.5.2 "Native Queued Commands". Signed-off-by: John Snow --- tests/libqos/ahci.c | 5 + 1 file chan

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

2015-06-22 Thread John Snow
Signed-off-by: John Snow --- 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 void test_migrat

[Qemu-block] [PATCH v2 08/16] ahci/qtest: Execute IDENTIFY prior to data commands

2015-06-22 Thread John Snow
If you try to execute an NCQ command before trying to engage with the device by issuing an IDENTIFY command, the error bits that are part of the signature will fool the test suite into thinking there was a failure. Issue IDENTIFY first on "boot", which will clear the signature out of the registers

[Qemu-block] [PATCH v2 07/16] ahci: ncq sector count correction

2015-06-22 Thread John Snow
This value should not be size-corrected, 0 sectors does not imply 1 sector(s). This is just debug information, but it's misleading! Signed-off-by: John Snow --- hw/ide/ahci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index c2e6642..95

[Qemu-block] [PATCH v2 12/16] libqos/ahci: adjust expected NCQ interrupts

2015-06-22 Thread John Snow
NCQ commands will expect the SDBS interrupt, and in the normative case, do not expect to see a D2H Register FIS unless something went wrong. Signed-off-by: John Snow --- tests/libqos/ahci.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/libqos/ahci.c b/tests/l

[Qemu-block] [PATCH v2 15/16] qtest/ahci: simple ncq data test

2015-06-22 Thread John Snow
Test the NCQ pathways for a simple IO RW test. Also, test that libqos doesn't explode when running NCQ commands :) Signed-off-by: John Snow --- tests/ahci-test.c | 13 + tests/libqos/ahci.c | 46 +- tests/libqos/ahci.h | 27 ++

[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 --- tests/libqos/ahci.c | 44 +++- tests/libqos/ahci.h | 29 - 2 files changed, 63 insertions(+), 10 deleti

[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 --- tests/libqos/ahci.c | 46 -- tests/libqos/ahci.h | 3 +-- 2 files changed, 25 insertion

[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 --- hw/ide/ahci.h | 35 +-

[Qemu-block] [PATCH v2 03/16] ahci: add ncq_err helper

2015-06-22 Thread John Snow
Set some appropriate error bits for NCQ for us. Signed-off-by: John Snow --- hw/ide/ahci.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 14eccb8..375aa44 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -922,6 +922,15 @@

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

2015-06-22 Thread John Snow
Most of the time, these bits can be safely ignored. For the purposes of debugging however, it's nice to know that they're not being used. Signed-off-by: John Snow --- hw/ide/ahci.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 14

[Qemu-block] [PATCH v2 05/16] ahci: separate prdtl from opts

2015-06-22 Thread John Snow
There's no real reason to have it bundled together, and this way is a little nicer to follow if you have the AHCI spec pulled up. Signed-off-by: John Snow --- hw/ide/ahci.c | 23 --- hw/ide/ahci.h | 3 ++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/hw/i

[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 --- 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 +++ b/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 --- 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 375aa44..24c4832 100

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

2015-06-22 Thread John Snow
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 patches are fairly short and should be relatively trivial to review.

[Qemu-block] [PATCHv2 for-2.4] block: Auto-generate node_names for each BDS entry

2015-06-22 Thread Eric Blake
From: Jeff Cody Currently, node_name is only filled in when done so explicitly by the user. If no node_name is specified, then the node name field is not populated. If node_names are automatically generated when not specified, that means that all block job operations can be done by reference to

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 wrote: > libiscsi starting with 1.15 will properly support timeout of iscsi > commands. The default will remain no timeout, but this ca

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 wrote: >>> Am 18.06.2015 um 11:36 schrieb Stefan Hajnoczi: On Thu, Jun 18, 2015 at 10:29 AM, Peter Lieven wrote: > Am 18.06.2015 um 10:42 schri

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 >>> s

[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: https://lists.gnu.org/archiv

[Qemu-block] [PATCH v8 10/11] qemu-iotests: test block-stream operations in parallel

2015-06-22 Thread Alberto Garcia
This test case checks that it's possible to launch several stream operations in parallel in the same snapshot chain, each one involving a different set of nodes. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- tests/qemu-iotests/030 | 80

[Qemu-block] [PATCH v8 11/11] qemu-iotests: test overlapping block-stream operations

2015-06-22 Thread Alberto Garcia
This test case checks that it's not possible to perform two block-stream operations if there are nodes involved in both. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- tests/qemu-iotests/030 | 27 +++ tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 2

[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 inte

[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 Reviewed-by: Max Reitz --- tests/qemu-iotests/030 | 18 +- tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 19 insertions(+), 3 d

[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 bdrv_lookup_bs()

[Qemu-block] [PATCH v8 01/11] block: keep a list of block jobs

2015-06-22 Thread Alberto Garcia
The current way to obtain the list of existing block jobs is to iterate over all root nodes and check which ones own a job. Since we want to be able to support block jobs in other nodes as well, this patch keeps a list of jobs that is updated every time one is created or destroyed. This also upda

[Qemu-block] [PATCH v8 02/11] block: allow block jobs in any arbitrary node

2015-06-22 Thread Alberto Garcia
Currently, block jobs can only be owned by root nodes. This patch allows block jobs to be in any arbitrary node, by making the following changes: - Block jobs can now be identified by the node name of their BlockDriverState in addition to the device name. Since both device and node names live

[Qemu-block] [PATCH v8 06/11] docs: Document how to stream to an intermediate layer

2015-06-22 Thread Alberto Garcia
Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- docs/live-block-ops.txt | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/live-block-ops.txt b/docs/live-block-ops.txt index a257087..a05d869 100644 --- a/do

[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 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 Reviewed-by: Max Reitz --- tests/qemu-iotests/030 | 18 ++ tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 20 insertions(+), 2 deletion

[Qemu-block] [PATCH v8 03/11] block: never cancel a streaming job without running stream_complete()

2015-06-22 Thread Alberto Garcia
We need to call stream_complete() in order to do all the necessary clean-ups, even if there's an early failure. At the moment it's only useful to make sure that s->backing_file_str is not leaked, but it will become more important as we introduce support for streaming to any intermediate node. Sign

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] [Qemu-devel] [PATCH 1/4] block: Warn if an if= drive was also connected manually

2015-06-22 Thread Peter Maydell
On 22 June 2015 at 10:59, Markus Armbruster 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(). > > 2. This

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 th

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

2015-06-22 Thread Markus Armbruster
Peter Maydell writes: > On 22 June 2015 at 10:59, Markus Armbruster 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

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. >> >> Cle

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

2015-06-22 Thread Stefan Hajnoczi
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 before each NCQ command so the guest can tell

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] [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 ten

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

2015-06-22 Thread John Snow
On 06/22/2015 10:06 AM, Stefan Hajnoczi wrote: > 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) | (uint64_t)ncq_fi

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) | > (uint

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] [Qemu-devel] [PATCH 1/4] block: Warn if an if= drive was also connected manually

2015-06-22 Thread Peter Maydell
On 22 June 2015 at 10:59, Markus Armbruster 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(). So, the rea

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 wrote: Am 18.06.2015 um 11:36 schrieb Stefan Hajnoczi: On Thu, Jun 18, 2015 at 10:29 AM, Peter Lieven wrote: Am 18.06.2015 um 10:42 schrieb Kevin Wolf: Am 18.06.2015 um 10:30 hat Peter Lieven gesch

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

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_

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 writes: > On 22 June 2015 at 10:39, Markus Armbruster wrote: >> Peter Maydell 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 ca

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 writes: > On 22 June 2015 at 10:12, Markus Armbruster 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 awfully long line. A frien

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 no

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 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 anybody to pars

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 wrote: > Peter Maydell 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 s

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

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

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 wrote: > Am 18.06.2015 um 11:36 schrieb Stefan Hajnoczi: >> On Thu, Jun 18, 2015 at 10:29 AM, Peter Lieven 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 09:45 sch

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 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 parse routines > to pr

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 writes: > If the user forgot if=none on their drive specification they're likely > to get an error message because the drive is assigned once automatically > by QEMU and once by the manual id=/drive= user command line specification. > Improve the error message produced in this case