[Qemu-block] [PATCH v8 1/2] raw_bsd: add offset and size options

2016-10-31 Thread Tomáš Golembiovský
Added two new options 'offset' and 'size'. This makes it possible to use only part of the file as a device. This can be used e.g. to limit the access only to single partition in a disk image or use a disk inside a tar archive (like OVA). When 'size' is specified we do our best to honour it. Signe

[Qemu-block] [PATCH v8 0/2] Add 'offset' and 'size' options

2016-10-31 Thread Tomáš Golembiovský
v7 -> v8: - handling offset in raw_co_pwrite_zeroes and raw_co_pdiscard (+tests) - offset and size are not allowed for SCSI generic devices - raw_aio_ioctl: not allowed when offset or size is set - raw_probe_blocksizes: return -ENOTSUP if offset is not multiple of block size - raw_probe_geometry: r

[Qemu-block] [PATCH v8 2/2] qemu-iotests: test 'offset' and 'size' options in raw driver

2016-10-31 Thread Tomáš Golembiovský
Signed-off-by: Tomáš Golembiovský --- tests/qemu-iotests/171 | 212 ++ tests/qemu-iotests/171.out | 313 + tests/qemu-iotests/group | 1 + 3 files changed, 526 insertions(+) create mode 100755 tests/qemu-iotests/171

Re: [Qemu-block] [PATCH v8 0/2] Add 'offset' and 'size' options

2016-10-31 Thread Kevin Wolf
Am 31.10.2016 um 11:27 hat Tomáš Golembiovský geschrieben: > v7 -> v8: > - handling offset in raw_co_pwrite_zeroes and raw_co_pdiscard (+tests) > - offset and size are not allowed for SCSI generic devices > - raw_aio_ioctl: not allowed when offset or size is set > - raw_probe_blocksizes: return -EN

Re: [Qemu-block] [PATCH v8 1/2] raw_bsd: add offset and size options

2016-10-31 Thread Kevin Wolf
Am 31.10.2016 um 11:27 hat Tomáš Golembiovský geschrieben: > Added two new options 'offset' and 'size'. This makes it possible to use > only part of the file as a device. This can be used e.g. to limit the > access only to single partition in a disk image or use a disk inside a > tar archive (like

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

2016-10-31 Thread Kevin Wolf
Am 28.10.2016 um 19:09 hat Ashijeet Acharya geschrieben: > 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 "serv

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

2016-10-31 Thread Kevin Wolf
Am 28.10.2016 um 23:30 hat John Snow geschrieben: > 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

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

2016-10-31 Thread Kevin Wolf
Am 29.10.2016 um 00:32 hat John Snow geschrieben: > 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

Re: [Qemu-block] [Qemu-devel] [PATCH 1/6] iotests: throw away test timings if args change

2016-10-31 Thread Kevin Wolf
Am 20.09.2016 um 16:39 hat Daniel P. Berrange geschrieben: > On Tue, Sep 20, 2016 at 09:38:33AM -0500, Eric Blake wrote: > > On 09/20/2016 09:15 AM, Daniel P. Berrange wrote: > > >>> I guess we could keep things simple by not inventing a new format, > > >>> but instead of using 'check.time', use 'c

Re: [Qemu-block] [Qemu-devel] [PATCH 1/6] iotests: throw away test timings if args change

2016-10-31 Thread Daniel P. Berrange
On Mon, Oct 31, 2016 at 03:28:23PM +0100, Kevin Wolf wrote: > Am 20.09.2016 um 16:39 hat Daniel P. Berrange geschrieben: > > On Tue, Sep 20, 2016 at 09:38:33AM -0500, Eric Blake wrote: > > > On 09/20/2016 09:15 AM, Daniel P. Berrange wrote: > > > >>> I guess we could keep things simple by not inven

Re: [Qemu-block] [PATCH] block: Mention replication in BlockdevDriver enum docs

2016-10-31 Thread Kevin Wolf
Am 27.10.2016 um 22:23 hat Eric Blake geschrieben: > Missed in commit 82ac554. > > Signed-off-by: Eric Blake Thanks, applied to the block branch. Kevin

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

2016-10-31 Thread Ashijeet Acharya
Previously posted series patches: v5: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg07580.html 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

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

2016-10-31 Thread John Snow
On 10/30/2016 01:49 PM, Hervé Poussineau wrote: Le 29/10/2016 à 00:32, John Snow a écrit : 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 d

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

2016-10-31 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. Signed-off-by: Ashi

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

2016-10-31 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 04/14] qemu-img: Set "share-rw" flag in read-only commands

