[Qemu-block] [PATCH v2 8/8] qapi: query-blockstat: add driver specific file-posix stats

2018-01-19 Thread Anton Nefedov
A block driver can provide a callback to report driver-specific statistics. file-posix driver now reports discard statistics Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 37

[Qemu-block] [PATCH v2 4/8] scsi: store unmap offset and nb_sectors in request struct

2018-01-19 Thread Anton Nefedov
it allows to report it in the error handler Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 12 +--- 1 file changed, 5 insertions(+), 7

[Qemu-block] [PATCH v2 1/8] qapi: group BlockDeviceStats fields

2018-01-19 Thread Anton Nefedov
Make the stat fields definition slightly more readable. Cosmetic change only. Signed-off-by: Anton Nefedov --- qapi/block-core.json | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/qapi/block-core.json

[Qemu-block] [PATCH v3 2/5] qapi: add nbd-server-remove

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
Add command for removing an export. It is needed for cases when we don't want to keep export after the operation on it was completed. The other example is temporary node, created with blockdev-add. If we want to delete it we should firstly remove corresponding NBD export. Signed-off-by: Vladimir

Re: [Qemu-block] [PATCH] block/vmdk: Report failures in vmdk_read_cid()

2018-01-19 Thread Paolo Bonzini
On 28/07/2017 14:54, Kevin Wolf wrote: > Am 09.07.2017 um 19:06 hat Peter Maydell geschrieben: >> The function vmdk_read_cid() can fail if the read on the underlying >> block device fails, or if there's a format error in the VMDK file. >> However its API doesn't provide a mechanism to report these

[Qemu-block] [PATCH v3 0/5] nbd export qmp interface

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
v3: hmp patch deleted 02: tweak commit message and comments tweak error message 05: use unix socket instead of tcp (more common practice in iotests, and we do not need port) rebase on new error message in 02 v2: 01: tweak comment add Eric's r-b 02: new patch 03: rewritten, to move

[Qemu-block] [PATCH v3 5/5] iotest 201: new test for qmp nbd-server-remove

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/201 | 156 + tests/qemu-iotests/201.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 162 insertions(+) create mode 100644

[Qemu-block] [PATCH v3 4/5] iotests: implement QemuIoInteractive class

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
Implement QemuIoInteractive to test nbd-server-remove command when there are active connections. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 38 ++ 1 file changed, 38 insertions(+) diff --git

[Qemu-block] [PATCH v3 3/5] iotest 147: add cases to test new @name parameter of nbd-server-add

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/147 | 68 +- tests/qemu-iotests/147.out | 4 +-- 2 files changed, 57 insertions(+), 15 deletions(-) diff

[Qemu-block] [PATCH v3 1/5] qapi: add name parameter to nbd-server-add

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
Allow user to specify name for new export, to not reuse internal node name and to not show it to clients. This also allows creating several exports per device. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- qapi/block.json

[Qemu-block] [PATCH v2 6/8] scsi: account unmap operations

2018-01-19 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/scsi/scsi-disk.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 693a754..6881664

[Qemu-block] [PATCH v2 2/8] qapi: add unmap to BlockDeviceStats

2018-01-19 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- qapi/block-core.json | 29 +++-- include/block/accounting.h | 1 + block/qapi.c

Re: [Qemu-block] [Qemu-devel] [PATCH v2 18/32] qcow2: Update qcow2_get_cluster_offset() to support L2 slices

2018-01-19 Thread Alberto Garcia
On Tue 16 Jan 2018 11:42:45 PM CET, Eric Blake wrote: > Callers like 'qemu-img map' will potentially have to iterate in more > steps over an entire image; but that's not a severe limitation. The > block_status() functions already document that as long as drivers make > progress, callers must be

Re: [Qemu-block] [Qemu-devel] [PATCH v9 03/13] block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
18.01.2018 13:09, Paolo Bonzini wrote: On 18/01/2018 10:55, Vladimir Sementsov-Ogievskiy wrote: Most functions that looks at the list are "called with BQL taken". Functions that write to the list are "called with BQL taken" and call bdrv_dirty_bitmaps_lock/bdrv_dirty_bitmaps_unlock themselves.

[Qemu-block] [PATCH v2 3/8] ide: account UNMAP (TRIM) operations

