[Qemu-block] [PATCH] atapi: classify read_cd as conditionally returning data

2016-10-28 Thread John Snow
For the purposes of byte_count_limit verification, add a new flag that identifies read_cd as sometimes returning data, then check the BCL in its command handler after we know that it will indeed return data. Reported-by: Hervé Poussineau Signed-off-by: John Snow

Re: [Qemu-block] [Qemu-devel] [PATCH] block-backend: Always notify on blk_eject

2016-10-28 Thread John Snow
On 10/28/2016 05:23 PM, John Snow wrote: blk_eject is only used by scsi-disk and atapi, and in both cases we only attempt to invoke blk_eject if we have a bona-fide change in tray state. The "issue" here is that the tray state does not generate a QMP event unless there is a medium/BDS

[Qemu-block] [PATCH] block-backend: Always notify on blk_eject

2016-10-28 Thread John Snow
blk_eject is only used by scsi-disk and atapi, and in both cases we only attempt to invoke blk_eject if we have a bona-fide change in tray state. The "issue" here is that the tray state does not generate a QMP event unless there is a medium/BDS attached to the device, so if libvirt et al are

Re: [Qemu-block] [PATCH v5 2/2] qapi: allow blockdev-add for NFS

2016-10-28 Thread Eric Blake
On 10/28/2016 12:09 PM, Ashijeet Acharya wrote: > Introduce new object 'BlockdevOptionsNFS' in qapi/block-core.json to > support blockdev-add for NFS network protocol driver. Also make a new > struct NFSServer to support tcp connection. > > Signed-off-by: Ashijeet Acharya

Re: [Qemu-block] [PATCH v2 0/7] blockjobs: preliminary refactoring work, Pt 1

2016-10-28 Thread Jeff Cody
On Thu, Oct 27, 2016 at 12:06:54PM -0400, John Snow wrote: > This is a follow-up to patches 2-6 of: > [PATCH v2 00/11] blockjobs: Fix transactional race condition > > That series started trying to refactor blockjobs with the goal of > internalizing BlockJob state as a side effect of having gone

Re: [Qemu-block] [PATCH v3] block: Turn on "unmap" in active commit

2016-10-28 Thread Jeff Cody
On Tue, Sep 27, 2016 at 07:14:52PM +0800, Fam Zheng wrote: > We already specified BDRV_O_UNMAP when opening images in 'qemu-img > commit', but didn't turn on the "unmap" in the active commit job. This > patch fixes that so that zeroed clusters in top image can be discarded > which is desired in

[Qemu-block] [PATCH v5 2/2] qapi: allow blockdev-add for NFS

2016-10-28 Thread Ashijeet Acharya
Introduce new object 'BlockdevOptionsNFS' in qapi/block-core.json to support blockdev-add for NFS network protocol driver. Also make a new struct NFSServer to support tcp connection. Signed-off-by: Ashijeet Acharya --- qapi/block-core.json | 74

[Qemu-block] [PATCH v5 1/2] block/nfs: Introduce runtime_opts in NFS

2016-10-28 Thread Ashijeet Acharya
Make NFS block driver use various fine grained runtime_opts. Set .bdrv_parse_filename() to nfs_parse_filename() and introduce two new functions nfs_parse_filename() and nfs_parse_uri() to help parsing the URI. Add a new option "server" which then accepts a new struct NFSServer. "host" is supported

[Qemu-block] [PATCH v5 0/2] allow blockdev-add for NFS

2016-10-28 Thread Ashijeet Acharya
Previously posted series patches: v4: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg07449.html v3: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg06903.html v2: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg05844.html v1:

Re: [Qemu-block] [PATCH] raw-posix: Rename 'raw_s' to 'rs'

2016-10-28 Thread Max Reitz
On 27.10.2016 12:45, Fam Zheng wrote: > It is too confusing because it sounds like a BDRVRawState variable. > > Suggested-by: Max Reitz > Signed-off-by: Fam Zheng > --- > block/raw-posix.c | 56 > +++ > 1

Re: [Qemu-block] [PATCH 0/3] iotests: Skip 162 if there is no SSH support

2016-10-28 Thread Max Reitz
On 12.10.2016 22:49, Max Reitz wrote: > As reported by Hao QingFeng, iotest 162 is currently executed even if > qemu does not have any SSH support (which makes it fail, naturally). > > Fixing that is not so trivial, because qemu-img currently does not > report modules, and SSH can be compiled as

