Re: [Qemu-block] [PATCH v2 2/2] iotests: Test allocate_first_block() with O_DIRECT

2019-08-25 Thread Nir Soffer
On Mon, Aug 26, 2019 at 1:03 AM Nir Soffer wrote: > Using block_resize we can test allocate_first_block() with file > descriptor opened with O_DIRECT, ensuring that it works for any size > larger than 4096 bytes. > > Testing smaller sizes is tricky as the result depends on the filesystem > used

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/2] Optimize alignment probing

2019-08-25 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190825220329.7942-1-nsof...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Subject: [Qemu-devel] [PATCH v2 0/2] Optimize alignment probing Message-id:

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-25 Thread Maxim Levitsky
On Sun, 2019-08-25 at 22:51 +0300, Nir Soffer wrote: > On Sun, Aug 25, 2019 at 10:44 AM Maxim Levitsky wrote: > > On Sat, 2019-08-17 at 00:21 +0300, Nir Soffer wrote: > > > When creating an image with preallocation "off" or "falloc", the first > > > block of the image is typically not allocated.

[Qemu-block] [PATCH v2 2/2] iotests: Test allocate_first_block() with O_DIRECT

2019-08-25 Thread Nir Soffer
Using block_resize we can test allocate_first_block() with file descriptor opened with O_DIRECT, ensuring that it works for any size larger than 4096 bytes. Testing smaller sizes is tricky as the result depends on the filesystem used for testing. For example on NFS any size will work since

[Qemu-block] [PATCH v2 0/2] Optimize alignment probing

2019-08-25 Thread Nir Soffer
When probing unallocated area on XFS filesystem we cannot detect request alignment and we fallback to safe value which may not be optimal. Avoid this fallback by always allocating the first block when creating a new image or resizing empty image. I tested v1 only with -raw format, and missed some

[Qemu-block] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-25 Thread Nir Soffer
When creating an image with preallocation "off" or "falloc", the first block of the image is typically not allocated. When using Gluster storage backed by XFS filesystem, reading this block using direct I/O succeeds regardless of request length, fooling alignment detection. In this case we

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-25 Thread Nir Soffer
On Sun, Aug 25, 2019 at 10:44 AM Maxim Levitsky wrote: > On Sat, 2019-08-17 at 00:21 +0300, Nir Soffer wrote: > > When creating an image with preallocation "off" or "falloc", the first > > block of the image is typically not allocated. When using Gluster > > storage backed by XFS filesystem,

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] qcrypto-luks: clear the masterkey and password before freeing them always

2019-08-25 Thread Maxim Levitsky
On Sun, 2019-08-25 at 18:31 +0300, Maxim Levitsky wrote: > On Thu, 2019-08-22 at 13:56 +0300, Maxim Levitsky wrote: > > On Thu, 2019-08-22 at 11:49 +0100, Daniel P. Berrangé wrote: > > > On Tue, Aug 20, 2019 at 08:12:51PM +0200, Max Reitz wrote: > > > > On 14.08.19 22:22, Maxim Levitsky wrote: > >

Re: [Qemu-block] [Qemu-devel] [PATCH 00/13] RFC: luks/encrypted qcow2 key management

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 12:35 +0100, Daniel P. Berrangé wrote: > On Wed, Aug 14, 2019 at 11:22:06PM +0300, Maxim Levitsky wrote: > > Hi! > > > > This patch series implements key management for luks based encryption > > It supports both raw luks images and qcow2 encrypted images. > > > > Bugzilla:

Re: [Qemu-block] [Qemu-devel] [PATCH 12/13] qemu-img: implement key management

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 16:42 +0200, Max Reitz wrote: > On 22.08.19 13:32, Daniel P. Berrangé wrote: > > On Tue, Aug 20, 2019 at 08:29:55PM +0200, Max Reitz wrote: > > > On 14.08.19 22:22, Maxim Levitsky wrote: > > > > Signed-off-by: Maxim Levitsky > > > > --- > > > > block/crypto.c | 16 ++

Re: [Qemu-block] [Qemu-devel] [PATCH 09/13] qcrypto-luks: implement the encryption key management

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 12:27 +0100, Daniel P. Berrangé wrote: > On Wed, Aug 14, 2019 at 11:22:15PM +0300, Maxim Levitsky wrote: > > Signed-off-by: Maxim Levitsky > > --- > > crypto/block-luks.c | 374 +++- > > 1 file changed, 373 insertions(+), 1