2016-10-31 Thread Fam Zheng
Checking the status of an image when it is being used by guest is usually useful, and there is no risk of corrupting data, so don't let the upcoming image locking feature limit this use case. Signed-off-by: Fam Zheng --- qemu-img.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-)

[Qemu-block] [PATCH 07/14] iotests: 055: Don't attach the drive to vm for drive-backup

2016-10-31 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/055 | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055 index 1d3fd04..20a7596 100755 --- a/tests/qemu-iotests/055 +++ b/tests/qemu-iotests/055 @@ -45

[Qemu-block] [PATCH 08/14] iotests: 030: Read-only open image for getting map

2016-10-31 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/030 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 107049b..c0ab4df 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -95,7 +95,7 @@ class TestSingleDri

[Qemu-block] [PATCH 02/14] block: Define BDRV_O_SHARE_RW

2016-10-31 Thread Fam Zheng
Signed-off-by: Fam Zheng --- include/block/block.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/block/block.h b/include/block/block.h index 107c603..d09a932 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -98,6 +98,8 @@ typedef struct HDGeometry {

[Qemu-block] [PATCH 00/14] block: Image locking series

2016-10-31 Thread Fam Zheng
This is v9 of the image locking series. I redid the whole series, adopting the "two locks" approach from Kevin and Max. Depends on "[Qemu-devel] [PATCH] raw-posix: Rename 'raw_s' to 'rs'" in Max's block branch. Fam Zheng (14): osdep: Add qemu_lock_fd and qemu_unlock_fd block: Define BDRV_O_SH

[Qemu-block] [PATCH 10/14] iotests: 085: Avoid image locking conflict

2016-10-31 Thread Fam Zheng
In the case where we test the expected error when a blockdev-snapshot target already has a backing image, backing chain is opened multiple times. This will be a problem when we use image locking, so use a different backing file that is not already open. Signed-off-by: Fam Zheng --- tests/qemu-io

[Qemu-block] [PATCH 09/14] iotests: 087: Don't attch test image twice

2016-10-31 Thread Fam Zheng
The test scenario doesn't require the same image, instead it focuses on the duplicated node-name, so use null-co to avoid locking conflict. Signed-off-by: Fam Zheng --- tests/qemu-iotests/087 | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/087 b/tests

[Qemu-block] [PATCH 05/14] block: Set "share-rw" flag in drive-backup when sync=none

2016-10-31 Thread Fam Zheng
In this case we may open the source's backing image chain multiple times. Setting share flag means the new open won't try to acquire or check any lock, once we implement image locking. Signed-off-by: Fam Zheng --- An alternative is reusing (and bdrv_ref) the existing source's backing bs instead

[Qemu-block] [PATCH 11/14] iotests: 091: Quit QEMU before checking image

2016-10-31 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/091 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091 index 32bbd56..10ac4a8 100755 --- a/tests/qemu-iotests/091 +++ b/tests/qemu-iotests/091 @@ -95,7 +95,9 @@ echo "vm2: qemu process running succe

[Qemu-block] [PATCH 14/14] tests: Add test-image-lock

2016-10-31 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/Makefile.include | 2 + tests/test-image-lock.c | 179 2 files changed, 181 insertions(+) create mode 100644 tests/test-image-lock.c diff --git a/tests/Makefile.include b/tests/Makefile.include index cd058ef.

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

2016-10-31 Thread John Snow
On 10/31/2016 10:06 AM, Kevin Wolf wrote: Am 29.10.2016 um 00:32 hat John Snow geschrieben: 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

[Qemu-block] block/nfs: qemu-iotests 077 failing

2016-10-31 Thread Kevin Wolf
Hi Peter, while testing the blockdev-add for NFS series, I noticed that apart from a few obvious false positives, qemu-iotests case 077 fails in a concerning way: --- /home/kwolf/source/qemu/tests/qemu-iotests/077.out 2016-09-14 11:23:41.143593271 +0200 +++ 077.out.bad 2016-10-31 16:27:17.64470

[Qemu-block] [PATCH 01/14] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-10-31 Thread Fam Zheng
They are wrappers of POSIX fcntl "file private locking". Signed-off-by: Fam Zheng --- include/qemu/osdep.h | 2 ++ util/osdep.c | 29 + 2 files changed, 31 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 0e3c330..f15e122 100644 -

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

2016-10-31 Thread Kevin Wolf
Am 31.10.2016 um 16:05 hat Ashijeet Acharya geschrieben: > 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 "serv

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

2016-10-31 Thread John Snow
On 10/31/2016 10:13 AM, Kevin Wolf wrote: Am 28.10.2016 um 23:30 hat John Snow geschrieben: 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" h

[Qemu-block] [PATCH 03/14] qemu-io: Set "share-rw" flag together with read-only

2016-10-31 Thread Fam Zheng
qemu-io is a low level tool to read or modify guest visible data, which implies the user knows very well what is being done. Allowing reading from a locked image is harmless in most cases, so do it. Signed-off-by: Fam Zheng --- qemu-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu

[Qemu-block] [PATCH 06/14] block: Set "share-rw" flag for incoming migration

2016-10-31 Thread Fam Zheng
In this way the source side QEMU is writing to the image. We need to open it, so share-rw is required. Signed-off-by: Fam Zheng --- blockdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 9992c5d..230c7c1 100644 --- a/blockdev.c +++ b/bloc

[Qemu-block] [PATCH 12/14] tests: Use null-co:// instead of /dev/null as the dummy image

2016-10-31 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/drive_del-test.c| 2 +- tests/nvme-test.c | 2 +- tests/usb-hcd-uhci-test.c | 2 +- tests/usb-hcd-xhci-test.c | 2 +- tests/virtio-blk-test.c | 2 +- tests/virtio-scsi-test.c | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a

[Qemu-block] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 Thread Fam Zheng
This implements open flag sensible image locking for local file and host device protocol. virtlockd in libvirt locks the first byte, so we start looking at the file bytes from 1. Quoting what was proposed by Kevin Wolf , there are four locking modes by combining two bits (BDRV_O_RDWR and BDRV_O_S

Re: [Qemu-block] [PATCH v6 0/2] allow blockdev-add for NFS

2016-10-31 Thread Kevin Wolf
Am 31.10.2016 um 16:05 hat Ashijeet Acharya geschrieben: > Previously posted series patches: > v5: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg07580.html > v4: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg07449.html > v3: https://lists.gnu.org/archive/html/qemu-devel/2016-1

[Qemu-block] [PULL 02/29] util/qemu-sockets: Make inet_connect_saddr() public

2016-10-31 Thread Kevin Wolf
From: Ashijeet Acharya Make inet_connect_saddr() in util/qemu-sockets.c public in order to be able to use it with InetSocketAddress sockets outside of util/qemu-sockets.c independently. Signed-off-by: Ashijeet Acharya Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/qemu/sockets

[Qemu-block] [PULL 01/29] block/ssh: Add ssh_has_filename_options_conflict()

2016-10-31 Thread Kevin Wolf
From: Ashijeet Acharya We have 5 options plus ("server") option which is added in the next patch that conflict with specifying a SSH filename. We need to iterate over all the options to check whether its key has an "server." prefix. This iteration will help us adding the new option "server" easi

[Qemu-block] [PULL 00/29] Block layer patches

2016-10-31 Thread Kevin Wolf
The following changes since commit 0bb1137930f51a89fb1bfeb0c46aa68af0395167: Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20161031' into staging (2016-10-31 14:48:47 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream

[Qemu-block] [PULL 04/29] block/ssh: Use InetSocketAddress options

2016-10-31 Thread Kevin Wolf
From: Ashijeet Acharya Drop the use of legacy options in favour of the InetSocketAddress options. Signed-off-by: Ashijeet Acharya Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/ssh.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --g

[Qemu-block] [PULL 03/29] block/ssh: Add InetSocketAddress and accept it

2016-10-31 Thread Kevin Wolf
From: Ashijeet Acharya Add InetSocketAddress compatibility to SSH driver. Add a new option "server" to the SSH block driver which then accepts a InetSocketAddress. "host" and "port" are supported as legacy options and are mapped to their InetSocketAddress representation. Signed-off-by: Ashijee

[Qemu-block] [PULL 08/29] block: Add block_job_add_bdrv()

2016-10-31 Thread Kevin Wolf
From: 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 blo

[Qemu-block] [PULL 07/29] block: Pause all jobs during bdrv_reopen_multiple()

2016-10-31 Thread Kevin Wolf
From: 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 th

[Qemu-block] [PULL 05/29] qapi: allow blockdev-add for ssh

2016-10-31 Thread Kevin Wolf
From: Ashijeet Acharya Introduce new object 'BlockdevOptionsSsh' in qapi/block-core.json to support blockdev-add for SSH network protocol driver. Use only 'struct InetSocketAddress' since SSH only supports connection over TCP. Signed-off-by: Ashijeet Acharya Reviewed-by: Kevin Wolf [ kwolf: Re

[Qemu-block] [PULL 06/29] block: Add bdrv_drain_all_{begin,end}()

2016-10-31 Thread Kevin Wolf
From: 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 disa

[Qemu-block] [PULL 13/29] block: Block all intermediate nodes in commit_active_start()

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf -

[Qemu-block] [PULL 21/29] qemu-iotests: Add iotests.supports_quorum()

2016-10-31 Thread Kevin Wolf
From: 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] [PULL 10/29] block: Use block_job_add_bdrv() in backup_start()

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf --- block/backup.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-)

[Qemu-block] [PULL 22/29] qemu-iotests: Test streaming to a Quorum child

2016-10-31 Thread Kevin Wolf
From: 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: Alber

[Qemu-block] [PULL 09/29] block: Use block_job_add_bdrv() in mirror_start_job()

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf --- block/mirror.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[Qemu-block] [PULL 12/29] block: Block all nodes involved in the block-commit operation

2016-10-31 Thread Kevin Wolf
From: 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

[Qemu-block] [PULL 11/29] block: Check blockers in all nodes involved in a block-commit job

2016-10-31 Thread Kevin Wolf
From: 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 al

[Qemu-block] [PULL 14/29] block: Support streaming to an intermediate layer

2016-10-31 Thread Kevin Wolf
From: 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

[Qemu-block] [PULL 15/29] block: Add QMP support for streaming to an intermediate layer

2016-10-31 Thread Kevin Wolf
From: Alberto Garcia This patch makes the 'device' parameter of the 'block-stream' command accept a node name that is not a root node. The presence of this feature can't be directly tested with introspection; soon we'll introduce a 'base-node' parameter whose presence can be checked for this purp

[Qemu-block] [PULL 17/29] qemu-iotests: Test streaming to an intermediate layer

2016-10-31 Thread Kevin Wolf
From: Alberto Garcia This adds test_stream_intermediate(), similar to test_stream() but streams to the intermediate image instead. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- tests/qemu-iotests/030 | 21 - tests/qemu-iotests/030.out | 4 ++-- 2 files c

[Qemu-block] [PULL 20/29] qemu-iotests: Test block-stream and block-commit in parallel

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf --- tests/qemu-iotests/030 | 30 +

[Qemu-block] [PULL 19/29] qemu-iotests: Test overlapping stream and commit operations

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf --- tests/qemu-iotests/030 | 89 +

[Qemu-block] [PULL 23/29] block: Add 'base-node' parameter to the 'block-stream' command

2016-10-31 Thread Kevin Wolf
From: 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 'bas

[Qemu-block] [PULL 16/29] docs: Document how to stream to an intermediate layer

2016-10-31 Thread Kevin Wolf
From: Alberto Garcia Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-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 a

[Qemu-block] [PULL 18/29] qemu-iotests: Test block-stream operations in parallel

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf --- tests/qemu-iotests/030

[Qemu-block] [PULL 24/29] qemu-iotests: Test the 'base-node' parameter of 'block-stream'

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf --- tests/qemu-

[Qemu-block] [PULL 25/29] raw_bsd: add offset and size options

2016-10-31 Thread Kevin Wolf
From: Tomáš Golembiovský Added two new options 'offset' and 'size'. This makes it possible to use only part of the file as a device. This can be used e.g. to limit the access only to single partition in a disk image or use a disk inside a tar archive (like OVA). When 'size' is specified we do ou

[Qemu-block] [PULL 27/29] block: Mention replication in BlockdevDriver enum docs

2016-10-31 Thread Kevin Wolf
From: Eric Blake Missed in commit 82ac554. Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf --- qapi/block-core.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index df3b987..7299da3 100644 --- a/qapi/block-core.json +++

[Qemu-block] [PULL 28/29] block/nfs: Introduce runtime_opts in NFS

2016-10-31 Thread Kevin Wolf
From: 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 NFSSer

[Qemu-block] [PULL 26/29] qemu-iotests: test 'offset' and 'size' options in raw driver

2016-10-31 Thread Kevin Wolf
From: Tomáš Golembiovský Signed-off-by: Tomáš Golembiovský Signed-off-by: Kevin Wolf --- tests/qemu-iotests/171 | 212 ++ tests/qemu-iotests/171.out | 313 + tests/qemu-iotests/group | 1 + 3 files changed, 526 ins

[Qemu-block] [PULL 29/29] qapi: allow blockdev-add for NFS

2016-10-31 Thread Kevin Wolf
From: 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 Signed-off-by: Kevin Wolf --- qapi/block-core.json | 74

[Qemu-block] [PATCH] block/nbd: Fix the regression to free leaked visitor

2016-10-31 Thread Ashijeet Acharya
This patch frees the leaked visitor in nbd_refresh_filename() and uses visit_free() to fix it. Signed-off-by: Ashijeet Acharya --- block/nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nbd.c b/block/nbd.c index 8ef1438..ff9d01a 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -545,6

[Qemu-block] [PATCH] block/ssh: Fix the regression of unused parameter

2016-10-31 Thread Ashijeet Acharya
This patch drops the unused parameter "BDRVSSHState" being passed into the ssh_config() function and fixes the bug. Signed-off-by: Ashijeet Acharya --- block/ssh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index ca071c5..15ed281 100644 ---

Re: [Qemu-block] [Qemu-devel] [PATCH] block/nbd: Fix the regression to free leaked visitor

2016-10-31 Thread Eric Blake
On 10/31/2016 12:51 PM, Ashijeet Acharya wrote: > This patch frees the leaked visitor in nbd_refresh_filename() and uses > visit_free() to fix it. > > Signed-off-by: Ashijeet Acharya > --- > block/nbd.c | 1 + > 1 file changed, 1 insertion(+) Would be nice to mention that it was commit 491d6c7

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

2016-10-31 Thread Peter Maydell
On 31 October 2016 at 17:25, Kevin Wolf wrote: > The following changes since commit 0bb1137930f51a89fb1bfeb0c46aa68af0395167: > > Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20161031' into > staging (2016-10-31 14:48:47 +) > > are available in the gi

[Qemu-block] [PULL 01/14] qapi: add release designator to gluster logfile option

2016-10-31 Thread Jeff Cody
The "logfile" option to BlockdevOptionsGluster will not be in QEMU until 2.8. Update comment to indicate this. Reported-by: Eric Blake Signed-off-by: Jeff Cody --- qapi/block-core.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.js

[Qemu-block] [PULL 02/14] rbd: make the code more readable

2016-10-31 Thread Jeff Cody
From: Xiubo Li Make it a bit clearer and more readable. Signed-off-by: Xiubo Li Reviewed-by: Stefan Hajnoczi Reviewed-by: John Snow Reviewed-by: Jeff Cody Message-id: 1476519973-6436-1-git-send-email-lixi...@cmss.chinamobile.com CC: John Snow Signed-off-by: Jeff Cody --- block/rbd.c | 29

[Qemu-block] [PULL 03/14] block: add gluster ifdef guard checks for SEEK_DATA/SEEK_HOLE support

2016-10-31 Thread Jeff Cody
Add checks to see if the system compiling QEMU has support for SEEK_HOLE/SEEK_DATA. If the system does not, we will flag that seek data is unsupported in gluster. Note: this is not a check on whether the gluster server itself supports SEEK_DATA (that is already done during runtime), but rather if

[Qemu-block] [PULL 04/14] block/gluster: memory usage: use one glfs instance per volume

2016-10-31 Thread Jeff Cody
From: Prasanna Kumar Kalever Currently, for every drive accessed via gfapi we create a new glfs instance (call glfs_new() followed by glfs_init()) which could consume memory in few 100 MB's, from the table below it looks like for each instance ~300 MB VSZ was consumed Before: --- Disks VSZ

[Qemu-block] [PULL 00/14] Block patches for 2.8

2016-10-31 Thread Jeff Cody
The following changes since commit 6bc56d317f7b5004ea2d89d264bddc8b4d081700: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream-mttcg' into staging (2016-10-31 15:29:12 +) are available in the git repository at: g...@github.com:codyprime/qemu-kvm-jtc.git tags/block-pull-req

[Qemu-block] [PULL 07/14] block/gluster: fix port type in the QAPI options list

2016-10-31 Thread Jeff Cody
From: Prasanna Kumar Kalever After introduction of qapi schema in gluster block driver code, the port type is now string as per InetSocketAddress { 'struct': 'InetSocketAddress', 'data': { 'host': 'str', 'port': 'str', '*to': 'uint16', '*ipv4': 'bool', '*ipv6': 'bool' } }

[Qemu-block] [PULL 05/14] block: Turn on "unmap" in active commit

2016-10-31 Thread Jeff Cody
From: Fam Zheng 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 the virt-sparsify use case, where a temporary overla

[Qemu-block] [PULL 10/14] Replication/Blockjobs: Create replication jobs as internal

2016-10-31 Thread Jeff Cody
From: John Snow Bubble up the internal interface to commit and backup jobs, then switch replication tasks over to using this methodology. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Reviewed-by: Jeff Cody Message-id: 1477584421-1399-4-git-send-email-js...@redhat.com Signed-off-by: Jeff C

[Qemu-block] [PULL 08/14] blockjobs: hide internal jobs from management API

2016-10-31 Thread Jeff Cody
From: John Snow If jobs are not created directly by the user, do not allow them to be seen by the user/management utility. At the moment, 'internal' jobs are those that do not have an ID. As of this patch it is impossible to create such jobs. Signed-off-by: John Snow Message-id: 1477584421-1399

[Qemu-block] [PULL 06/14] block/gluster: improve defense over string to int conversion

2016-10-31 Thread Jeff Cody
From: Prasanna Kumar Kalever using atoi() for converting string to int may be error prone in case if string supplied in the argument is not a fold of numerical number, This is not a bug because in the existing code, static QemuOptsList runtime_tcp_opts = { .name = "gluster_tcp", .head =

[Qemu-block] [PULL 09/14] blockjobs: Allow creating internal jobs

2016-10-31 Thread Jeff Cody
From: John Snow Add the ability to create jobs without an ID. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Reviewed-by: Jeff Cody Message-id: 1477584421-1399-3-git-send-email-js...@redhat.com Signed-off-by: Jeff Cody --- block/backup.c| 2 +- block/commit.c| 2

[Qemu-block] [PULL 12/14] Blockjobs: Internalize user_pause logic

2016-10-31 Thread Jeff Cody
From: John Snow BlockJobs will begin hiding their state in preparation for some refactorings anyway, so let's internalize the user_pause mechanism instead of leaving it to callers to correctly manage. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Reviewed-by: Jeff Cody Message-id: 14775844

[Qemu-block] [PULL 14/14] blockjobs: fix documentation

2016-10-31 Thread Jeff Cody
From: John Snow (Trivial) Fix wrong function names in documentation. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Reviewed-by: Jeff Cody Message-id: 1477584421-1399-8-git-send-email-js...@redhat.com Signed-off-by: Jeff Cody --- include/block/blockjob_int.h | 4 ++-- 1 file changed, 2 i

[Qemu-block] [PULL 11/14] blockjob: centralize QMP event emissions

2016-10-31 Thread Jeff Cody
From: John Snow There's no reason to leave this to blockdev; we can do it in blockjobs directly and get rid of an extra callback for most users. All non-internal events, even those created outside of QMP, will consistently emit events. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Reviewed

[Qemu-block] [PULL 13/14] blockjobs: split interface into public/private, Part 1

2016-10-31 Thread Jeff Cody
From: John Snow To make it a little more obvious which functions are intended to be public interface and which are intended to be for use only by jobs themselves, split the interface into "public" and "private" files. Convert blockjobs (e.g. block/backup) to using the private interface. Leave bl

[Qemu-block] [PATCH 1/1] migration: fix compiler warning on uninitialized variable

2016-10-31 Thread Jeff Cody
Some older GCC versions (e.g. 4.4.7) report a warning on an uninitialized variable for 'request', even though all possible code paths that reference 'request' will be initialized. To appease these versions, initialize the variable to 0. Reported-by: Mark Cave-Ayland Signed-off-by: Jeff Cody --

Re: [Qemu-block] [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 Thread Eric Blake
On 10/31/2016 10:38 AM, Fam Zheng wrote: > This implements open flag sensible image locking for local file > and host device protocol. > > virtlockd in libvirt locks the first byte, so we start looking at the > file bytes from 1. What happens if we try to use a raw file with less than 3 bytes? Th

Re: [Qemu-block] [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 Thread Richard W.M. Jones
On Mon, Oct 31, 2016 at 05:01:44PM -0500, Eric Blake wrote: > On 10/31/2016 10:38 AM, Fam Zheng wrote: > > This implements open flag sensible image locking for local file > > and host device protocol. > > > > virtlockd in libvirt locks the first byte, so we start looking at the > > file bytes fro

Re: [Qemu-block] [PATCH 1/1] migration: fix compiler warning on uninitialized variable

2016-10-31 Thread Hailiang Zhang
On 2016/11/1 5:50, Jeff Cody wrote: Some older GCC versions (e.g. 4.4.7) report a warning on an uninitialized variable for 'request', even though all possible code paths that reference 'request' will be initialized. To appease these versions, initialize the variable to 0. Thanks for reportin

Re: [Qemu-block] [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 Thread Fam Zheng
On Mon, 10/31 17:01, Eric Blake wrote: > On 10/31/2016 10:38 AM, Fam Zheng wrote: > > This implements open flag sensible image locking for local file > > and host device protocol. > > > > virtlockd in libvirt locks the first byte, so we start looking at the > > file bytes from 1. > > What happens

[Qemu-block] [PATCH v2 0/3] atapi: classify read_cd as conditionally returning data

2016-10-31 Thread John Snow
v2: - Actually applied the changes this time ... - And added a test to the AHCI suite... - ...Which revealed a few small issues in the suite. The AHCI test should be sufficient in terms of general proof for ATAPI regardless of the HBA used. _

[Qemu-block] [PATCH v2 2/3] ahci-test: Create smaller test ISO images

2016-10-31 Thread John Snow
These can simply be the size of the number of sectors we're reading, plus one for a buffer. We don't need them to be any larger. Signed-off-by: John Snow --- tests/ahci-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 70bcaf

[Qemu-block] [PATCH v2 1/3] atapi: classify read_cd as conditionally returning data

2016-10-31 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 --- hw/ide/atapi.c | 51

[Qemu-block] [PATCH v2 3/3] ahci-test: test atapi read_cd with bcl, nb_sectors = 0

2016-10-31 Thread John Snow
Commit 9ef2e93f introduced the concept of tagging ATAPI commands as NONDATA, but this introduced a regression for certain commands better described as CONDDATA. read_cd is such a command that both requires a non-zero BCL if a transfer size is set, but is perfectly content to accept a zero BCL if th

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/3] atapi: classify read_cd as conditionally returning data

2016-10-31 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Type: series Subject: [Qemu-devel] [PATCH v2 0/3] atapi: classify read_cd as conditionally returning data Message-id: 1477970211-25754-1-git-send-email-js...@redhat.com === TEST SCRIPT BEGIN === #!/