[Qemu-block] [PATCH 08/15] stream: Add 'job-id' parameter to 'block-stream'

2016-06-09 Thread Alberto Garcia
This patch adds a new optional 'job-id' parameter to 'block-stream', allowing the user to specify the ID of the block job to be created. The HMP 'block_stream' command remains unchanged. Signed-off-by: Alberto Garcia --- block/stream.c

[Qemu-block] [PATCH 10/15] blockjob: Add 'id' parameter to 'block-job-set-speed'

2016-06-09 Thread Alberto Garcia
This patch allows the 'block-job-set-speed' command to identify the job by either its ID or its device name. The latter becomes now optional since the ID alone is enough to identify the job. The HMP 'block_job_set_speed' command remains unchanged. Signed-off-by: Alberto Gar

[Qemu-block] [PATCH 11/15] blockjob: Add 'id' parameter to 'block-job-cancel'

2016-06-09 Thread Alberto Garcia
This patch allows the 'block-job-cancel' command to identify the job by either its ID or its device name. The latter becomes now optional since the ID alone is enough to identify the job. The HMP 'block_job_cancel' command remains unchanged. Signed-off-by: Alberto Gar

[Qemu-block] [PATCH 00/15] Add an 'id' field to block jobs

2016-06-09 Thread Alberto Garcia
hings to do: - Add new tests specific to job IDs. - Add job ID support to HMP commands. The series applies on top of Max's block branch (commit 3cc2f35a59) but it should work on master as well. Questions, comments, etc, are welcome. Thanks! Berto Alberto Garcia (15): stream: Fix proto

[Qemu-block] [PATCH 12/15] blockjob: Add 'id' parameter to 'block-job-pause'

2016-06-09 Thread Alberto Garcia
This patch allows the 'block-job-pause' command to identify the job by either its ID or its device name. The latter becomes now optional since the ID alone is enough to identify the job. The HMP 'block_job_pause' command remains unchanged. Signed-off-by: Alberto Gar

[Qemu-block] [PATCH 04/15] block: Simplify find_block_job() and make it accept a job ID

2016-06-09 Thread Alberto Garcia
find_block_job() to allow IDs too. Only one of ID and device name can be specified when looking for a block job. Signed-off-by: Alberto Garcia --- blockdev.c | 66 +- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a

[Qemu-block] [PATCH 07/15] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup'

2016-06-09 Thread Alberto Garcia
This patch adds a new optional 'job-id' parameter to 'blockdev-backup' and 'drive-backup', allowing the user to specify the ID of the block job to be created. The HMP 'drive_backup' command remains unchanged. Signed-off-by: Alberto Garcia --- block/backu

[Qemu-block] [PATCH 13/15] blockjob: Add 'id' parameter to 'block-job-resume'

2016-06-09 Thread Alberto Garcia
This patch allows the 'block-job-resume' command to identify the job by either its ID or its device name. The latter becomes now optional since the ID alone is enough to identify the job. The HMP 'block_job_resume' command remains unchanged. Signed-off-by: Alberto Gar

[Qemu-block] [PATCH 06/15] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror'

2016-06-09 Thread Alberto Garcia
This patch adds a new optional 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror', allowing the user to specify the ID of the block job to be created. The HMP 'drive_mirror' command remains unchanged. Signed-off-by: Alberto Gar

[Qemu-block] [PATCH 05/15] blockjob: Add 'job_id' parameter to block_job_create()

2016-06-09 Thread Alberto Garcia
Job IDs are generated automatically when a new job is created. This patch adds a new 'job_id' parameter to let the caller provide one instead. In this case the ID is verified to be unique and well-formed. Signed-off-by: Alberto Garcia --- block/backup.c| 3 ++- bloc

[Qemu-block] [PATCH 02/15] blockjob: Decouple the ID from the device name in the BlockJob struct

2016-06-09 Thread Alberto Garcia
automatically for the moment, in later patches we'll allow the user to set it. Signed-off-by: Alberto Garcia --- blockjob.c | 15 +-- include/block/blockjob.h | 12 include/qemu/id.h| 1 + util/id.c| 1 + 4 files changed, 19 inser

[Qemu-block] [PATCH 14/15] blockjob: Add 'id' parameter to 'block-job-complete'

2016-06-09 Thread Alberto Garcia
This patch allows the 'block-job-complete' command to identify the job by either its ID or its device name. The latter becomes now optional since the ID alone is enough to identify the job. The HMP 'block_job_complete' command remains unchanged. Signed-off-by: Alberto Gar