Re: [Qemu-block] [PATCH] iotests: Always use -machine accel=qtest

2016-10-28 Thread Max Reitz
On 17.10.2016 20:39, Max Reitz wrote: > Currently, we only use -machine accel=qtest when qemu is invoked through > the common.qemu functions. However, we always want to use it, so move it > from common.qemu directly into QEMU_OPTIONS. > > Signed-off-by: Max Reitz > --- >

Re: [Qemu-block] [Qemu-devel] [PULL 00/23] Block layer patches

2016-10-28 Thread Peter Maydell
On 27 October 2016 at 19:08, Kevin Wolf wrote: > The following changes since commit 5929d7e8a0e1f4bc3528b50397ae8dd0fd6b: > > Merge remote-tracking branch 'remotes/rth/tags/pull-atomic-20161026' into > staging (2016-10-27 14:06:34 +0100) > > are available in the git

[Qemu-block] [PATCH v4 2/2] qapi: allow blockdev-add for NFS

2016-10-28 Thread Ashijeet Acharya
Introduce new object 'BlockdevOptionsNFS' in qapi/block-core.json to support blockdev-add for NFS network protocol driver. Also make a new struct NFSServer to support tcp connection. Signed-off-by: Ashijeet Acharya --- qapi/block-core.json | 77

[Qemu-block] [PATCH v4 1/2] block/nfs: Introduce runtime_opts in NFS

2016-10-28 Thread Ashijeet Acharya
Make NFS block driver use various fine grained runtime_opts. Set .bdrv_parse_filename() to nfs_parse_filename() and introduce two new functions nfs_parse_filename() and nfs_parse_uri() to help parsing the URI. Add a new option "server" which then accepts a new struct NFSServer. "host" is supported

[Qemu-block] [PATCH v4 0/2] allow blockdev-add for NFS

2016-10-28 Thread Ashijeet Acharya
Previously posted series patches: v3: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg06903.html v2: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg05844.html v1: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg04487.html This series adds blockdev-add support for NFS

Re: [Qemu-block] [PATCH v13 00/19] Support streaming to an intermediate layer

2016-10-28 Thread Kevin Wolf
Am 28.10.2016 um 09:08 hat Alberto Garcia geschrieben: > Hi, > > thank you Kevin and Eric for your comments. I addressed them all in > this series. Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [PATCH v2 0/2] less confusing block file names

2016-10-28 Thread Laszlo Ersek
On 10/27/16 21:48, Eric Blake wrote: > Based on a suggestion here: > https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg00350.html > > v1 was here, and got some R-b but also some discussion: > https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg04618.html > > Since then: > patch 1:

[Qemu-block] [PATCH v13 15/19] qemu-iotests: Test block-stream and block-commit in parallel

2016-10-28 Thread Alberto Garcia
As with test_stream_parallel(), we allow mixing block-stream and block-commit operations in the same backing chain as long as there's no overlap among the involved nodes. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/030 | 30 ++

[Qemu-block] [PATCH v13 14/19] qemu-iotests: Test overlapping stream and commit operations

2016-10-28 Thread Alberto Garcia
These test cases check that it's not possible to perform two block-stream or block-commit operations if there are nodes involved in both. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- tests/qemu-iotests/030 | 89

[Qemu-block] [PATCH v13 13/19] qemu-iotests: Test block-stream operations in parallel

2016-10-28 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: Kevin Wolf --- tests/qemu-iotests/030 | 80

[Qemu-block] [PATCH v13 01/19] block: Add bdrv_drain_all_{begin, end}()

2016-10-28 Thread Alberto Garcia
bdrv_drain_all() doesn't allow the caller to do anything after all pending requests have been completed but before block jobs are resumed. This patch splits bdrv_drain_all() into _begin() and _end() for that purpose. It also adds aio_{disable,enable}_external() calls to disable external clients

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

2016-10-28 Thread Alberto Garcia
Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- docs/live-block-ops.txt | 36 +--- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/docs/live-block-ops.txt b/docs/live-block-ops.txt index

[Qemu-block] [PATCH v13 09/19] block: Support streaming to an intermediate layer

2016-10-28 Thread Alberto Garcia
This makes sure that the image we are streaming 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.

[Qemu-block] [PATCH v13 19/19] qemu-iotests: Test the 'base-node' parameter of 'block-stream'