2018-01-19 Thread Anton Nefedov
Signed-off-by: Anton Nefedov --- hw/ide/core.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index 5be72d4..6fdc936 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -443,6 +443,14 @@ static void

[Qemu-block] [PATCH v2 5/8] scsi: move unmap error checking to the complete callback

2018-01-19 Thread Anton Nefedov
This will help to account the operation in the following commit. The difference is that we don't call scsi_disk_req_check_error() before the 1st discard iteration anymore. That function also checks if the request is cancelled, however it shouldn't get canceled until it yields in blk_aio()

[Qemu-block] [PATCH v2 0/8] discard blockstats

2018-01-19 Thread Anton Nefedov
v2: - rebased on top of series 'ide: abort TRIM operation for invalid range' (http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg01432.html) Now invalid trim requests are properly accounted - patches 1/2 - qapi fields regrouped together v1:

[Qemu-block] [PATCH v2 7/8] file-posix: account discard operations

2018-01-19 Thread Anton Nefedov
This will help to identify how many of the user-issued discard operations (accounted on a device level) have actually suceeded down on the host file (even though the numbers will not be exactly the same if non-raw format driver is used (e.g. qcow2 sending metadata discards)). Signed-off-by: Anton

Re: [Qemu-block] [Qemu-devel] [PATCH v9 13/13] iotests: add dirty bitmap postcopy test

2018-01-19 Thread John Snow
On 01/19/2018 01:08 PM, Vladimir Sementsov-Ogievskiy wrote: > 18.01.2018 12:57, Vladimir Sementsov-Ogievskiy wrote: >> 17.01.2018 21:30, John Snow wrote: >>> >>> On 12/28/2017 06:49 AM, Vladimir Sementsov-Ogievskiy wrote: Thank you for reviewing my code! >>> Time for the re-spin?

Re: [Qemu-block] [Qemu-devel] [PATCH v9 13/13] iotests: add dirty bitmap postcopy test

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
18.01.2018 12:57, Vladimir Sementsov-Ogievskiy wrote: 17.01.2018 21:30, John Snow wrote: On 12/28/2017 06:49 AM, Vladimir Sementsov-Ogievskiy wrote: Thank you for reviewing my code! Time for the re-spin? There's pretty good pressure to get this into 2.12 and say the non-nbd workflow model

[Qemu-block] [PATCH v2 01/13] blockjob: record time of last entrance

2018-01-19 Thread John Snow
The mirror job makes a semi-inaccurate record of the last time we yielded by recording the last time we left a "pause", but this doesn't always correlate to the time we actually last successfully ceded control. Record the time we last *exited* a yield centrally. In other words, record the time we

[Qemu-block] [PATCH v2 03/13] blockjob: create block_job_relax

2018-01-19 Thread John Snow
This will replace mirror_throttle, for reuse in other jobs. Signed-off-by: John Snow --- block/mirror.c | 15 ++- blockjob.c | 11 +++ include/block/blockjob_int.h | 9 + 3 files changed, 22 insertions(+), 13

[Qemu-block] [PATCH v2 02/13] blockjob: consolidate SLICE_TIME definition

2018-01-19 Thread John Snow
They're all the same. If it actually becomes important to configure it, it can become a job or driver property. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Jeff Cody

[Qemu-block] [PATCH v2 00/13] blockjob: refactor mirror_throttle

2018-01-19 Thread John Snow
mirror_throttle attempts to make sure we yield every so often when we're doing operations that may not otherwise be as cooperative as we'd like. This pattern is useful to other jobs like commit as well; if commit continuously decides not to copy data (and calculates delay_ns to be 0), we'll

[Qemu-block] [PATCH v2 06/13] block/stream: use block_job_relax

2018-01-19 Thread John Snow
See prior commit for justification. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- block/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/stream.c

[Qemu-block] [PATCH v2 12/13] blockjob: privatize block_job_sleep_ns

2018-01-19 Thread John Snow
There's not currently any external caller of it. Except in tests, but we'll fix that here too. Replace usages in test cases with block_job_relax, which functions similarly enough to be used as a drop-in replacement. Very technically block_job_sleep_ns(job, 0) behaves differently from

[Qemu-block] [PATCH v2 11/13] block/mirror: remove block_job_sleep_ns calls