[Qemu-block] [PATCH 15/15] blockjob: Add 'id' field to 'BlockJobInfo' and all BLOCK_JOB_* events

2016-06-09 Thread Alberto Garcia
updates the affected ones. Signed-off-by: Alberto Garcia --- blockjob.c | 6 +- docs/qmp-events.txt| 4 qapi/block-core.json | 18 -- tests/qemu-iotests/095 | 2 +- tests/qemu-iotests/095.out | 2 +- tests/qemu-iotests/124 | 3

[Qemu-block] [PATCH 03/15] blockjob: Add block_job_get()

2016-06-09 Thread Alberto Garcia
Currently the way to look for a specific block job is to iterate the list manually using block_job_next(). Since we want to be able to identify a job primarily by its ID it makes sense to have a function that does just that. Signed-off-by: Alberto Garcia --- blockjob.c | 13

[Qemu-block] [PATCH 01/15] stream: Fix prototype of stream_start()

2016-06-09 Thread Alberto Garcia
'. This patch fixes it so the name is the same in both cases and is consistent with other cases (like commit_start()). Signed-off-by: Alberto Garcia --- include/block/block_int.h | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/block/block_int.h b/inclu

[Qemu-block] [PATCH 09/15] stream: Add 'job-id' parameter to 'block-commit'

2016-06-09 Thread Alberto Garcia
This patch adds a new optional 'job-id' parameter to 'block-commit', allowing the user to specify the ID of the block job to be created. Signed-off-by: Alberto Garcia --- block/commit.c| 7 --- block/mirror.c| 6 +++--- blockdev.c

Re: [Qemu-block] [PATCH v7 17/20] block: remove all encryption handling APIs

2017-05-29 Thread Alberto Garcia
ryption can be handled transparently > within the block driver. We only retain an API for querying > whether an image is encrypted or not, since that is a > potentially useful piece of metadata to report to the user. > > Reviewed-by: Max Reitz > Signed-off-by: Daniel P. Berrange Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v7 20/20] docs: document encryption options for qcow, qcow2 and luks

2017-05-29 Thread Alberto Garcia
On Thu 25 May 2017 06:38:51 PM CEST, "Daniel P. Berrange" wrote: > Expand the image format docs to cover the new options for > the qcow, qcow2 and luks disk image formats > > Signed-off-by: Daniel P. Berrange Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH 09/18] throttle-groups: protect throttled requests with a CoMutex

2017-05-29 Thread Alberto Garcia
sen this > alternative. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Paolo Bonzini Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] Throttling groups vs filter nodes

2017-05-30 Thread Alberto Garcia
On Sat 27 May 2017 09:56:03 AM CEST, Stefan Hajnoczi wrote: > Throttling groups allow multiple drives to share the same throttling > state (i.e. budget) between them. Manos is working on moving the > throttling code into a block filter driver so it is no longer > hardcoded into the I/O code path.

Re: [Qemu-block] [RFC] Making 'block-stream', and 'block-commit' accept node-name

2017-05-30 Thread Alberto Garcia
On Mon 29 May 2017 09:03:22 PM CEST, Kashyap Chamarthy wrote: > Observe the following ('qmp-shell', for brevity) invocation of the > four major types (stream, commit, mirror, backup) of live block > operations: > > (QEMU) block-stream device=node-D base=a.qcow2 job-id=job-block-stream > (Q

Re: [Qemu-block] [PATCH v8 19/20] qcow2: report encryption specific image information

2017-06-02 Thread Alberto Garcia
me data related to it. Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH] blockjob: cancel blockjobs before stopping all iothreads

2017-06-07 Thread Alberto Garcia
On Sat 03 Jun 2017 07:48:37 AM CEST, sochin.jiang wrote: > --- a/block.c > +++ b/block.c > @@ -3084,9 +3084,16 @@ static void bdrv_close(BlockDriverState *bs) > bdrv_drained_end(bs); > } > > +void bdrv_cancel_all(void) > +{ > +if (!block_jobs_is_empty()) { > +block_job_cancel_s

Re: [Qemu-block] [PATCH 0/7] qcow2: Reduce the number of I/O ops when doing COW

2017-06-07 Thread Alberto Garcia
ping On Tue, May 23, 2017 at 01:22:55PM +0200, Alberto Garcia wrote: > Hi all, > > here's a patch series that rewrites the copy-on-write code in the > qcow2 driver to reduce the number of I/O operations. > > The situation is that when a guest sends a write request and Q

Re: [Qemu-block] [PATCH 0/7] qcow2: Reduce the number of I/O ops when doing COW

2017-06-07 Thread Alberto Garcia
On Wed 07 Jun 2017 01:59:58 PM CEST, Kevin Wolf wrote: > Am 07.06.2017 um 13:44 hat Alberto Garcia geschrieben: >> ping > > You wanted to address two or three things in the next version, so I > assumed that this version shouldn't be merged. Right, I had a couple of minor c

[Qemu-block] [PATCH v2 7/7] qcow2: Merge the writing of the COW regions with the guest data

2017-06-07 Thread Alberto Garcia
factors such as the media type, the cluster size and the I/O request size. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 38 ++ block/qcow2.c | 64 +++ block/qcow2.h | 7 ++ 3 files changed

[Qemu-block] [PATCH v2 5/7] qcow2: Allow reading both COW regions with only one request

2017-06-07 Thread Alberto Garcia
kes a conservative approach and only merges reads when the size of the middle region is <= 16KB. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 41 ++--- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-c

[Qemu-block] [PATCH v2 6/7] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}()

2017-06-07 Thread Alberto Garcia
well for consistency. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 51 --- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 8f6bc3d0b9..71609ff7a2 100644 --- a/block/

[Qemu-block] [PATCH v2 2/7] qcow2: Use unsigned int for both members of Qcow2COWRegion

2017-06-07 Thread Alberto Garcia
otype of do_perform_cow() is also updated to reflect these changes. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 4 ++-- block/qcow2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index d1c419f52b..a86c5a75a9 1006

[Qemu-block] [PATCH v2 0/7] qcow2: Reduce the number of I/O ops when doing COW

2017-06-07 Thread Alberto Garcia
ypt() and _write()' 005/7:[] [--] 'qcow2: Allow reading both COW regions with only one request' 006/7:[] [--] 'qcow2: Pass a QEMUIOVector to do_perform_cow_{read,write}()' 007/7:[0014] [FC] 'qcow2: Merge the writing of the COW regions with the guest data&#x

[Qemu-block] [PATCH v2 1/7] qcow2: Remove unused Error variable in do_perform_cow()

2017-06-07 Thread Alberto Garcia
to pass the original error instead of simply returning -EIO, but that would be more invasive, so let's keep the current approach. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/qcow2-cluster.c b/block/

[Qemu-block] [PATCH v2 3/7] qcow2: Make perform_cow() call do_perform_cow() twice

2017-06-07 Thread Alberto Garcia
Instead of calling perform_cow() twice with a different COW region each time, call it just once and make perform_cow() handle both regions. This patch simply moves code around. The next one will do the actual reordering of the COW operations. Signed-off-by: Alberto Garcia --- block/qcow2

[Qemu-block] [PATCH v2 4/7] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write()

2017-06-07 Thread Alberto Garcia
enough to hold both regions. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 114 +- 1 file changed, 84 insertions(+), 30 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 4c03639a72..af43e6a34f 100644 --- a/block

Re: [Qemu-block] [PATCH v2 3/7] qcow2: Make perform_cow() call do_perform_cow() twice

2017-06-08 Thread Alberto Garcia
On Wed 07 Jun 2017 11:43:34 PM CEST, Eric Blake wrote: >> block/qcow2-cluster.c | 38 +++--- >> 1 file changed, 23 insertions(+), 15 deletions(-) > >> qemu_co_mutex_unlock(&s->lock); >> -ret = do_perform_cow(bs, m->offset, m->alloc_offset, r->offset, >> r-

Re: [Qemu-block] [PATCH v2 2/7] qcow2: Use unsigned int for both members of Qcow2COWRegion

2017-06-08 Thread Alberto Garcia
On Wed 07 Jun 2017 06:02:06 PM CEST, Eric Blake wrote: >> - The offset of the COW region from the start of the first cluster >> touched by the I/O request. Since it's always going to be positive >> and the maximum request size is at most INT_MAX, we can use a >> regular unsigned int to store

Re: [Qemu-block] [PATCH 2/5] block: Don't try to set *errp directly

2017-06-08 Thread Alberto Garcia
or_abort certainly not. > With this, there's no need to check if errp is NULL anymore, as > error_propagate() and error_prepend() are able to handle that. > > Cc: Kevin Wolf > Cc: Max Reitz > Cc: qemu-block@nongnu.org > Signed-off-by: Eduardo Habkost Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH 2/2] qobject: Catch another straggler for use of qdict_put_str()

2017-06-11 Thread Alberto Garcia
ally by rerunning: > spatch --sp-file scripts/coccinelle/qobject.cocci \ > --macro-file scripts/cocci-macro-file.h --dir . --in-place > > Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v2 4/7] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write()

2017-06-12 Thread Alberto Garcia
On Fri 09 Jun 2017 04:53:05 PM CEST, Eric Blake wrote: > Let's suppose we have a guest issuing 512-byte aligned requests and a > host that requires 4k alignment; and the guest does an operation that > needs a COW with one sector at both the front and end of the cluster. > >> @@ -760,22 +776,59 @@ s

Re: [Qemu-block] [PATCH RFC v2 1/2] block: move ThrottleGroup membership to ThrottleGroupMember

2017-06-13 Thread Alberto Garcia
On Sun 11 Jun 2017 03:14:26 AM CEST, Manos Pitsidianakis wrote: > This commit gathers ThrottleGroup membership details from BlockBackendPublic > into ThrottleGroupMember and refactors existing code to use the structure. > --- a/block/throttle-groups.c > +++ b/block/throttle-groups.c > @@ -29,43 +29

Re: [Qemu-block] [PATCH 0/2] block: Fix gcc 7 warnings

2017-06-13 Thread Alberto Garcia
ddressed by this series. > > Max Reitz (2): > blkdebug: Catch bs->exact_filename overflow > blkverify: Catch bs->exact_filename overflow Reviewed-by: Alberto Garcia Berto

[Qemu-block] [PATCH] throttle: Update throttle-groups.c documentation

2017-06-13 Thread Alberto Garcia
There used to be throttle_timers_{detach,attach}_aio_context() calls in bdrv_set_aio_context(), but since 7ca7f0f6db1fedd28d490795d778cf239 they are now in blk_set_aio_context(). Signed-off-by: Alberto Garcia --- block/throttle-groups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[Qemu-block] [PATCH v3 1/7] qcow2: Remove unused Error variable in do_perform_cow()

2017-06-16 Thread Alberto Garcia
to pass the original error instead of simply returning -EIO, but that would be more invasive, so let's keep the current approach. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2-cluster.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/

[Qemu-block] [PATCH v3 5/7] qcow2: Allow reading both COW regions with only one request

2017-06-16 Thread Alberto Garcia
kes a conservative approach and only merges reads when the size of the middle region is <= 16KB. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 51 ++- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/block/qcow2-cluster.c b/blo

[Qemu-block] [PATCH v3 2/7] qcow2: Use unsigned int for both members of Qcow2COWRegion

2017-06-16 Thread Alberto Garcia
otype of do_perform_cow() is also updated to reflect these changes. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2-cluster.c | 4 ++-- block/qcow2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index d1

[Qemu-block] [PATCH v3 6/7] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}()

2017-06-16 Thread Alberto Garcia
well for consistency. Signed-off-by: Alberto Garcia Reviewed-by: Manos Pitsidianakis --- block/qcow2-cluster.c | 51 --- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 20fb5

[Qemu-block] [PATCH v3 3/7] qcow2: Make perform_cow() call do_perform_cow() twice

2017-06-16 Thread Alberto Garcia
Instead of calling perform_cow() twice with a different COW region each time, call it just once and make perform_cow() handle both regions. This patch simply moves code around. The next one will do the actual reordering of the COW operations. Signed-off-by: Alberto Garcia Reviewed-by: Eric

[Qemu-block] [PATCH v3 7/7] qcow2: Merge the writing of the COW regions with the guest data

2017-06-16 Thread Alberto Garcia
factors such as the media type, the cluster size and the I/O request size. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 38 ++ block/qcow2.c | 64 +++ block/qcow2.h | 7 ++ 3 files changed

[Qemu-block] [PATCH v3 0/7] Reduce the number of I/O ops when doing COW

2017-06-16 Thread Alberto Garcia
ow_{read,write}()' 007/7:[] [-C] 'qcow2: Merge the writing of the COW regions with the guest data' Alberto Garcia (7): qcow2: Remove unused Error variable in do_perform_cow() qcow2: Use unsigned int for both members of Qcow2COWRegion qcow2: Make perform_cow() call do_

[Qemu-block] [PATCH v3 4/7] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write()

2017-06-16 Thread Alberto Garcia
enough to hold both regions. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 117 +- 1 file changed, 87 insertions(+), 30 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 4c03639a72..3c9ace8a96 100644 --- a/block

Re: [Qemu-block] [PATCH v2 7/7] qcow2: Merge the writing of the COW regions with the guest data