2016-10-28 Thread Alberto Garcia
The block-stream command has traditionally used the 'base' parameter to indicate the image to copy the data from. This test checks that the 'base-node' parameter can also be used for the same purpose. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/030 | 37

[Qemu-block] [PATCH v13 04/19] block: Use block_job_add_bdrv() in mirror_start_job()

2016-10-28 Thread Alberto Garcia
Use block_job_add_bdrv() instead of blocking all operations in mirror_start_job() and unblocking them in mirror_exit(). Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/mirror.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[Qemu-block] [PATCH v13 17/19] qemu-iotests: Test streaming to a Quorum child

2016-10-28 Thread Alberto Garcia
Quorum children are special in the sense that they're not directly attached to a block backend but they're not used as backing images either. However the intermediate block streaming code supports streaming to them. This is a test case for that scenario. Signed-off-by: Alberto Garcia

[Qemu-block] [PATCH v13 00/19] Support streaming to an intermediate layer

2016-10-28 Thread Alberto Garcia
Hi, thank you Kevin and Eric for your comments. I addressed them all in this series. Berto v13: - Patch 10: explain that the 'base-node' parameter can be used to detect whether we support streaming to an intermediate node. - Patch 12: Revert the blkdebug removal, it is indeed necessary to

[Qemu-block] [PATCH v13 02/19] block: Pause all jobs during bdrv_reopen_multiple()

2016-10-28 Thread Alberto Garcia
When a BlockDriverState is about to be reopened it can trigger certain operations that need to write to disk. During this process a different block job can be woken up. If that block job completes and also needs to call bdrv_reopen() it can happen that it needs to do it on the same

[Qemu-block] [PATCH v13 16/19] qemu-iotests: Add iotests.supports_quorum()

2016-10-28 Thread Alberto Garcia
There's many tests that need Quorum support in order to run. At the moment each test implements its own check to see if Quorum is enabled. This patch centralizes all those checks in a new function called iotests.supports_quorum(). Signed-off-by: Alberto Garcia Reviewed-by:

[Qemu-block] [PATCH v13 18/19] block: Add 'base-node' parameter to the 'block-stream' command

2016-10-28 Thread Alberto Garcia
The way to specify the node from which to copy data in the block-stream operation is by using the 'base' parameter. This parameter however takes a file name, not a node name. Since we want to be able to perform this operation using only node names, this patch adds a new 'base-node' parameter.

[Qemu-block] [PATCH v13 07/19] block: Block all nodes involved in the block-commit operation

2016-10-28 Thread Alberto Garcia
After a successful block-commit operation all nodes between top and base are removed from the backing chain, and top's overlay needs to be updated to point to base. Because of that we should prevent other block jobs from messing with them. This patch blocks all operations in these nodes in

[Qemu-block] [PATCH v13 06/19] block: Check blockers in all nodes involved in a block-commit job

2016-10-28 Thread Alberto Garcia
qmp_block_commit() checks for op blockers in the active and destination (base) images. However all nodes between top_bs and base are also involved, and they are removed from the chain afterwards. In addition to that, if top_bs is not the active layer then top_bs's overlay also needs to be checked

[Qemu-block] [PATCH v13 05/19] block: Use block_job_add_bdrv() in backup_start()

2016-10-28 Thread Alberto Garcia
Use block_job_add_bdrv() instead of blocking all operations in backup_start() and unblocking them in backup_run(). Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/backup.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git

[Qemu-block] [PATCH v13 03/19] block: Add block_job_add_bdrv()

2016-10-28 Thread Alberto Garcia
When a block job is created on a certain BlockDriverState, operations are blocked there while the job exists. However, some block jobs may involve additional BDSs, which must be blocked separately when the job is created and unblocked manually afterwards. This patch adds block_job_add_bdrv(),

[Qemu-block] [PATCH v13 12/19] qemu-iotests: Test streaming to an intermediate layer

2016-10-28 Thread Alberto Garcia
This adds test_stream_intermediate(), similar to test_stream() but streams to the intermediate image instead. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/030 | 21 - tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 22 insertions(+), 3

[Qemu-block] [PATCH v13 08/19] block: Block all intermediate nodes in commit_active_start()

2016-10-28 Thread Alberto Garcia
When block-commit is launched without the top parameter, it uses internally a mirror block job. In that case all intermediate nodes between the active and base nodes must be blocked as well. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf ---