[Qemu-block] [PATCH v4 2/2] iotests: Test that negative and large throttle values are rejected

2016-01-14 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- tests/qemu-iotests/051| 12 tests/qemu-iotests/051.out| 24 tests/qemu-iotests/051.pc.out | 24 3 files changed, 60 insertions(+) diff --git a/tests/qemu-iotests/051 b/

[Qemu-block] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-14 Thread Fam Zheng
The implicit casting from unsigned int to double changes negative values into large positive numbers and accepts them. We should instead print an error. Check the number range so this case is caught and reported. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- blockdev.c | 3

[Qemu-block] [PATCH v4 0/2] block: Reject negative values for throttling options

2016-01-14 Thread Fam Zheng
v4: Add Max's rev-by in both patches, while fixing the "maxs" typo. v3: Address comments: - Add test for large value; [Berto] - Fix typos "negative" & "caught"; [Eric, Berto] - Use "LL" suffix to the upper limit constant. [Berto] v2: Check the value range and report an appropriate err

Re: [Qemu-block] [PATCH v3 1/2] blockdev: Error out on negative throttling option values

2016-01-14 Thread Fam Zheng
On Thu, 01/14 16:50, Max Reitz wrote: > On 14.01.2016 16:46, Max Reitz wrote: > > On 14.01.2016 05:08, Fam Zheng wrote: > >> The implicit casting from unsigned int to double changes negative values > >> into large positive numbers and accepts them. We should instead print > >> an error. > >> > >>

Re: [Qemu-block] [PATCH v3 2/3] nbd: Split nbd.c

2016-01-14 Thread Paolo Bonzini
On 14/01/2016 18:26, Daniel P. Berrange wrote: > On Thu, Jan 14, 2016 at 04:41:02PM +0800, Fam Zheng wrote: >> We have NBD server code and client code, all mixed in a file. Now split >> them into separate files under nbd/, and update MAINTAINERS. >> >> filter_nbd for iotest 083 is updated to keep

Re: [Qemu-block] [PATCH v3 1/3] nbd: Always call "close_fn" in nbd_client_new

2016-01-14 Thread Daniel P. Berrange
On Thu, Jan 14, 2016 at 04:41:01PM +0800, Fam Zheng wrote: > Rename the parameter "close" to "close_fn" to disambiguous with > close(2). > > This unifies error handling paths of NBDClient allocation: > nbd_client_new will shutdown the socket and call the "close_fn" callback > if negotiation failed

Re: [Qemu-block] [PATCH v3 3/3] nbd-server: Coroutine based negotiation

2016-01-14 Thread Daniel P. Berrange
On Thu, Jan 14, 2016 at 04:41:03PM +0800, Fam Zheng wrote: > Create a coroutine in nbd_client_new, so that nbd_send_negotiate doesn't > need qemu_set_block(). > > Handlers need to be set temporarily for csock fd in case the coroutine > yields during I/O. > > With this, if the other end disappears

Re: [Qemu-block] [PATCH v3 2/3] nbd: Split nbd.c

2016-01-14 Thread Daniel P. Berrange
On Thu, Jan 14, 2016 at 04:41:02PM +0800, Fam Zheng wrote: > We have NBD server code and client code, all mixed in a file. Now split > them into separate files under nbd/, and update MAINTAINERS. > > filter_nbd for iotest 083 is updated to keep the log filtered out. > > Signed-off-by: Fam Zheng

Re: [Qemu-block] [PATCH] block: Fix .bdrv_open flags

2016-01-14 Thread Stefan Hajnoczi
On Mon, Jan 11, 2016 at 07:32:36PM +0100, Kevin Wolf wrote: > bdrv_common_open() modified bs->open_flags after inferring the set of > options to pass to the driver's .bdrv_open callback. This means that the > cache options were correctly set in bs->open_flags (and therefore > correctly displayed in

Re: [Qemu-block] [PATCH v10 1/2] mirror: Rewrite mirror_iteration

2016-01-14 Thread Max Reitz
On 13.01.2016 03:50, Fam Zheng wrote: > The "pnum < nb_sectors" condition in deciding whether to actually copy > data is unnecessarily strict, and the qiov initialization is > unnecessarily for bdrv_aio_write_zeroes and bdrv_aio_discard. > > Rewrite mirror_iteration to fix both flaws. > > The out

Re: [Qemu-block] [PATCH v3 2/2] iotests: Test that negative and large throttle values are rejected

2016-01-14 Thread Max Reitz
On 14.01.2016 05:08, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > tests/qemu-iotests/051| 12 > tests/qemu-iotests/051.out| 24 > tests/qemu-iotests/051.pc.out | 24 > 3 files changed, 60 insertions(+) Reviewed-by:

Re: [Qemu-block] [PATCH v3 1/2] blockdev: Error out on negative throttling option values

2016-01-14 Thread Max Reitz
On 14.01.2016 16:46, Max Reitz wrote: > On 14.01.2016 05:08, Fam Zheng wrote: >> The implicit casting from unsigned int to double changes negative values >> into large positive numbers and accepts them. We should instead print >> an error. >> >> Check the number range so this case is caught and re

Re: [Qemu-block] [PATCH v3 1/2] blockdev: Error out on negative throttling option values

2016-01-14 Thread Max Reitz
On 14.01.2016 05:08, Fam Zheng wrote: > The implicit casting from unsigned int to double changes negative values > into large positive numbers and accepts them. We should instead print > an error. > > Check the number range so this case is caught and reported. > > Signed-off-by: Fam Zheng > ---

Re: [Qemu-block] [Qemu-devel] [PATCH] block: acquire in bdrv_query_image_info

2016-01-14 Thread Max Reitz
On 23.12.2015 11:48, Paolo Bonzini wrote: > NFS calls aio_poll inside bdrv_get_allocated_size. This requires > acquiring the AioContext. > > Signed-off-by: Paolo Bonzini > --- > block/qapi.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) Thanks, applied to my block tree: htt

Re: [Qemu-block] [Qemu-devel] [PATCH 06/10] qemu-img: Prepare for locked images

2016-01-14 Thread Kevin Wolf
Am 14.01.2016 um 14:07 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 13.01.2016 um 09:44 hat Markus Armbruster geschrieben: > >> Kevin Wolf writes: > >> > Yes, these exist in theory. The question is what scenarios you want to > >> > protect against and whether improving the me

Re: [Qemu-block] [PATCH 00/10] qcow2: Implement image locking

2016-01-14 Thread Max Reitz
On 22.12.2015 17:46, Kevin Wolf wrote: > Enough innocent images have died because users called 'qemu-img snapshot' > while > the VM was still running. Educating the users doesn't seem to be a working > strategy, so this series adds locking to qcow2 that refuses to access the > image > read-write

Re: [Qemu-block] [Qemu-devel] [PATCH 06/10] qemu-img: Prepare for locked images

2016-01-14 Thread Markus Armbruster
Kevin Wolf writes: > Am 13.01.2016 um 09:44 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Am 12.01.2016 um 16:20 hat Markus Armbruster geschrieben: >> >> Kevin Wolf writes: >> >> >> >> > Am 11.01.2016 um 16:49 hat Markus Armbruster geschrieben: >> >> >> Eric Blake writes:

Re: [Qemu-block] [PATCH v1 10/15] qcow2: convert QCow2 to use QCryptoBlock for encryption