2017-06-19 Thread Alberto Garcia
On Fri 16 Jun 2017 05:31:42 PM CEST, Kevin Wolf wrote: >> +/* Make sure that adding both COW regions to the QEMUIOVector >> + * does not exceed IOV_MAX */ >> +if (hd_qiov->niov > IOV_MAX - 2) { >> +continue; >> +} >> + >> +m->data_qiov = hd_qiov;

[Qemu-block] [PATCH v4 1/7] qcow2: Remove unused Error variable in do_perform_cow()

2017-06-19 Thread Alberto Garcia
to pass the original error instead of simply returning -EIO, but that would be more invasive, so let's keep the current approach. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- block/qcow2-cluster.c | 4 +--- 1 file changed, 1 insertion(+), 3 dele

[Qemu-block] [PATCH v4 3/7] qcow2: Make perform_cow() call do_perform_cow() twice

2017-06-19 Thread Alberto Garcia
Instead of calling perform_cow() twice with a different COW region each time, call it just once and make perform_cow() handle both regions. This patch simply moves code around. The next one will do the actual reordering of the COW operations. Signed-off-by: Alberto Garcia Reviewed-by: Eric

[Qemu-block] [PATCH v4 5/7] qcow2: Allow reading both COW regions with only one request

2017-06-19 Thread Alberto Garcia
kes a conservative approach and only merges reads when the size of the middle region is <= 16KB. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2-cluster.c | 51 ++- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/blo

[Qemu-block] [PATCH v4 2/7] qcow2: Use unsigned int for both members of Qcow2COWRegion

2017-06-19 Thread Alberto Garcia
otype of do_perform_cow() is also updated to reflect these changes. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- block/qcow2-cluster.c | 4 ++-- block/qcow2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2-cluster.c b/blo

[Qemu-block] [PATCH v4 7/7] qcow2: Merge the writing of the COW regions with the guest data

2017-06-19 Thread Alberto Garcia
factors such as the media type, the cluster size and the I/O request size. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2-cluster.c | 40 block/qcow2.c | 64 +++ block/qcow2.h

[Qemu-block] [PATCH v4 0/7] Reduce the number of I/O ops when doing COW

2017-06-19 Thread Alberto Garcia
#x27;qcow2: Pass a QEMUIOVector to do_perform_cow_{read,write}()' 007/7:[0008] [FC] 'qcow2: Merge the writing of the COW regions with the guest data' Alberto Garcia (7): qcow2: Remove unused Error variable in do_perform_cow() qcow2: Use unsigned int for both members of

[Qemu-block] [PATCH v4 4/7] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write()

2017-06-19 Thread Alberto Garcia
enough to hold both regions. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2-cluster.c | 117 +- 1 file changed, 87 insertions(+), 30 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 4c03639a72

[Qemu-block] [PATCH v4 6/7] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}()

2017-06-19 Thread Alberto Garcia
well for consistency. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2-cluster.c | 51 --- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 20fb531932..3ac26

Re: [Qemu-block] [PATCH v9 07/20] block: deprecate "encryption=on" in favor of "encrypt.format=aes"

2017-06-20 Thread Alberto Garcia
); > +if (buf != NULL) { > +g_free(buf); If you use qemu_opt_get() instead then you don't need "buf" at all, do you? > +if (encryptfmt) { > +buf = qemu_opt_get_del(opts, BLOCK_OPT_ENCRYPT); > +if (buf != NULL) { > +g_free(buf); Same here. Everything else looks fine. Reviewed-by: Alberto Garcia Berto

[Qemu-block] [PATCH] qcow2: Use offset_into_cluster() and offset_to_l2_index()

2017-06-20 Thread Alberto Garcia
We already have functions for doing these calculations, so let's use them instead of doing everything by hand. This makes the code a bit more readable. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 4 ++-- block/qcow2.c | 2 +- 2 files changed, 3 insertions(+), 3 dele

Re: [Qemu-block] [PATCH v9 07/20] block: deprecate "encryption=on" in favor of "encrypt.format=aes"

2017-06-20 Thread Alberto Garcia
On Tue 20 Jun 2017 02:02:06 PM CEST, Daniel P. Berrange wrote: >> > +if (encryptfmt) { >> > +buf = qemu_opt_get_del(opts, BLOCK_OPT_ENCRYPT); >> > +if (buf != NULL) { >> > +g_free(buf); >> >> If you use qemu_opt_get() instead then you don't need "buf" at all, >> do

Re: [Qemu-block] [PATCH v10 09/20] qcow: convert QCow to use QCryptoBlock for encryption

2017-06-26 Thread Alberto Garcia
On Fri 23 Jun 2017 06:24:08 PM CEST, Daniel P. Berrange wrote: > This converts the qcow driver to make use of the QCryptoBlock > APIs for encrypting image content. This is only wired up to > permit use of the legacy QCow encryption format. Users who wish > to have the strong LUKS format should swit

Re: [Qemu-block] [PATCH v10 07/20] block: deprecate "encryption=on" in favor of "encrypt.format=aes"

2017-06-26 Thread Alberto Garcia
e > mapping to a nested QAPI schema at later date. > > e.g. the preferred syntax is now > > qemu-img create -f qcow2 -o encrypt.format=aes demo.qcow2 > > Signed-off-by: Daniel P. Berrange Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v10 10/20] qcow2: make qcow2_encrypt_sectors encrypt in place

2017-06-26 Thread Alberto Garcia
tput already. > > Signed-off-by: Daniel P. Berrange Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v10 11/20] qcow2: convert QCow2 to use QCryptoBlock for encryption

2017-06-26 Thread Alberto Garcia
e simplified since there is no longer a > difference in behaviour when using blockdev_add with encrypted > images for the running vs stopped CPU state. > > Signed-off-by: Daniel P. Berrange Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v10 13/20] qcow2: add support for LUKS encryption format

