Re: [Qemu-block] [PATCH v2 11/13] block: Remove bdrv_move_feature_fields()

2016-05-04 Thread Alberto Garcia
On Fri 22 Apr 2016 07:42:40 PM CEST, Kevin Wolf wrote: > bdrv_move_feature_fields() and swap_feature_fields() are empty now, they > can be removed. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v9 03/11] block: use the block job list in qmp_query_block_jobs()

2016-05-02 Thread Alberto Garcia
On Fri 29 Apr 2016 04:32:41 PM CEST, Kevin Wolf wrote: > However, I'd like to give you a heads-up that this will technically > conflict with my series that removes BlockDriverState.blk because that > changes the bdrv_next() signature. > > Nothing dramatic, but I guess it would make sense to

Re: [Qemu-block] [PATCH v2 14/14] blockjob: Remove BlockJob.bs

2016-05-25 Thread Alberto Garcia
t;mre...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v3 06/15] block: Make blk_co_preadv/pwritev() public

2016-05-25 Thread Alberto Garcia
On Wed 25 May 2016 02:29:14 PM CEST, Kevin Wolf wrote: > Also add trace points now that the function can be directly called. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v2 02/14] block: Cancel jobs first in bdrv_close_all()

2016-05-25 Thread Alberto Garcia
vin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v2 11/14] backup: Remove bs parameter from backup_do_cow()

2016-05-25 Thread Alberto Garcia
On Tue 24 May 2016 03:47:31 PM CEST, Kevin Wolf <kw...@redhat.com> wrote: > Now that we pass the job to the function, bs is implied by that. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v2 06/14] stream: Use BlockBackend for I/O

2016-05-25 Thread Alberto Garcia
kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v2 04/14] block: Convert block job core to BlockBackend

2016-05-25 Thread Alberto Garcia
s the BDS that job->blk points to. At the > moment block jobs are too tightly coupled with their BDS, so that moving > a job to another BDS isn't easily possible; therefore, we need to just > manually undo this change afterwards. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v2 03/14] block: Default to enabled write cache in blk_new()

2016-05-25 Thread Alberto Garcia
off-by: Kevin Wolf <kw...@redhat.com> > Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

[Qemu-block] [PATCH for-2.7 v2 0/2] Don't allow burst limits to be lower than the normal limits

2016-07-28 Thread Alberto Garcia
error message [Eric] Alberto Garcia (2): throttle: Don't allow burst limits to be lower than the normal limits throttle: Test burst limits lower than the normal limits tests/test-throttle.c | 8 util/throttle.c | 5 + 2 files changed, 13 insertions(+) -- 2.8.1

[Qemu-block] [PATCH for-2.7 v2 1/2] throttle: Don't allow burst limits to be lower than the normal limits

2016-07-28 Thread Alberto Garcia
=1355665 Signed-off-by: Alberto Garcia <be...@igalia.com> Reported-by: Gu Nini <n...@redhat.com> --- util/throttle.c | 5 + 1 file changed, 5 insertions(+) diff --git a/util/throttle.c b/util/throttle.c index 654f95c..3817d9b 100644 --- a/util/throttle.c +++ b/util/throttle.c @@ -3

[Qemu-block] [PATCH for-2.7 v2 2/2] throttle: Test burst limits lower than the normal limits

2016-07-28 Thread Alberto Garcia
This checks that making FOO_max lower than FOO is not allowed. We could also forbid having FOO_max == FOO, but that doesn't have any odd side effects and it would require us to update several other tests, so let's keep it simple. Signed-off-by: Alberto Garcia <be...@igalia.com> --- test

Re: [Qemu-block] [PATCH v4 01/11] block: Accept node-name for block-stream

2016-08-01 Thread Alberto Garcia
ng at a root node. > > In case of an invalid device name, the command returns the GenericError > error class now instead of DeviceNotFound, because this is what > qmp_get_root_bs() returns. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v4 02/11] block: Accept node-name for block-commit

2016-08-01 Thread Alberto Garcia
On Thu 14 Jul 2016 03:28:05 PM CEST, Kevin Wolf wrote: > -blk = blk_by_name(device); > -if (!blk) { > -error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, > - "Device '%s' not found", device); > +bs = qmp_get_root_bs(device, _err); > +if (!bs) { > +bs =

Re: [Qemu-block] [PATCH v4 04/11] block: Accept node-name for blockdev-mirror

2016-08-01 Thread Alberto Garcia
ng at a root node. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v4 08/11] block: Accept node-name for drive-backup

2016-08-01 Thread Alberto Garcia
hout lifting the restriction that we're operating at a root > node. > > In case of an invalid device name, the command returns the GenericError > error class now instead of DeviceNotFound, because this is what > qmp_get_root_bs() returns. > > Signed-off-by: Kevin Wolf <kw...@redh

Re: [Qemu-block] [PATCH v4 05/11] block: Accept node-name for blockdev-snapshot-delete-internal-sync

2016-08-01 Thread Alberto Garcia
restriction that we're operating at a root node. > > In case of an invalid device name, the command returns the GenericError > error class now instead of DeviceNotFound, because this is what > qmp_get_root_bs() returns. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-

Re: [Qemu-block] [PATCH v4 07/11] block: Accept node-name for change-backing-file

2016-08-01 Thread Alberto Garcia
re operating at a root node. > > In case of an invalid device name, the command returns the GenericError > error class now instead of DeviceNotFound, because this is what > qmp_get_root_bs() returns. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH for-2.6 0/2] Fix regression with the default naming of throttling groups

2016-07-26 Thread Alberto Garcia
On Fri, Jul 08, 2016 at 05:05:12PM +0300, Alberto Garcia wrote: > Hi, > > Stefan reported this, this is a regression caused by commit > efaa7c4eeb7490c6f37f3. > > I sent a separate series for the git master, this is the backport > for QEMU v2.6.0. ping Berto

[Qemu-block] [PATCH for-2.7 0/2] Don't allow burst limits to be lower than the normal limits

2016-07-27 Thread Alberto Garcia
Hello, Gu Nini found this problem and reported it in https://bugzilla.redhat.com/show_bug.cgi?id=1355665 When setting the throttling configuration, the burst limits can be lower than the normal limits. This does not making any sense and behaves oddly, so let's forbid it. Berto Alberto Garcia

[Qemu-block] [PATCH for-2.7 2/2] throttle: Test burst limits lower than the normal limits

2016-07-27 Thread Alberto Garcia
This checks that making FOO_max lower than FOO is not allowed. We could also forbid having FOO_max == FOO, but that doesn't have any odd side effects and it would require us to update several other tests, so let's keep it simple. Signed-off-by: Alberto Garcia <be...@igalia.com> --- test

[Qemu-block] [PATCH for-2.7 1/2] throttle: Don't allow burst limits to be lower than the normal limits

2016-07-27 Thread Alberto Garcia
=1355665 Signed-off-by: Alberto Garcia <be...@igalia.com> Reported-by: Gu Nini <n...@redhat.com> --- util/throttle.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/util/throttle.c b/util/throttle.c index 654f95c..7a5c619 100644 --- a/util/throttle.c +++ b/util/throttle.c @@ -3

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.7 1/2] throttle: Don't allow burst limits to be lower than the normal limits