2016-01-14 Thread Kevin Wolf
Am 14.01.2016 um 13:14 hat Daniel P. Berrange geschrieben: > On Wed, Jan 13, 2016 at 07:42:20PM +0100, Kevin Wolf wrote: > > Am 12.01.2016 um 19:56 hat Daniel P. Berrange geschrieben: > > > +static ssize_t qcow2_fde_header_read_func(QCryptoBlock *block, > > > +

Re: [Qemu-block] [Qemu-devel] [PATCH v1 05/15] crypto: add block encryption framework

2016-01-14 Thread Daniel P. Berrange
On Wed, Jan 13, 2016 at 04:40:31PM -0700, Eric Blake wrote: > On 01/12/2016 11:56 AM, Daniel P. Berrange wrote: > > Add a generic framework for support different block encryption > > formats. Upon instantiating a QCryptoBlock object, it will read > > the encryption header and extract the encryption

Re: [Qemu-block] [Qemu-devel] [PATCH v1 02/15] crypto: add support for PBKDF2 algorithm

2016-01-14 Thread Daniel P. Berrange
On Wed, Jan 13, 2016 at 01:53:27PM +0800, Fam Zheng wrote: > On Tue, 01/12 18:56, Daniel P. Berrange wrote: > > +#if defined CONFIG_NETTLE > > +#include "crypto/pbkdf-nettle.c" > > +#elif defined CONFIG_GCRYPT > > +#include "crypto/pbkdf-gcrypt.c" > > +#else /* ! CONFIG_GCRYPT */ > > +#include "cry

Re: [Qemu-block] [PATCH v1 10/15] qcow2: convert QCow2 to use QCryptoBlock for encryption

2016-01-14 Thread Daniel P. Berrange
On Wed, Jan 13, 2016 at 07:42:20PM +0100, Kevin Wolf wrote: > Am 12.01.2016 um 19:56 hat Daniel P. Berrange geschrieben: > > This converts the qcow2 driver to make use of the QCryptoBlock > > APIs for encrypting image content. As well as continued support > > for the legacy QCow2 encryption format,

Re: [Qemu-block] [PATCH 1/1] RESUME blk: do not select PFLASH device for internal snapshot

2016-01-14 Thread Denis V. Lunev
On 01/12/2016 09:03 AM, Denis V. Lunev wrote: There is a long-long story. OVMF VMs can not be snapsotted using 'virsh snapshot' as they have "pflash" device which is configured as "raw" image. There was a discussion in the past about that. results of the discussion are available in this submiss

Re: [Qemu-block] Minutes from the "Stuttgart block Gipfele"

2016-01-14 Thread Stefan Hajnoczi
On Mon, Jan 11, 2016 at 04:10:12PM +0100, Kevin Wolf wrote: > Am 23.12.2015 um 09:33 hat Stefan Hajnoczi geschrieben: > > On Fri, Dec 18, 2015 at 02:15:38PM +0100, Markus Armbruster wrote: > > Another problem is that the backup block job and other operations that > > require a single command today

Re: [Qemu-block] [Qemu-devel] [PATCH v1 08/15] block: add generic full disk encryption driver

2016-01-14 Thread Daniel P. Berrange
On Wed, Jan 13, 2016 at 04:47:47PM -0700, Eric Blake wrote: > On 01/12/2016 11:56 AM, Daniel P. Berrange wrote: > > Add a block driver that is capable of supporting any full disk > > encryption format. This utilizes the previously added block > > encryption code, and at this time supports the LUKS

Re: [Qemu-block] [Qemu-devel] [PATCH v1 06/15] crypto: implement the LUKS block encryption format

2016-01-14 Thread Daniel P. Berrange
On Wed, Jan 13, 2016 at 04:43:15PM -0700, Eric Blake wrote: > On 01/12/2016 11:56 AM, Daniel P. Berrange wrote: > > Provide a block encryption implementation that follows the > > LUKS/dm-crypt specification. > > > > This supports all combinations of hash, cipher algorithm, > > cipher mode and iv g

[Qemu-block] [PATCH v3 1/3] nbd: Always call "close_fn" in nbd_client_new

2016-01-14 Thread Fam Zheng
Rename the parameter "close" to "close_fn" to disambiguous with close(2). This unifies error handling paths of NBDClient allocation: nbd_client_new will shutdown the socket and call the "close_fn" callback if negotiation failed, so the caller don't need a different path than the normal close. The

[Qemu-block] [PATCH v3 3/3] nbd-server: Coroutine based negotiation

2016-01-14 Thread Fam Zheng
Create a coroutine in nbd_client_new, so that nbd_send_negotiate doesn't need qemu_set_block(). Handlers need to be set temporarily for csock fd in case the coroutine yields during I/O. With this, if the other end disappears in the middle of the negotiation, we don't block the whole event loop.

[Qemu-block] [PATCH v3 2/3] nbd: Split nbd.c

2016-01-14 Thread Fam Zheng
We have NBD server code and client code, all mixed in a file. Now split them into separate files under nbd/, and update MAINTAINERS. filter_nbd for iotest 083 is updated to keep the log filtered out. Signed-off-by: Fam Zheng --- MAINTAINERS | 5 +- Makefile.objs

[Qemu-block] [PATCH v3 0/3] nbd: Async built-in server negotiation

2016-01-14 Thread Fam Zheng
v3: Rework previous patch 2 (fix the busy loop bug and split to two patches). [Paolo] During nbd_send_negotiate, if the client simply doesn't respond, the function will not return, and the whole event loop is blocked. Make the I/O effectively asynchronous by using coroutine read/write, so tha