2018-01-19 Thread John Snow
We're attempting to slacken the mirror loop in three different places, but we can combine these three attempts. Combine the early loop call to block_job_pause_point with the two late-loop calls to block_job_sleep_ns. When delay_ns is 0 and it has not been SLICE_TIME since the last yield,

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/13] blockjob: refactor mirror_throttle

2018-01-19 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180119205847.7141-1-js...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/13] blockjob: refactor mirror_throttle === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1

[Qemu-block] [PATCH v2 04/13] blockjob: allow block_job_throttle to take delay_ns

2018-01-19 Thread John Snow
Instead of only sleeping for 0ms when we've hit a timeout, optionally take a longer more explicit delay_ns that always forces the sleep. Signed-off-by: John Snow --- block/mirror.c | 4 ++-- blockjob.c | 9 -

[Qemu-block] [PATCH v2 07/13] block/backup: use block_job_relax

2018-01-19 Thread John Snow
See two commits back for justification. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- block/backup.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/backup.c

[Qemu-block] [PATCH v2 05/13] block/commit: use block_job_relax

2018-01-19 Thread John Snow
Depending on the value of `speed` and how fast our backends are, delay_ns might be 0 very, very often. This creates some warning messages that spook users, but it's also pretty inefficient. Use block_job_relax instead to yield a little more intelligently. Signed-off-by: John Snow

[Qemu-block] [PATCH v2 10/13] block/mirror: condense cancellation and relax calls

2018-01-19 Thread John Snow
We can count on the relax call to check cancellation for us, so condense these concurrent calls. Signed-off-by: John Snow --- block/mirror.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 3c73caed5e..a0e0044de2

[Qemu-block] [PATCH v2 09/13] block/backup: remove yield_and_check

2018-01-19 Thread John Snow
This is a respin of the same functionality as mirror_throttle, so trash this and replace it with the generic version. yield_and_check returned true if canceled, false otherwise. block_job_relax returns -ECANCELED if canceled, 0 otherwise. Signed-off-by: John Snow ---

Re: [Qemu-block] [Qemu-devel] [PATCH v2] hw/ide: Remove duplicated definitions from ahci_internal.h

2018-01-19 Thread John Snow
On 12/07/2017 12:47 AM, Thomas Huth wrote: > On 06.12.2017 23:16, John Snow wrote: >> I tweaked this again, sorry: >> >> The names need to stay public, but the wrappers to manipulate the >> objects can stay internal. Minor difference. >> >> If that's okay, I'll just merge this in. >> OK? > >

Re: [Qemu-block] [Qemu-devel] [PATCH] ide-test: test trim requests

2018-01-19 Thread John Snow
On 01/19/2018 07:40 AM, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > --- > tests/ide-test.c | 71 > > 1 file changed, 71 insertions(+) > > diff --git a/tests/ide-test.c b/tests/ide-test.c > index

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/6] block/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap

2018-01-19 Thread John Snow
On 01/16/2018 07:54 AM, Vladimir Sementsov-Ogievskiy wrote: > Add locks and remove comments about BQL accordingly to > dirty_bitmap_mutex definition in block_int.h. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/dirty-bitmap.c | 6 -- > 1 file

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] ide: abort TRIM operation for invalid range

2018-01-19 Thread John Snow
On 12/08/2017 07:10 AM, Anton Nefedov wrote: > Started from the separate series discussion (trim statistics) , see > http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg01059.html > > There is no range check for IDE trim requests now. > Such request will likely be rejected by the block

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] qmp dirty bitmap API