2017-06-26 Thread Alberto Garcia
; guest virtual sector. This guarantees unique initialization > vectors for all sectors when qcow2 internal snapshots are > used, thus giving stronger protection against watermarking > attacks. > > Signed-off-by: Daniel P. Berrange Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember

2017-06-27 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:53 PM CEST, Manos Pitsidianakis wrote: > This commit gathers ThrottleGroup membership details from > BlockBackendPublic into ThrottleGroupMember and refactors existing code > to use the structure. > > Signed-off-by: Manos Pitsidianakis Hey Manos, thanks for the patch. It

Re: [Qemu-block] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember

2017-06-27 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:54 PM CEST, Manos Pitsidianakis wrote: > timer_cb() needs to know about the current Aio context of the throttle > request that is woken up. In order to make ThrottleGroupMember backend > agnostic, this information is stored in an aio_context field instead of > accessing it

Re: [Qemu-block] [PATCH RFC v3 4/8] block: convert ThrottleGroup to object with QOM

2017-06-27 Thread Alberto Garcia
On Mon 26 Jun 2017 06:58:32 PM CEST, Manos Pitsidianakis wrote: > On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote: >>On Fri, Jun 23, 2017 at 03:46:56PM +0300, Manos Pitsidianakis wrote: >>> +static bool throttle_group_exists(const char *name) >>> +{ >>> +ThrottleGroup *iter; >>>

Re: [Qemu-block] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-28 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:57 PM CEST, Manos Pitsidianakis wrote: > +# @BlockdevOptionsThrottle: > +# > +# Driver specific block device options for Throttle > +# I would put this earlier in the json file, together with the rest of the BlockdevOptions* structs. > +# @throttling-group: the name of t

Re: [Qemu-block] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()

2017-06-28 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:58 PM CEST, Manos Pitsidianakis wrote: > BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char > *node_name, > - int flags, Error **errp) > + int flags, QDict *options, Error > **er