Re: [Qemu-block] [Qemu-devel] [PATCH 07/13] block: add manage-encryption command (qmp and blockdev)

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 16:07 +0200, Markus Armbruster wrote: > Maxim Levitsky writes: > > > On Wed, 2019-08-21 at 13:47 +0200, Markus Armbruster wrote: > > > Maxim Levitsky writes: > > > > > > > This adds: > > > > > > > > * x-blockdev-update-encryption and x-blockdev-erase-encryption qmp > >

Re: [Qemu-block] [Qemu-devel] [PATCH 06/13] qcrypto-luks: implement more rigorous header checking

2019-08-25 Thread Maxim Levitsky
On Sun, 2019-08-25 at 18:40 +0300, Maxim Levitsky wrote: > On Thu, 2019-08-22 at 12:04 +0100, Daniel P. Berrangé wrote: > > On Wed, Aug 14, 2019 at 11:22:12PM +0300, Maxim Levitsky wrote: > > > Check that keyslots don't overlap with the data, > > > and check that keyslots don't overlap with each

Re: [Qemu-block] [Qemu-devel] [PATCH 06/13] qcrypto-luks: implement more rigorous header checking

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 12:04 +0100, Daniel P. Berrangé wrote: > On Wed, Aug 14, 2019 at 11:22:12PM +0300, Maxim Levitsky wrote: > > Check that keyslots don't overlap with the data, > > and check that keyslots don't overlap with each other. > > (this is done using naive O(n^2) nested loops, > > but

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] qcrypto-luks: clear the masterkey and password before freeing them always

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 13:56 +0300, Maxim Levitsky wrote: > On Thu, 2019-08-22 at 11:49 +0100, Daniel P. Berrangé wrote: > > On Tue, Aug 20, 2019 at 08:12:51PM +0200, Max Reitz wrote: > > > On 14.08.19 22:22, Maxim Levitsky wrote: > > > > While there are other places where these are still stored in

Re: [Qemu-block] [PATCH v5 1/6] iotests: allow Valgrind checking all QEMU processes

2019-08-25 Thread Andrey Shinkevich
On 16/08/2019 01:49, John Snow wrote: > > > On 7/19/19 12:30 PM, Andrey Shinkevich wrote: >> With the '-valgrind' option, let all the QEMU processes be run under >> the Valgrind tool. The Valgrind own parameters may be set with its >> environment variable VALGRIND_OPTS, e.g. >>

Re: [Qemu-block] [PATCH v5 4/6] iotests: Valgrind fails with nonexistent directory

2019-08-25 Thread Andrey Shinkevich
On 16/08/2019 03:55, John Snow wrote: > > > On 7/19/19 12:30 PM, Andrey Shinkevich wrote: >> The Valgrind uses the exported variable TMPDIR and fails if the >> directory does not exist. Let us exclude such a test case from >> being run under the Valgrind and notify the user of it. >> >>

Re: [Qemu-block] [PATCH 04/13] qcrypto-luks: refactoring: simplify the math used for keyslot locations

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 11:47 +0100, Daniel P. Berrangé wrote: > On Wed, Aug 14, 2019 at 11:22:10PM +0300, Maxim Levitsky wrote: > > Signed-off-by: Maxim Levitsky > > --- > > crypto/block-luks.c | 64 +++-- > > 1 file changed, 38 insertions(+), 26

Re: [Qemu-block] [Qemu-devel] [PATCH 03/13] qcrypto-luks: refactoring: extract load/store/check/parse header functions

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 11:34 +0100, Daniel P. Berrangé wrote: > On Thu, Aug 22, 2019 at 01:43:05AM +0300, Maxim Levitsky wrote: > > On Tue, 2019-08-20 at 20:01 +0200, Max Reitz wrote: > > > On 14.08.19 22:22, Maxim Levitsky wrote: > > > > With upcoming key management, the header will > > > > need

Re: [Qemu-block] [Qemu-devel] [PATCH 03/13] qcrypto-luks: refactoring: extract load/store/check/parse header functions

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 11:38 +0100, Daniel P. Berrangé wrote: > On Wed, Aug 14, 2019 at 11:22:09PM +0300, Maxim Levitsky wrote: > > With upcoming key management, the header will > > need to be stored after the image is created. > > > > Extracting load header isn't strictly needed, but > > do this