2018-01-19 Thread John Snow
On 01/16/2018 07:54 AM, Vladimir Sementsov-Ogievskiy wrote: > Hi all. > > There are three qmp commands, needed to implement external backup API. > > Using these three commands, client may do all needed bitmap management by > hand: > > on backup start we need to do a transaction: > {disable

Re: [Qemu-block] [Qemu-devel] [PATCH v2 4/6] qmp: transaction support for block-dirty-bitmap-enable/disable

2018-01-19 Thread John Snow
On 01/17/2018 10:06 AM, Vladimir Sementsov-Ogievskiy wrote: > 16.01.2018 15:54, Vladimir Sementsov-Ogievskiy wrote: >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> --- >>   qapi/transaction.json |  4 +++ >>   blockdev.c    | 79 >>

[Qemu-block] [PATCH v4] file-posix: specify expected filetypes

2018-01-19 Thread John Snow
Adjust each caller of raw_open_common to specify if they are expecting host and character devices or not. Tighten expectations of file types upon open in the common code and refuse types that are not expected. This has two effects: (1) Character and block devices are now considered deprecated

Re: [Qemu-block] [Qemu-devel] [PATCH v4] file-posix: specify expected filetypes

2018-01-19 Thread Eric Blake
On 01/19/2018 04:47 PM, John Snow wrote: > Adjust each caller of raw_open_common to specify if they are expecting > host and character devices or not. Tighten expectations of file types upon > open in the common code and refuse types that are not expected. > > This has two effects: > > (1)

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/6] block: maintain persistent disabled bitmaps

2018-01-19 Thread John Snow
On 01/16/2018 07:54 AM, Vladimir Sementsov-Ogievskiy wrote: > To maintain load/store disabled bitmap there is new approach: > > - deprecate @autoload flag of block-dirty-bitmap-add, make it ignored > - store enabled bitmaps as "auto" to qcow2 > - store disabled bitmaps without "auto" flag to

Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/6] qapi: add block-dirty-bitmap-enable/disable

2018-01-19 Thread John Snow
On 01/16/2018 07:54 AM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > qapi/block-core.json | 42 ++ > blockdev.c | 42 ++ > 2 files

Re: [Qemu-block] [Qemu-devel] [PATCH v9 13/13] iotests: add dirty bitmap postcopy test

2018-01-19 Thread John Snow
On 01/19/2018 01:08 PM, Vladimir Sementsov-Ogievskiy wrote: > 18.01.2018 12:57, Vladimir Sementsov-Ogievskiy wrote: >> 17.01.2018 21:30, John Snow wrote: >>> >>> On 12/28/2017 06:49 AM, Vladimir Sementsov-Ogievskiy wrote: Thank you for reviewing my code! >>> Time for the re-spin?

Re: [Qemu-block] [PATCH v2 2/6] hmp: add name parameter to nbd_server_add

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
19.01.2018 00:08, Eric Blake wrote: On 01/18/2018 12:11 PM, Vladimir Sementsov-Ogievskiy wrote: Support name parameter for HMP too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hmp.c | 3 ++- hmp-commands.hx | 9 + 2 files changed, 7

Re: [Qemu-block] [PATCH v2 6/6] iotest 201: new test for qmp nbd-server-remove

2018-01-19 Thread Vladimir Sementsov-Ogievskiy
19.01.2018 01:43, Eric Blake wrote: On 01/18/2018 12:11 PM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/201 | 159 + tests/qemu-iotests/201.out | 5 ++

Re: [Qemu-block] [PATCH v2 0/6] nbd export qmp interface

2018-01-19 Thread Kevin Wolf
Am 18.01.2018 um 23:45 hat Eric Blake geschrieben: > On 01/18/2018 12:11 PM, Vladimir Sementsov-Ogievskiy wrote: > > v2: > > 01: tweak comment > > add Eric's r-b > > 02: new patch > > 03: rewritten, to move form 'bool force' flag to 'enum mode' parameter > > 04: add Eric's r-b > > 05: improve

Re: [Qemu-block] [Qemu-devel] [PATCH] block: implement the bdrv_reopen_prepare helper for LUKS driver

2018-01-19 Thread Daniel P. Berrange
On Thu, Jan 18, 2018 at 01:51:36PM -0600, Eric Blake wrote: > On 01/18/2018 04:31 AM, Daniel P. Berrange wrote: > > If the bdrv_reopen_prepare helper isn't provided, the qemu-img commit > > command fails to re-open the base layer after committing changes into > > it. Provide a no-op implementation

Re: [Qemu-block] [Qemu-devel] [PATCH 0/5 v3] preparation for Parallels Disk xml driver

2018-01-19 Thread klim
On 01/12/2018 12:01 PM, Klim Kireev wrote: ping Parallels Desktop and Parallels Cloud Server uses images glued with the bundle description in XML format. This series contains very basic description of this XML files and makes preparations for actual implementation to be followed.