Re: [Qemu-block] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-28 Thread Alberto Garcia
On Wed 28 Jun 2017 04:58:00 PM CEST, Kashyap Chamarthy wrote: > This patch documents (including their QMP invocations) all the four > major kinds of live block operations: > > - `block-stream` > - `block-commit` > - `drive-mirror` (& `blockdev-mirror`) > - `drive-backup` (& `blockdev-backup

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-29 Thread Alberto Garcia
On Wed 28 Jun 2017 10:33:49 PM CEST, Eric Blake wrote: >>> +Disk image backing chain notation >>> +- >> [...] >>> +.. important:: >>> +The base disk image can be raw format; however, all the overlay >>> +files must be of QCOW2 format. >> >> This is not qui

Re: [Qemu-block] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-29 Thread Alberto Garcia
On Wed 28 Jun 2017 04:58:00 PM CEST, Kashyap Chamarthy wrote: > +Once a 'mirror' job has started, there are two possible actions when a > +``drive-mirror`` job is active: > + > +1. Issuing the command ``block-job-cancel``: will, after completing > + synchronization of the content from the disk im

Re: [Qemu-block] [PATCH v5 01/25] block/mirror: Small absolute-paths simplification

2017-06-29 Thread Alberto Garcia
ot have a backing BDS at all (the BDS is opened with O_NO_BACKING in > qmp_drive_mirror()), so just assert that and assign the new backing BDS > unconditionally. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v5 02/25] block: Use children list in bdrv_refresh_filename

2017-06-29 Thread Alberto Garcia
x Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [RFC] QMP design: Fixing query-block and friends

2017-06-30 Thread Alberto Garcia
On Tue 27 Jun 2017 06:31:45 PM CEST, Kevin Wolf wrote: > * Speaking of recursion: ImageInfo recursively includes information > about all images in the backing chain. This is what makes the output > of query-named-block-nodes so redundant. It is also inconsistent > because the runtime informat

Re: [Qemu-block] [RFC] QMP design: Fixing query-block and friends

2017-06-30 Thread Alberto Garcia
On Fri 30 Jun 2017 04:22:11 PM CEST, Kevin Wolf wrote: > Am 30.06.2017 um 15:01 hat Alberto Garcia geschrieben: >> On Tue 27 Jun 2017 06:31:45 PM CEST, Kevin Wolf wrote: >> > * Speaking of recursion: ImageInfo recursively includes information >> > about all images in

Re: [Qemu-block] [PATCH v3 1/7] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-04 Thread Alberto Garcia
czi > Signed-off-by: Manos Pitsidianakis Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v3 2/7] block: add aio_context field in ThrottleGroupMember

2017-08-04 Thread Alberto Garcia
accessing it from BlockBackend. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Manos Pitsidianakis Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v3 3/7] block: tidy ThrottleGroupMember initializations

2017-08-04 Thread Alberto Garcia
czi > Signed-off-by: Manos Pitsidianakis Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] Is the use of bdrv_getlength() in quorum_co_flush() kosher?

2017-08-04 Thread Alberto Garcia
On Fri 04 Aug 2017 02:48:03 PM CEST, Markus Armbruster wrote: > Have a look at quorum_co_flush(): > > quorum_report_bad(QUORUM_OP_TYPE_FLUSH, 0, > bdrv_getlength(s->children[i]->bs), > s->children[i]->bs->node_name, result); >

[Qemu-block] [PATCH] quorum: Handle bdrv_getlength() failures in quorum_co_flush()

2017-08-04 Thread Alberto Garcia
A bdrv_getlength() call can fail and return a negative value. This is not being handled in quorum_co_flush(), which can result in a QUORUM_REPORT_BAD event with an arbitrary value on the 'sectors-count' field. Reported-by: Markus Armbruster Signed-off-by: Alberto Garcia --- block/qu

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] quorum: Handle bdrv_getlength() failures in quorum_co_flush()

2017-08-07 Thread Alberto Garcia
On Fri 04 Aug 2017 05:44:00 PM CEST, Eric Blake wrote: >> --- a/block/quorum.c >> +++ b/block/quorum.c >> @@ -785,8 +785,9 @@ static coroutine_fn int quorum_co_flush(BlockDriverState >> *bs) >> for (i = 0; i < s->num_children; i++) { >> result = bdrv_co_flush(s->children[i]->bs); >>

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] quorum: Handle bdrv_getlength() failures in quorum_co_flush()

2017-08-07 Thread Alberto Garcia
On Mon 07 Aug 2017 01:29:09 PM CEST, Eric Blake wrote: > On 08/07/2017 03:43 AM, Alberto Garcia wrote: >> On Fri 04 Aug 2017 05:44:00 PM CEST, Eric Blake wrote: >>>> --- a/block/quorum.c >>>> +++ b/block/quorum.c >>>> @@ -785,8 +785,9 @@

[Qemu-block] [PATCH for-2.10] quorum: Set sectors-count to 0 when reporting a flush error

2017-08-07 Thread Alberto Garcia
0 instead in all cases. Reported-by: Markus Armbruster Signed-off-by: Alberto Garcia --- block/quorum.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index 55ba916655..d04da4f430 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -78

[Qemu-block] [PATCH for-2.10] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-07 Thread Alberto Garcia
hat makes the throttling smoother. Signed-off-by: Alberto Garcia --- include/qemu/throttle.h | 4 ++-- util/throttle.c | 7 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index d056008c18..ec37ac0fcb 100644

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 12:00:30 PM CEST, Stefan Hajnoczi wrote: > On Mon, Aug 07, 2017 at 07:15:29PM +0300, Alberto Garcia wrote: >> Both the throttling limits set with the throttling.iops-* and >> throttling.bps-* options and their QMP equivalents defined in the >> BlockIOThrott

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 12:17:12 PM CEST, Alberto Garcia wrote: > I was under the impression that Markus wanted to change the QAPI types > of the throttling fields in BlockDeviceInfo for 2.10 as well, so this > patch is relevant. I just saw that his series is still an RFC, so we can leave t

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-08 Thread Alberto Garcia
On Wed 02 Aug 2017 12:57:04 PM CEST, Manos Pitsidianakis wrote: >> At the moment I think throttle_groups_lock isn't strictly needed >> because incref/decref callers hold the QEMU global mutex anyway. >> >> But code accessing throttle_groups still has to be disciplined. >> Since throttle_groups_lock

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-08 Thread Alberto Garcia
On Mon 31 Jul 2017 11:54:41 AM CEST, Manos Pitsidianakis wrote: > block/throttle.c uses existing I/O throttle infrastructure inside a > block filter driver. I/O operations are intercepted in the filter's > read/write coroutines, and referred to block/throttle-groups.c > > The driver can be used wit

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 03:45:44 PM CEST, Manos Pitsidianakis wrote: > On Tue, Aug 08, 2017 at 03:13:36PM +0200, Alberto Garcia wrote: >>On Mon 31 Jul 2017 11:54:41 AM CEST, Manos Pitsidianakis wrote: >>> block/throttle.c uses existing I/O throttle infrastructure inside a >>&g

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 04:56:20 PM CEST, Manos Pitsidianakis wrote: >>> So basically if we have anonymous groups, we accept limits in the >>> driver options but only without a group-name. >> >>In the commit message you do however have limits and a group name, is >>that a mistake? >> >>-drive driver

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 05:11:27 PM CEST, Eric Blake wrote: >> Why is this marked for-2.10? Does it fix a bug? > > Theoretically, converting between int64_t and double loses precision > on any values larger than 2^53. In all practicality, though, if you > expect throttling to be precise through 2^53 (

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-09 Thread Alberto Garcia
On Wed 09 Aug 2017 11:36:12 AM CEST, Manos Pitsidianakis wrote: > On Tue, Aug 08, 2017 at 05:04:48PM +0200, Alberto Garcia wrote: >>On Tue 08 Aug 2017 04:56:20 PM CEST, Manos Pitsidianakis wrote: >>>>> So basically if we have anonymous groups, we accept limits in the >&

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-09 Thread Alberto Garcia
On Wed 09 Aug 2017 03:42:07 PM CEST, Manos Pitsidianakis wrote: > On Wed, Aug 09, 2017 at 02:36:20PM +0200, Alberto Garcia wrote: >>On Wed 09 Aug 2017 11:36:12 AM CEST, Manos Pitsidianakis wrote: >>> On Tue, Aug 08, 2017 at 05:04:48PM +0200, Alberto Garcia wrote: >>>>

Re: [Qemu-block] [PATCH v4 5/7] block: add throttle block filter driver

2017-08-10 Thread Alberto Garcia
On Wed 09 Aug 2017 12:07:32 PM CEST, Manos Pitsidianakis wrote: > +/* Extract ThrottleConfig options. Assumes cfg is initialized and will be > + * checked for validity. > + * > + * Returns -1 and sets errp if a burst_length value is over UINT_MAX. > + */ > +static int throttle_extract_options(QemuO

Re: [Qemu-block] [PATCH v4 4/7] block: convert ThrottleGroup to object with QOM

2017-08-10 Thread Alberto Garcia
On Wed 09 Aug 2017 12:07:31 PM CEST, Manos Pitsidianakis wrote: > +/* unfix buckets to check validity */ > +throttle_get_config(&tg->ts, cfg); > +if (!throttle_is_valid(cfg, errp)) { > +return; > +} > +/* fix buckets again */ > +throttle_config(&tg->ts, tg->clock_typ

[Qemu-block] [RFC] Intermediate block mirroring

2015-04-02 Thread Alberto Garcia
Hi, I'm interested in adding the possibility to mirror an intermediate node in a disk image chain, but I would like to have some feedback before sending any patches. The goal would be to convert this: [A] -> [B] -> [C] -> [D] into this: [A] -> [B] -> [X] -> [D] where [D] is the active i

Re: [Qemu-block] [PATCH v2 2/4] block: Pause block jobs in bdrv_drain_all

2015-04-07 Thread Alberto Garcia
te over all block jobs. The one that I wrote is probably not the best one. Maybe we can have block_job_create/completed() maintain a list of jobs instead. https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg04800.html But anyway I don't think it's something for this patchset, therefore: Reviewed-by: Alberto Garcia Berto

<    4   5   6   7   8   9   10   11   12   13   >