2016-07-27 Thread Alberto Garcia
On Thu 28 Jul 2016 12:33:51 AM CEST, Eric Blake wrote: >> +if (cfg->buckets[i].max && cfg->buckets[i].max < >> cfg->buckets[i].avg) { >> +error_setg(errp, "if bps_max/iops_max is set it cannot be lower" >> + " than the bps/iops

Re: [Qemu-block] [PATCH v5 01/11] block: Accept node-name for block-stream

2016-08-03 Thread Alberto Garcia
ng at a root node. > > In case of an invalid device name, the command returns the GenericError > error class now instead of DeviceNotFound, because this is what > qmp_get_root_bs() returns. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v5 02/11] block: Accept node-name for block-commit

2016-08-03 Thread Alberto Garcia
ng at a root node. > > As libvirt makes use of the DeviceNotFound error class, we must add > explicit code to retain this behaviour because qmp_get_root_bs() only > returns GenericErrors. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > Reviewed-by: Eric Blake <ebl..

Re: [Qemu-block] [Qemu-devel] [PATCH] quorum: Only compile when supported

2016-07-05 Thread Alberto Garcia
On Tue 05 Jul 2016 10:45:21 AM CEST, Daniel P. Berrange wrote: > The point of using qcrypto_hash_supports() is that it isolates the > block code Makefile rules from the details of the current specific > impl of the hash APIs in QEMU. As a prime example of why this is > important, try rebasing to

Re: [Qemu-block] [Qemu-devel] [PATCH] quorum: Only compile when supported

2016-07-05 Thread Alberto Garcia
On Tue 05 Jul 2016 09:58:25 AM CEST, Sascha Silbe wrote: > The quorum driver needs SHA256 which was introduced in gnutls 2.11.1. Are you sure about that? * Version 1.7.4 (released 2007-02-05) [...] ** API and ABI modifications: GNUTLS_MAC_SHA256, GNUTLS_MAC_SHA384, GNUTLS_MAC_SHA512: New

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

2016-07-05 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 Garcia <be...@igalia.com> Reviewed-by: Kevin Wo

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

2016-07-05 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 <be...@igalia.com> Reviewed-by: Kevin Wolf <kw...@redhat.com>

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

2016-07-05 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 <be...@igalia.com> Reviewed-by: Kevin Wolf <kw...@redhat.com> --- block/commit.c| 7 --- bl

[Qemu-block] [PATCH v4 04/11] block: Use block_job_get() in find_block_job()

2016-07-05 Thread Alberto Garcia
as the default job ID if the user doesn't specify a different one. Signed-off-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: Kevin Wolf <kw...@redhat.com> --- blockdev.c | 40 +--- 1 file changed, 13 insertion

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

2016-07-05 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 <be...@igalia.com> Reviewed-by: Max

Re: [Qemu-block] [PATCH v1 1/2] crypto: use glib as fallback for hash algorithm

2016-07-06 Thread Alberto Garcia
On Tue 05 Jul 2016 12:49:59 PM CEST, "Daniel P. Berrange" wrote: > GLib >= 2.16 provides GChecksum API which is good enough > for md5, sha1, sha256 and sha512. Use this as a final > fallback if neither nettle or gcrypt are available. This > lets us remove the stub hash

Re: [Qemu-block] [PATCH v4 00/11] Allow creating block jobs with a user-defined ID

2016-07-07 Thread Alberto Garcia
On Thu 07 Jul 2016 02:48:17 PM CEST, Kevin Wolf wrote: >> Hi all, >> >> block jobs are currently identified by the name of the block backend >> of the BDS where the job was started. >> >> The problem with this is that you cannot have block jobs on nodes >> where there is no such name. >> >>

Re: [Qemu-block] [PATCH v3 01/11] block: Accept node-name for block-stream

2016-07-07 Thread Alberto Garcia
On Thu 07 Jul 2016 02:11:27 PM CEST, Kevin Wolf wrote: > In order to remove the necessity to use BlockBackend names in the > external API, we want to allow node-names everywhere. This converts > block-stream to accept a node-name without lifting the restriction that > we're operating at a root

Re: [Qemu-block] [PATCH v3 01/11] block: Accept node-name for block-stream

2016-07-07 Thread Alberto Garcia
On Thu 07 Jul 2016 04:17:21 PM CEST, Kevin Wolf wrote: >> > +static BlockDriverState *qmp_get_root_bs(const char *name, Error **errp) >> > +{ >> > +BlockDriverState *bs; >> > + >> > +bs = bdrv_lookup_bs(name, name, errp); >> > +if (bs == NULL) { >> > +return NULL; >> > +}

Re: [Qemu-block] [PATCH 1/2] blockdev: Fix regression with the default naming of throttling groups

2016-07-08 Thread Alberto Garcia
On Fri 08 Jul 2016 04:23:03 PM CEST, Max Reitz wrote: >> +blk_id = qemu_opts_id(opts); >> + > > Side note: The "id" variable is supposed to contain the exact same > value, but the string it points to is invalidated by the > qdict_del(bs_opts, "id") call. > > So indeed we need to obtain the ID

[Qemu-block] [PATCH 0/2] Fix regression with the default naming of throttling groups

2016-07-08 Thread Alberto Garcia
Hi, Stefan reported this, this is a regression caused by commit efaa7c4eeb7490c6f37f3. QEMU v2.6.0 is affected but the patch cannot be backported as-is, I'll send a separate version to qemu-stable. Berto Alberto Garcia (2): blockdev: Fix regression with the default naming of throttling

[Qemu-block] [PATCH 2/2] qemu-iotests: Test naming of throttling groups

2016-07-08 Thread Alberto Garcia
-by: Alberto Garcia <be...@igalia.com> --- tests/qemu-iotests/093 | 98 ++ tests/qemu-iotests/093.out | 4 +- 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index ce8e13c..f

[Qemu-block] [PATCH for-2.6 1/2] blockdev: Fix regression with the default naming of throttling groups

2016-07-08 Thread Alberto Garcia
is that the throttling group gets an empty name. Signed-off-by: Alberto Garcia <be...@igalia.com> Reported-by: Stefan Hajnoczi <stefa...@redhat.com> Cc: Max Reitz <mre...@redhat.com> Cc: qemu-sta...@nongnu.org --- blockdev.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deleti

[Qemu-block] [PATCH for-2.6 0/2] Fix regression with the default naming of throttling groups

2016-07-08 Thread Alberto Garcia
Hi, Stefan reported this, this is a regression caused by commit efaa7c4eeb7490c6f37f3. I sent a separate series for the git master, this is the backport for QEMU v2.6.0. Berto Alberto Garcia (2): blockdev: Fix regression with the default naming of throttling groups qemu-iotests: Test

[Qemu-block] [PATCH 1/2] blockdev: Fix regression with the default naming of throttling groups

2016-07-08 Thread Alberto Garcia
is that the throttling group gets an empty name. Signed-off-by: Alberto Garcia <be...@igalia.com> Reported-by: Stefan Hajnoczi <stefa...@redhat.com> Cc: Max Reitz <mre...@redhat.com> Cc: qemu-sta...@nongnu.org --- blockdev.c | 7 +-- 1 file changed, 5 insertions(+), 2 deleti

[Qemu-block] [PATCH for-2.6 2/2] qemu-iotests: Test naming of throttling groups

2016-07-08 Thread Alberto Garcia
-by: Alberto Garcia <be...@igalia.com> --- tests/qemu-iotests/093 | 98 ++ tests/qemu-iotests/093.out | 4 +- 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index ce8e13c..f

Re: [Qemu-block] [PATCH v1 2/2] Revert "block: don't register quorum driver if SHA256 support is unavailable"

2016-07-07 Thread Alberto Garcia
orting in the > (unlikely) case sha256 is runtime disabled. > > This reverts commit e94867ed5f241008d0f53142b2704a075f9ed505. Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v1 1/2] crypto: use glib as fallback for hash algorithm

2016-07-07 Thread Alberto Garcia
ot too important, but you could do this after checking the hash length and the buffer size. You don't need to create or feed the GChecksum first for those, and that way you would also get rid of the 'goto error'. Either way, Reviewed-by: Alberto Garcia <be...@igalia.com> > +ret = g_ch

Re: [Qemu-block] [PATCH v1 3/2] crypto: don't open-code qcrypto_hash_supports

2016-07-07 Thread Alberto Garcia
On Tue 05 Jul 2016 06:43:13 PM CEST, "Daniel P. Berrange" <berra...@redhat.com> wrote: > Call the existing qcrypto_hash_supports method from > qcrypto_hash_bytesv instead of open-coding it again. > > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> "

Re: [Qemu-block] [PATCH v3 10/11] qemu-img: Set the ID of the block job in img_commit()

2016-07-04 Thread Alberto Garcia
On Sat 02 Jul 2016 04:21:33 PM CEST, Max Reitz wrote: > On 01.07.2016 17:52, Alberto Garcia wrote: >> img_commit() creates a block job without an ID. This is no longer >> allowed now that we require it to be unique and well-formed. We were >> solving this by having a fallbac

Re: [Qemu-block] [PATCH v3 04/11] block: Use block_job_get() in find_block_job()

2016-07-04 Thread Alberto Garcia
On Sat 02 Jul 2016 04:02:11 PM CEST, Max Reitz wrote: >> +/* Get a block job using its ID and acquire its AioContext */ >> +static BlockJob *find_block_job(const char *id, AioContext **aio_context, >> Error **errp) >> { >> -BlockBackend *blk; >> -

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

2016-07-05 Thread Alberto Garcia
ame is the same in both cases and is consistent with other cases (like commit_start()). Signed-off-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: Kevin Wolf <kw...@redhat.com> --- include/block/block_int.h | 11 ++- 1 file change

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

2016-06-30 Thread Alberto Garcia
On Wed 29 Jun 2016 07:20:55 PM CEST, Max Reitz wrote: I thought adding a new 'ID' field was simpler. The device name is still a device name (where it makes sense). The default ID is guaranteed to be valid and guaranteed not to clash with user-defined IDs. The API is (in my

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

2016-07-01 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 <be...@igalia.com> Reviewed-by: Max Reit

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

2016-07-01 Thread Alberto Garcia
ID, so we solve it by setting a default value. We'll get rid of this as soon as we extend the API. Signed-off-by: Alberto Garcia <be...@igalia.com> --- block/backup.c| 3 ++- block/commit.c| 2 +- block/mirror.c| 2 +- block/stream.c

[Qemu-block] [PATCH v3 04/11] block: Use block_job_get() in find_block_job()

2016-07-01 Thread Alberto Garcia
as the default job ID if the user doesn't specify a different one. Signed-off-by: Alberto Garcia <be...@igalia.com> --- blockdev.c | 43 --- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/blockdev.c b/blockdev.c index 3a104a0..8cedb60

[Qemu-block] [PATCH v3 10/11] qemu-img: Set the ID of the block job in img_commit()

2016-07-01 Thread Alberto Garcia
that change. Signed-off-by: Alberto Garcia <be...@igalia.com> --- blockjob.c | 6 -- qemu-img.c | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/blockjob.c b/blockjob.c index 511c0db..3b9cec7 100644 --- a/blockjob.c +++ b/blockjob.c @@ -132,12 +132,6 @@ void *block_job_

[Qemu-block] [PATCH v3 11/11] blockjob: Update description of the 'device' field in the QMP API

2016-07-01 Thread Alberto Garcia
The 'device' field in all BLOCK_JOB_* events and 'block-job-*' command is no longer the device name, but the ID of the job. This patch updates the documentation to clarify that. Signed-off-by: Alberto Garcia <be...@igalia.com> --- docs/qmp-events.txt | 12 qapi/block-core.jso

[Qemu-block] [PATCH v3 00/11] Allow creating block jobs with a user-defined ID

2016-07-01 Thread Alberto Garcia
evice' field in the QMP API' Alberto Garcia (11): stream: Fix prototype of stream_start() blockjob: Update description of the 'id' field blockjob: Add block_job_get() block: Use block_job_get() in find_block_job() blockjob: Add 'job_id' parameter to block_job_create() mirror:

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

2016-07-01 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 <be...@igalia.com> Reviewed-by: Max

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

2016-07-01 Thread Alberto Garcia
ame is the same in both cases and is consistent with other cases (like commit_start()). Signed-off-by: Alberto Garcia <be...@igalia.com> Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: Kevin Wolf <kw...@redhat.com> --- include/block/block_int.h | 11 ++- 1 file change

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

2016-07-01 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 <be...@igalia.com> Reviewed-by: Max Reitz <mre...@redhat.com>

Re: [Qemu-block] [PATCH] quorum: Only compile when supported

2016-07-04 Thread Alberto Garcia
On Sat 02 Jul 2016 02:36:38 PM CEST, Max Reitz wrote: >> This was the only exceptional module init function that does >> something else than a simple list of bdrv_register() calls, in all >> the block drivers. > > This sounds like this patch specifically wants to drop the check from >

[Qemu-block] [PATCH v3 02/11] blockjob: Update description of the 'id' field

2016-07-01 Thread Alberto Garcia
The 'id' field of the BlockJob structure will be able to hold any ID, not only a device name. This patch updates the description of that field and the error messages where it is being used. Soon we'll add the ability to set an arbitrary ID when creating a block job. Signed-off-by: Alberto Garcia

Re: [Qemu-block] [PATCH] block jobs: Improve error message for missing job ID

2016-08-16 Thread Alberto Garcia
little > bit nicer. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH 2/2] iov: assert that qiov->size doesn't exceed INT_MAX

2017-02-01 Thread Alberto Garcia
On Wed 01 Feb 2017 10:56:29 PM CET, Max Reitz wrote: >> I was actually just reading virtio_blk_handle_request() and I see >> that the I/O vector is initialized before the check for the maximum >> request size that returns VIRTIO_BLK_S_IOERR. >> >> So you're probably right and

Re: [Qemu-block] [PATCH 2/2] iov: assert that qiov->size doesn't exceed INT_MAX

2017-02-01 Thread Alberto Garcia
On Wed 01 Feb 2017 10:51:01 PM CET, Max Reitz wrote: > The assertion probably makes sense even for them, considering that > size_t does not have a constant size. But I'm not entirely sold that > the I/O vector creation is actually the place where the assertions > belong. I

Re: [Qemu-block] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-02-01 Thread Alberto Garcia
On Wed 01 Feb 2017 10:36:20 PM CET, Max Reitz wrote: >> +if (count > INT_MAX - len) { > > How about using BDRV_REQUEST_MAX_BYTES instead? > > (not yet in master, just in my block branch) Sounds good to me, feel free to edit my patch directly. Berto

Re: [Qemu-block] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-02-02 Thread Alberto Garcia
On Wed 01 Feb 2017 11:16:38 PM CET, Max Reitz wrote: > Thanks, applied to my block tree, with > %s/INT_MAX/BDRV_REQUEST_MAX_BYTES/g: I think you can use %d to print BDRV_REQUEST_MAX_BYTES, after all the definition guarantees that it won't be larger than MIN(SIZE_MAX,INT_MAX)

Re: [Qemu-block] [PATCH] qcow2: Optimize the refcount-block overlap check

2017-02-01 Thread Alberto Garcia
On Wed 01 Feb 2017 02:46:20 AM CET, Max Reitz wrote: >> The problem with the refcount table is that since it always occupies >> complete clusters its size is usually very big. > > Actually the main problem is that BDRVQcow2State.refcount_table_size > is updated very generously

Re: [Qemu-block] Performance impact of the qcow2 overlap checks

2017-01-31 Thread Alberto Garcia
On Tue 31 Jan 2017 01:23:33 PM CET, John Snow wrote: >> And of course another approach I already mentioned would be to scrap >> the overlap checks altogether once we have image locking (and I guess >> we can keep them around in their current form at least until then). > > I

[Qemu-block] [PATCH 0/2] qemu-io: check the size of the I/O requests

2017-01-31 Thread Alberto Garcia
_external() to detect these cases earlier. Regards, Berto Alberto Garcia (2): qemu-io: don't allow I/O operations larger than INT_MAX iov: assert that qiov->size doesn't exceed INT_MAX qemu-io-cmds.c | 21 - util/iov.c | 7 ++- 2 files changed, 18 ins

[Qemu-block] [PATCH 2/2] iov: assert that qiov->size doesn't exceed INT_MAX

2017-01-31 Thread Alberto Garcia
which is where it belongs. Signed-off-by: Alberto Garcia <be...@igalia.com> --- util/iov.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/iov.c b/util/iov.c index 74e6ca8ed7..6b5cc9203c 100644 --- a/util/iov.c +++ b/util/iov.c @@ -283,13 +28

[Qemu-block] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Alberto Garcia
I/O code cannot handle request sizes larger than INT_MAX, so this patch makes qemu-io check that all values are within range. Signed-off-by: Alberto Garcia <be...@igalia.com> --- qemu-io-cmds.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/qemu-i

Re: [Qemu-block] Performance impact of the qcow2 overlap checks

2017-02-01 Thread Alberto Garcia
On Tue 31 Jan 2017 11:31:34 PM CET, Max Reitz wrote: >> I think the checks as they are now are very simple and it's not worth >> complicating them too much unless we have numbers that prove that >> they're slowing things down. I only got those numbers for the first >> one. > >

[Qemu-block] [PATCH v2] qcow2: Optimize the refcount-block overlap check

2017-02-01 Thread Alberto Garcia
-off-by: Alberto Garcia <be...@igalia.com> --- Changes: v2: - Handle tables with holes correctly in alloc_refcount_block() block/qcow2-refcount.c | 24 +++- block/qcow2.c | 1 + block/qcow2.h | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Alberto Garcia
On Tue 31 Jan 2017 05:31:32 PM CET, Eric Blake wrote: > Ideally, it would be nice to fix the block layer to allow larger > requests (since we already have code to auto-fragment down to device > limits, we should be able to rely on that code instead of having to > duplicate artificial constraints

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Alberto Garcia
On Tue 31 Jan 2017 05:41:23 PM CET, Eric Blake wrote: >>> Ideally, it would be nice to fix the block layer to allow larger >>> requests (since we already have code to auto-fragment down to device >>> limits, we should be able to rely on that code instead of having to >>>

Re: [Qemu-block] [PATCH v3 01/18] block: expose crypto option names / defs to other drivers

2017-02-08 Thread Alberto Garcia
; Reviewed-by: Max Reitz <mre...@redhat.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

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

2017-02-08 Thread Alberto Garcia
On Thu 26 Jan 2017 11:18:20 AM CET, "Daniel P. Berrange" wrote: > @@ -751,6 +757,23 @@ static int qcow2_update_options_prepare(BlockDriverState > *bs, > r->discard_passthrough[QCOW2_DISCARD_OTHER] = > qemu_opt_get_bool(opts, QCOW2_OPT_DISCARD_OTHER, false); >

Re: [Qemu-block] [PATCH v3 03/18] qcow: document another weakness of qcow AES encryption

2017-02-08 Thread Alberto Garcia
e formatting of the itemized list too. > > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] Performance impact of the qcow2 overlap checks

2017-01-23 Thread Alberto Garcia
On Sat 21 Jan 2017 04:27:42 PM CET, Max Reitz wrote: >>> I have optimized these checks. See: >>> >>> http://lists.nongnu.org/archive/html/qemu-block/2015-08/msg00020.html >>> >>> Feel free to review. If you want, I can rebase the series. >>> >>> So far nobody has seriously done so because it

Re: [Qemu-block] Performance impact of the qcow2 overlap checks

2017-01-24 Thread Alberto Garcia
On Mon 23 Jan 2017 05:29:49 PM CET, Max Reitz wrote: > Refcount data will only be queried when writing data to the image. If > that data has been overwritten, we have a chance that it is being set > to 0 (which is rather large because 0 generally has a higher > probability of being a part of data,

Re: [Qemu-block] Performance impact of the qcow2 overlap checks

2017-01-25 Thread Alberto Garcia
On Wed 25 Jan 2017 03:03:36 PM CET, Max Reitz wrote: >>> (2) It is legal to have a greater refcount than the number of >>> internal snapshots plus one. qemu never produces such images, though >>> (or does it?). Could there be existing images where users will be >>> just annoyed by such warnings?

Re: [Qemu-block] [PATCH] qemu-options: explain disk I/O throttling options

2017-02-21 Thread Alberto Garcia
On Mon 20 Feb 2017 05:52:04 PM CET, Stefan Hajnoczi wrote: > The disk I/O throttling options have been listed for a long time but > never explained on the QEMU man page. > +@item bps=@var{b},bps_rd=@var{r},bps_wr=@var{w} > +Specify bandwidth throttling limits in bytes per second, either for all

Re: [Qemu-block] [PATCH v5 12/18] qcow2: extend specification to cover LUKS encryption

2017-02-21 Thread Alberto Garcia
;mre...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

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

2017-02-21 Thread Alberto Garcia
rrect format string will result in s->crypt_method_header = -EINVAL, which doesn't make sense (it's not even the correct type: the variable is unsigned). Other than that, the patch looks good to me. Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v5 16/18] block: rip out all traces of password prompting

2017-02-21 Thread Alberto Garcia
us be ripped out. > > Reviewed-by: Max Reitz <mre...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v5 17/18] block: remove all encryption handling APIs

2017-02-21 Thread Alberto Garcia
On Tue 21 Feb 2017 12:55:11 PM CET, Daniel P. Berrange wrote: > @@ -2244,24 +2240,8 @@ void qmp_block_passwd(bool has_device, const char > *device, >bool has_node_name, const char *node_name, >const char *password, Error **errp) > { > -Error

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

2017-02-21 Thread Alberto Garcia
On Tue 21 Feb 2017 12:55:05 PM CET, Daniel P. Berrange wrote: > +switch (s->crypt_method_header) { > +case QCOW_CRYPT_NONE: > +break; > + > +case QCOW_CRYPT_AES: > +r->crypto_opts = block_crypto_open_opts_init( > +Q_CRYPTO_BLOCK_FORMAT_QCOW, opts, "aes-",

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

2017-02-21 Thread Alberto Garcia
On Tue 21 Feb 2017 12:55:03 PM CET, Daniel P. Berrange wrote: > @@ -175,8 +185,31 @@ static int qcow_open(BlockDriverState *bs, QDict > *options, int flags, > ret = -ENOSYS; > goto fail; > } > +if (s->crypt_method_header == QCOW_CRYPT_AES) { > +

Re: [Qemu-block] [PATCH] qemu-options: explain disk I/O throttling options

2017-02-22 Thread Alberto Garcia
On Wed 22 Feb 2017 12:14:33 PM CET, Stefan Hajnoczi wrote: >> > Values must be larger than the maximum >> > +request size to avoid timeouts or hangs in the guest. At minimum use 2 >> > MB/s >> > +for disks. >> >> Is this so? throttle_compute_wait() does not use the request size at >> all. The

Re: [Qemu-block] blockdev-add I/O throttling parameters

2017-02-20 Thread Alberto Garcia
On Mon, Feb 20, 2017 at 04:45:54PM +0100, Kevin Wolf wrote: > > I can imagine two solutions that do not need these parameters in > > blockdev-add: > > > > 1. I/O throttling is implemented by a BlockDriver. Users are expected > >to create the BDS themselves. This is a little awkward since >

Re: [Qemu-block] [PATCH] block: Remove unnecessary cases of error_propagate()

2017-02-21 Thread Alberto Garcia
On Tue 21 Feb 2017 05:13:54 PM CET, Alberto Garcia wrote: > if (rc && rc != -ENOSYS) { > -error_propagate(errp, local_err); > return; > } > -error_free(local_err); [...] > -if (rc && rc != -ENOSYS && rc != -EINP

Re: [Qemu-block] [PATCH v5 18/18] block: pass option prefix down to crypto layer

2017-02-21 Thread Alberto Garcia
between crypto option names & other block option names. To > ensure the crypto layer can report accurate error messages, > we must tell it what option name prefix was used. > > Reviewed-by: Max Reitz <mre...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

[Qemu-block] [PATCH] block: Remove unnecessary cases of error_propagate()

2017-02-21 Thread Alberto Garcia
use errp directly instead. Signed-off-by: Alberto Garcia <be...@igalia.com> --- block.c| 4 +--- blockdev.c | 53 +++-- 2 files changed, 16 insertions(+), 41 deletions(-) diff --git a/block.c b/block.c index 743c349100..86e1023b

Re: [Qemu-block] [PATCH] block: Swap request limit definitions

2017-02-14 Thread Alberto Garcia
On Mon 13 Feb 2017 06:13:38 PM CET, Max Reitz wrote: >>> -#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \ >>> - INT_MAX >> BDRV_SECTOR_BITS) >>> -#define BDRV_REQUEST_MAX_BYTES (BDRV_REQUEST_MAX_SECTORS << >>> BDRV_SECTOR_BITS) >>>

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

2017-02-13 Thread Alberto Garcia
On Fri 10 Feb 2017 06:09:01 PM CET, Daniel P. Berrange wrote: > This converts the qcow2 driver to make use of the QCryptoBlock s/qcow2/qcow/ > 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

Re: [Qemu-block] [PATCH] block: Swap request limit definitions

2017-02-13 Thread Alberto Garcia
On Sun 12 Feb 2017 02:47:24 AM CET, Max Reitz wrote: > -#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \ > - INT_MAX >> BDRV_SECTOR_BITS) > -#define BDRV_REQUEST_MAX_BYTES (BDRV_REQUEST_MAX_SECTORS << BDRV_SECTOR_BITS) >

Re: [Qemu-block] [PATCH v4 08/18] qcow: make encrypt_sectors encrypt in place

2017-02-13 Thread Alberto Garcia
tput already > and the other two callers are easily converted to do so. > > Reviewed-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Max Reitz <mre...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> I think I had already reviewed this one in v3 :)

Re: [Qemu-block] [PATCH v3 02/18] block: add ability to set a prefix for opt names

2017-02-09 Thread Alberto Garcia
-secret" > so that they don't clash with any general qcow options at a later > date. > > Reviewed-by: Max Reitz <mre...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v3 05/18] iotests: skip 042 with qcow which dosn't support zero sized images

2017-02-09 Thread Alberto Garcia
f-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

Re: [Qemu-block] [PATCH v3 06/18] iotests: skip 048 with qcow which doesn't support resize

2017-02-09 Thread Alberto Garcia
f-by: Daniel P. Berrange <berra...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> Berto

<    2   3   4   5   6   7   8   9   10   11   >