Re: [Qemu-block] [Qemu-devel] [QEMU] [PATCH v5 5/8] bootdevice: Gather LCHS from all relevant devices

2019-08-25 Thread Sam Eiderman via Qemu-block
> Only scsi-hd has the lchs properties, though, so what’s the purpose of > defining the unrealize function for all other classes? > > Max - shmuel.eider...@oracle.com + sam...@google.com The only purpose is to already have them mapped to the correct existing function, in case it will be used

Re: [Qemu-block] [Qemu-devel] [QEMU] [PATCH v5 4/8] scsi: Propagate unrealize() callback to scsi-hd

2019-08-25 Thread Sam Eiderman via Qemu-block
> @@ -213,11 +221,18 @@ static void scsi_qdev_realize(DeviceState *qdev, Error > **errp) > static void scsi_qdev_unrealize(DeviceState *qdev, Error **errp) > { > SCSIDevice *dev = SCSI_DEVICE(qdev); > +Error *local_err = NULL; > > if (dev->vmsentry) { >

Re: [Qemu-block] [PATCH v5 3/6] iotests: Add casenotrun report to bash tests

2019-08-25 Thread Andrey Shinkevich
On 16/08/2019 23:33, Cleber Rosa wrote: > On Thu, Aug 15, 2019 at 08:44:11PM -0400, John Snow wrote: >> >> >> On 7/19/19 12:30 PM, Andrey Shinkevich wrote: >>> The new function _casenotrun() is to be invoked if a test case cannot >>> be run for some reason. The user will be notified by a message

Re: [Qemu-block] [Qemu-devel] [PATCH 02/13] qcrypto-luks: misc refactoring

2019-08-25 Thread Maxim Levitsky
On Thu, 2019-08-22 at 16:32 +0200, Max Reitz wrote: > On 22.08.19 01:59, Maxim Levitsky wrote: > > On Tue, 2019-08-20 at 19:36 +0200, Max Reitz wrote: > > > On 14.08.19 22:22, Maxim Levitsky wrote: > > > > This is also a preparation for key read/write/erase functions > > > > > > > > * use master

Re: [Qemu-block] [Qemu-devel] [PATCH v5 0/6] Allow Valgrind checking all QEMU processes

2019-08-25 Thread Andrey Shinkevich
On 16/08/2019 23:05, Cleber Rosa wrote: > On Fri, Jul 19, 2019 at 07:30:10PM +0300, Andrey Shinkevich wrote: >> In the current implementation of the QEMU bash iotests, only qemu-io >> processes may be run under the Valgrind, which is a useful tool for >> finding memory usage issues. Let's allow

Re: [Qemu-block] [PATCH v5 6/6] iotests: extend sleeping time under Valgrind

2019-08-25 Thread Andrey Shinkevich
On 16/08/2019 04:01, John Snow wrote: > > > On 7/19/19 12:30 PM, Andrey Shinkevich wrote: >> To synchronize the time when QEMU is running longer under the Valgrind, >> increase the sleeping time in the test 247. >> >> Signed-off-by: Andrey Shinkevich >> Reviewed-by: Vladimir Sementsov-Ogievskiy

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-25 Thread Maxim Levitsky
On Sat, 2019-08-17 at 00:21 +0300, Nir Soffer wrote: > When creating an image with preallocation "off" or "falloc", the first > block of the image is typically not allocated. When using Gluster > storage backed by XFS filesystem, reading this block using direct I/O > succeeds regardless of request

[Qemu-block] [PATCH 1/2] block/nvme: add support for write zeros

2019-08-25 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- block/nvme.c | 72 +++- block/trace-events | 1 + include/block/nvme.h | 19 +++- 3 files changed, 90 insertions(+), 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 5be3a39b63..f8bd11e19a

[Qemu-block] [PATCH 2/2] block/nvme: add support for discard

2019-08-25 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- block/nvme.c | 83 ++ block/trace-events | 2 ++ 2 files changed, 85 insertions(+) diff --git a/block/nvme.c b/block/nvme.c index f8bd11e19a..dd041f39c9 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -112,6

[Qemu-block] [PATCH 0/2] block/nvme: add support for write zeros and discard

2019-08-25 Thread Maxim Levitsky
This is the second part of the patches I prepared for this driver back when I worked on mdev-nvme. Best regards, Maxim Levitsky Maxim Levitsky (2): block/nvme: add support for write zeros block/nvme: add support for discard block/nvme.c | 155