Re: [Qemu-block] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not ""

2018-03-21 Thread Thomas Huth
On 20.03.2018 13:05, Michael S. Tsirkin wrote: > On Tue, Mar 20, 2018 at 09:58:23AM +0100, Laurent Vivier wrote: >> Le 20/03/2018 à 02:54, Michael S. Tsirkin a écrit : >>> QEMU coding style at the moment asks for all non-system >>> include files to be used with #include "foo.h". >>> However this ru

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Alberto Garcia
On Tue 20 Mar 2018 06:54:15 PM CET, Eric Blake wrote: >> When we try to allocate new clusters we first look for available ones >> starting from s->free_cluster_index and once we find them we increase >> their reference counts. Before we get to call update_refcount() to do >> this last step s->free

Re: [Qemu-block] [PATCH for-2.12 05/12] luks: Turn another invalid assertion into check

2018-03-21 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 06:36:25PM +0100, Kevin Wolf wrote: > Commit e39e959e fixed an invalid assertion in the .bdrv_length > implementation, but left a similar assertion in place for > .bdrv_truncate. Instead of crashing when the user requests a too large > image size, fail gracefully. > > A fil

Re: [Qemu-block] [PATCH for-2.12 04/12] qemu-iotests: Enable 025 for luks

2018-03-21 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 06:36:24PM +0100, Kevin Wolf wrote: > We want to test resizing even for luks. The only change that is needed > is to explicitly zero out new space for luks because it's undefined. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/025 | 9 - > 1 file changed

Re: [Qemu-block] [PATCH for-2.12 06/12] qemu-iotests: Test invalid resize on luks

2018-03-21 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 06:36:26PM +0100, Kevin Wolf wrote: > This tests that the .bdrv_truncate implementation for luks doesn't crash > for invalid image sizes. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/210 | 37 + > 1 file changed, 37 insertio

[Qemu-block] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Paolo Bonzini
If the user does not have permissions to send ioctls to the device (due to SELinux or cgroups, for example), the output can look like qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: Operation not permitted. Is this a SCSI device? but this is confusing because the ioct

Re: [Qemu-block] [Qemu-devel] [PATCH v3 15/16] block/mirror: Add copy mode QAPI interface

2018-03-21 Thread Max Reitz
On 2018-03-20 18:35, Eric Blake wrote: > On 02/28/2018 12:05 PM, Max Reitz wrote: >> This patch allows the user to specify whether to use active or only >> background mode for mirror block jobs.  Currently, this setting will >> remain constant for the duration of the entire block job. >> >> Signed-

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Laurent Vivier
On 21/03/2018 11:58, Paolo Bonzini wrote: > If the user does not have permissions to send ioctls to the device (due to > SELinux or cgroups, for example), the output can look like > > qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: > Operation not permitted. Is this a

[Qemu-block] [PATCH 1/4] nbd/server: refactor nbd_negotiate_meta_query for several namespaces

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 60 +++- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index cea158913b..b830997114 100644 --- a/nbd/server.c +++ b/nbd/server.c @@

[Qemu-block] [PATCH 2/4] nbd/server: add nbd_meta_single_query helper

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
The helper will be reused for bitmaps namespace. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index b830997114..8fe53ffd4b 100644 --- a/nbd/

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Paolo Bonzini
On 21/03/2018 13:17, Laurent Vivier wrote: > On 21/03/2018 11:58, Paolo Bonzini wrote: >> If the user does not have permissions to send ioctls to the device (due to >> SELinux or cgroups, for example), the output can look like >> >> qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version

[Qemu-block] [PATCH for-2.13 0/4] NBD export bitmaps

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Hi all. This is a proposal and realization of new NBD meta context: qemu-dirty-bitmap. (I'll send corresponding proposal to NBD protocol after some negotiation here) Corresponding queries will look like: qemu-dirty-bitmap: Mapping from export-bitmap-name to BdrvDirtyBitmap is done through qmp co

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Eric Blake
On 03/21/2018 05:58 AM, Paolo Bonzini wrote: If the user does not have permissions to send ioctls to the device (due to SELinux or cgroups, for example), the output can look like qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: Operation not permitted. Is this a SCSI

[Qemu-block] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block.json | 27 +++ blockdev-nbd.c | 23 +++ 2 files changed, 50 insertions(+) diff --git a/qapi/block.json b/qapi/block.json index c694524002..4afbbcd7b7 100644 --- a/qapi/block.json +++ b/qapi/bl

[Qemu-block] [PATCH 3/4] nbd/server: implement dirty bitmap export

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 2 + nbd/server.c| 207 ++-- 2 files changed, 203 insertions(+), 6 deletions(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index fcdcd54502..f0b459283f 1006

[Qemu-block] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Paolo Bonzini
If the user does not have permissions to send ioctls to the device (due to SELinux or cgroups, for example), the output can look like qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: Operation not permitted. Is this a SCSI device? but this is confusing because the ioct

Re: [Qemu-block] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Laurent Vivier
On 21/03/2018 13:54, Paolo Bonzini wrote: > If the user does not have permissions to send ioctls to the device (due to > SELinux or cgroups, for example), the output can look like > > qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: > Operation not permitted. Is this a

Re: [Qemu-block] [PATCH for-2.12 09/12] vhdx: Require power-of-two block size on create

2018-03-21 Thread Jeff Cody
On Tue, Mar 20, 2018 at 06:36:29PM +0100, Kevin Wolf wrote: > Images with a non-power-of-two block size are invalid and cannot be > opened. Reject such block sizes when creating an image. > Good catch. Reviewed-by: Jeff Cody > Signed-off-by: Kevin Wolf > --- > block/vhdx.c | 4 > 1 fil

Re: [Qemu-block] [PATCH for-2.12 10/12] vhdx: Don't use error_setg_errno() with constant errno

2018-03-21 Thread Jeff Cody
On Tue, Mar 20, 2018 at 06:36:30PM +0100, Kevin Wolf wrote: > error_setg_errno() is meant for cases where we got an errno from the OS > that can add useful extra information to an error message. It's > pointless if we pass a constant errno, these cases should use plain > error_setg(). > > Signed-o

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Eric Blake
On 03/21/2018 04:28 AM, Alberto Garcia wrote: On Tue 20 Mar 2018 06:54:15 PM CET, Eric Blake wrote: When we try to allocate new clusters we first look for available ones starting from s->free_cluster_index and once we find them we increase their reference counts. Before we get to call update_re

Re: [Qemu-block] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not ""

2018-03-21 Thread Michael S. Tsirkin
On Wed, Mar 21, 2018 at 08:16:00AM +0100, Thomas Huth wrote: > On 20.03.2018 13:05, Michael S. Tsirkin wrote: > > On Tue, Mar 20, 2018 at 09:58:23AM +0100, Laurent Vivier wrote: > >> Le 20/03/2018 à 02:54, Michael S. Tsirkin a écrit : > >>> QEMU coding style at the moment asks for all non-system >

Re: [Qemu-block] [PATCH for-2.12 11/12] vhdx: Check for 4 GB maximum log size on creation

2018-03-21 Thread Jeff Cody
On Tue, Mar 20, 2018 at 06:36:31PM +0100, Kevin Wolf wrote: > It's unclear what the real maximum is, but we use an uint32_t to store > the log size in vhdx_co_create(), so we should check that the given > value fits in 32 bits. > It's a uint32 in the on-disk header per spec, so I agree the implie

Re: [Qemu-block] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not ""

2018-03-21 Thread Stefan Weil
Am 21.03.2018 um 14:08 schrieb Michael S. Tsirkin: > It still leaves us with a host of problems e.g. the problem of stale > headers in the source directory. There have already been suggestions in the past to forbid in-tree builds. Would it help if configure would refuse to run from the root source

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Alberto Garcia
On Wed 21 Mar 2018 02:08:23 PM CET, Eric Blake wrote: >> - This scenario is harder to reach: in order to fill a 1-cluster >> refcount table the size of the image needs to be larger than >> (cluster_size³ / refcount_bits) bytes, that's 16TB with the default >> parameters. So although it can

Re: [Qemu-block] [PATCH v4 for 2.12 0/3] fix bitmaps migration through shared storage

2018-03-21 Thread Max Reitz
On 2018-03-20 18:05, Vladimir Sementsov-Ogievskiy wrote: > Hi all. > > This fixes bitmaps migration through shared storage. Look at 02 for > details. > > The bug introduced in 2.10 with the whole qcow2 bitmaps feature, so > qemu-stable in CC. However I doubt that someone really suffered from this

Re: [Qemu-block] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not ""

2018-03-21 Thread Michael S. Tsirkin
On Wed, Mar 21, 2018 at 02:15:20PM +0100, Stefan Weil wrote: > Am 21.03.2018 um 14:08 schrieb Michael S. Tsirkin: > > It still leaves us with a host of problems e.g. the problem of stale > > headers in the source directory. > > There have already been suggestions in the past to forbid in-tree > bu

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Eric Blake
On 03/20/2018 08:55 AM, Alberto Garcia wrote: When we try to allocate new clusters we first look for available ones starting from s->free_cluster_index and once we find them we increase their reference counts. Before we get to call update_refcount() to do this last step s->free_cluster_index is a

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Eric Blake
On 03/21/2018 08:30 AM, Eric Blake wrote: On 03/20/2018 08:55 AM, Alberto Garcia wrote: This can be reproduced easily:   qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 1M   qemu-io -c 'write 0 124k' hd.qcow2 This reproduction fails if you use non-default refcount_order... +

Re: [Qemu-block] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not ""

2018-03-21 Thread Daniel P . Berrangé
On Wed, Mar 21, 2018 at 03:08:36PM +0200, Michael S. Tsirkin wrote: > On Wed, Mar 21, 2018 at 08:16:00AM +0100, Thomas Huth wrote: > > On 20.03.2018 13:05, Michael S. Tsirkin wrote: > > > On Tue, Mar 20, 2018 at 09:58:23AM +0100, Laurent Vivier wrote: > > >> Le 20/03/2018 à 02:54, Michael S. Tsirki

[Qemu-block] [PATCH for-2.12 v2] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Alberto Garcia
When we try to allocate new clusters we first look for available ones starting from s->free_cluster_index and once we find them we increase their reference counts. Before we get to call update_refcount() to do this last step s->free_cluster_index is already pointing to the next cluster after the on

Re: [Qemu-block] [Libguestfs] [PATCH] tests: regressions: make test-big-heap use a temporary empty file

2018-03-21 Thread Eric Blake
[adding qemu lists] On 03/21/2018 07:51 AM, Richard W.M. Jones wrote: On Wed, Mar 21, 2018 at 01:44:17PM +0100, Pino Toscano wrote: Newer versions of qemu use file locking for the images by default, and apparently that does not work with /dev/null. Since this test just calls qemu-img to get th

Re: [Qemu-block] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not ""

2018-03-21 Thread Michael S. Tsirkin
On Wed, Mar 21, 2018 at 01:29:53PM +, Daniel P. Berrangé wrote: > On Wed, Mar 21, 2018 at 03:08:36PM +0200, Michael S. Tsirkin wrote: > > On Wed, Mar 21, 2018 at 08:16:00AM +0100, Thomas Huth wrote: > > > On 20.03.2018 13:05, Michael S. Tsirkin wrote: > > > > On Tue, Mar 20, 2018 at 09:58:23AM

Re: [Qemu-block] [Libguestfs] [PATCH] tests: regressions: make test-big-heap use a temporary empty file

2018-03-21 Thread Pino Toscano
On Wednesday, 21 March 2018 14:45:38 CET Eric Blake wrote: > [adding qemu lists] > > On 03/21/2018 07:51 AM, Richard W.M. Jones wrote: > > On Wed, Mar 21, 2018 at 01:44:17PM +0100, Pino Toscano wrote: > >> Newer versions of qemu use file locking for the images by default, and > >> apparently that

Re: [Qemu-block] [PATCH for-2.12 v2] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 14:38 hat Alberto Garcia geschrieben: > This can be reproduced easily: > > qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 1M > qemu-io -c 'write 0 124k' hd.qcow2 > > After this the image has 132608 bytes (256 clusters), and the refcount > block is full. If we wri

Re: [Qemu-block] [PATCH for-2.12 v2] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Alberto Garcia
On Wed 21 Mar 2018 02:52:38 PM CET, Kevin Wolf wrote: >> qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 1M >> qemu-io -c 'write 0 124k' hd.qcow2 >> qemu-io -c 'write 124k 512' hd.qcow2 > > So if I understand correctly, this is what we get: > > 0x2: free > 0x20200: refcoun

[Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Michael S. Tsirkin
Our current scheme is to use #include "" for internal headers, and #include <> for external ones. Unfortunately this is not based on compiler support: from C point of view, the "" form merely looks up headers in the current directory and then falls back on <> directories. Thus, for example, a s

Re: [Qemu-block] [PATCH 1/4] nbd/server: refactor nbd_negotiate_meta_query for several namespaces

2018-03-21 Thread Eric Blake
[adding NBD list] On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 60 +++- 1 file changed, 43 insertions(+), 17 deletions(-) +struct { +const char *ns; +

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Paolo Bonzini
On 21/03/2018 15:46, Michael S. Tsirkin wrote: > +if (m@^\s*#include\s+"qemu/@o) { > +s@^(\s*#include\s+)"qemu/([^"]+)"(.*)$@$1$3@o) { > +} else { > +s@^(\s*#include\s+)"([^"]+)"(.*)$@$1$3@o) { > +} Can you explain the changes in the source tree layout? Also, s{}{} and m{} are a bit more

Re: [Qemu-block] [PATCH 2/4] nbd/server: add nbd_meta_single_query helper

2018-03-21 Thread Eric Blake
On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: The helper will be reused for bitmaps namespace. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) +/* Read len bytes a

Re: [Qemu-block] [PATCH for-2.12 v2] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 15:10 hat Alberto Garcia geschrieben: > On Wed 21 Mar 2018 02:52:38 PM CET, Kevin Wolf wrote: > > >> qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 1M > >> qemu-io -c 'write 0 124k' hd.qcow2 > >> qemu-io -c 'write 124k 512' hd.qcow2 > > > > So if I understand

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Michael S. Tsirkin
On Wed, Mar 21, 2018 at 04:04:29PM +0100, Paolo Bonzini wrote: > On 21/03/2018 15:46, Michael S. Tsirkin wrote: > > +if (m@^\s*#include\s+"qemu/@o) { > > +s@^(\s*#include\s+)"qemu/([^"]+)"(.*)$@$1$3@o) { > > +} else { > > +s@^(\s*#include\s+)"([^"]+)"(.*)$@$1$3@o) { > > +} > > Can you expl

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Daniel P . Berrangé
On Wed, Mar 21, 2018 at 04:46:32PM +0200, Michael S. Tsirkin wrote: > Our current scheme is to use > #include "" > for internal headers, and > #include <> > for external ones. > > Unfortunately this is not based on compiler support: from C point of > view, the "" form merely looks up headers in

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Paolo Bonzini
On 21/03/2018 16:11, Michael S. Tsirkin wrote: >> Can you explain the changes in the source tree layout? > include/qemu -> include/qemu/common > include/* -> include/qemu/* Ok, then perhaps "util" instead of common would match the source layout more. Paolo > Thus one uses any qemu headers with >

[Qemu-block] [PATCH] block: drop moderated sheepdog mailing list from MAINTAINERS file

2018-03-21 Thread Daniel P . Berrangé
The sheepdog mailing list is setup to stop and queue messages from non-subscribers, pending moderator approval. Unfortunately it seems that the moderation queue is not actively dealt with. Even when messages are approved, the sender is never added to the whitelist, so every future mail the same sen

Re: [Qemu-block] [PATCH for-2.12 v2] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Alberto Garcia
On Wed 21 Mar 2018 04:07:28 PM CET, Kevin Wolf wrote: > I just remembered that when I looked at an image recently, I noticed > that the refcount block wasn't in the first cluster and I disliked it, > though mostly because it felt untidy rather than being a problem. I don't think you can fix that i

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 15:46 hat Michael S. Tsirkin geschrieben: > Our current scheme is to use > #include "" > for internal headers, and > #include <> > for external ones. > > Unfortunately this is not based on compiler support: from C point of > view, the "" form merely looks up headers in the curre

Re: [Qemu-block] [PATCH] block: drop moderated sheepdog mailing list from MAINTAINERS file

2018-03-21 Thread Jeff Cody
On Wed, Mar 21, 2018 at 03:31:24PM +, Daniel P. Berrangé wrote: > The sheepdog mailing list is setup to stop and queue messages from > non-subscribers, pending moderator approval. Unfortunately it seems > that the moderation queue is not actively dealt with. Even when messages > are approved, t

Re: [Qemu-block] [PATCH for-2.12 v2] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 16:32 hat Alberto Garcia geschrieben: > On Wed 21 Mar 2018 04:07:28 PM CET, Kevin Wolf wrote: > > I just remembered that when I looked at an image recently, I noticed > > that the refcount block wasn't in the first cluster and I disliked it, > > though mostly because it felt untidy

Re: [Qemu-block] [Qemu-devel] [PATCH] block: drop moderated sheepdog mailing list from MAINTAINERS file

2018-03-21 Thread Eric Blake
On 03/21/2018 10:31 AM, Daniel P. Berrangé wrote: The sheepdog mailing list is setup to stop and queue messages from non-subscribers, pending moderator approval. Unfortunately it seems that the moderation queue is not actively dealt with. Even when messages are approved, the sender is never added

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Michael S. Tsirkin
On Wed, Mar 21, 2018 at 03:19:22PM +, Daniel P. Berrangé wrote: > On Wed, Mar 21, 2018 at 04:46:32PM +0200, Michael S. Tsirkin wrote: > > Our current scheme is to use > > #include "" > > for internal headers, and > > #include <> > > for external ones. > > > > Unfortunately this is not based

Re: [Qemu-block] [Qemu-devel] [PATCH] block: drop moderated sheepdog mailing list from MAINTAINERS file

2018-03-21 Thread Daniel P . Berrangé
On Wed, Mar 21, 2018 at 10:42:57AM -0500, Eric Blake wrote: > On 03/21/2018 10:31 AM, Daniel P. Berrangé wrote: > > The sheepdog mailing list is setup to stop and queue messages from > > non-subscribers, pending moderator approval. Unfortunately it seems > > that the moderation queue is not activel

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Daniel P . Berrangé
On Wed, Mar 21, 2018 at 05:39:48PM +0200, Michael S. Tsirkin wrote: > On Wed, Mar 21, 2018 at 03:19:22PM +, Daniel P. Berrangé wrote: > > On Wed, Mar 21, 2018 at 04:46:32PM +0200, Michael S. Tsirkin wrote: > > > Our current scheme is to use > > > #include "" > > > for internal headers, and > >

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Michael S. Tsirkin
On Wed, Mar 21, 2018 at 04:34:39PM +0100, Kevin Wolf wrote: > Am 21.03.2018 um 15:46 hat Michael S. Tsirkin geschrieben: > > Our current scheme is to use > > #include "" > > for internal headers, and > > #include <> > > for external ones. > > > > Unfortunately this is not based on compiler suppo

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 16:58 hat Michael S. Tsirkin geschrieben: > On Wed, Mar 21, 2018 at 04:34:39PM +0100, Kevin Wolf wrote: > > Am 21.03.2018 um 15:46 hat Michael S. Tsirkin geschrieben: > > > Our current scheme is to use > > > #include "" > > > for internal headers, and > > > #include <> > > > for

Re: [Qemu-block] [PATCH 3/4] nbd/server: implement dirty bitmap export

2018-03-21 Thread Eric Blake
On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy Rather sparse on the details in the commit message; I had to read the patch to even learn what the new namespace is. --- include/block/nbd.h | 2 + nbd/server.c| 207 +++

Re: [Qemu-block] [PATCH for-2.12 08/12] qemu-iotests: Test parallels image creation with QMP

2018-03-21 Thread Kevin Wolf
Am 20.03.2018 um 19:42 hat Eric Blake geschrieben: > On 03/20/2018 12:36 PM, Kevin Wolf wrote: > > Signed-off-by: Kevin Wolf > > --- > > tests/qemu-iotests/212 | 326 > > + > > tests/qemu-iotests/212.out | 111 +++ > > tests/qemu-iot

Re: [Qemu-block] [PATCH 1/4] nbd/server: refactor nbd_negotiate_meta_query for several namespaces

2018-03-21 Thread Wouter Verhelst
On Wed, Mar 21, 2018 at 09:56:36AM -0500, Eric Blake wrote: > no further qemu patches are submitted. Is it worth me proposing a doc > change to demonstrate what the difference would look like, along with > corresponding qemu changes to match, to decide if including it in 2.12 is > worth it? If yo

Re: [Qemu-block] [PATCH for-2.12 06/12] qemu-iotests: Test invalid resize on luks

2018-03-21 Thread Kevin Wolf
Am 20.03.2018 um 19:33 hat Eric Blake geschrieben: > On 03/20/2018 12:36 PM, Kevin Wolf wrote: > > This tests that the .bdrv_truncate implementation for luks doesn't crash > > for invalid image sizes. > > > > Signed-off-by: Kevin Wolf > > --- > > tests/qemu-iotests/210 | 37

Re: [Qemu-block] [PATCH for-2.12 12/12] qemu-iotests: Test vhdx image creation with QMP

2018-03-21 Thread Kevin Wolf
Am 20.03.2018 um 19:53 hat Eric Blake geschrieben: > On 03/20/2018 12:36 PM, Kevin Wolf wrote: > > Signed-off-by: Kevin Wolf > > --- > > tests/qemu-iotests/213 | 349 > > + > > tests/qemu-iotests/213.out | 121 > > tests/qemu-io

Re: [Qemu-block] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap

2018-03-21 Thread Eric Blake
On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block.json | 27 +++ blockdev-nbd.c | 23 +++ 2 files changed, 50 insertions(+) diff --git a/qapi/block.json b/qapi/block.json index

[Qemu-block] [PATCH for-2.12 v2 00/12] block: Follow-up for .bdrv_co_create (part 1)

2018-03-21 Thread Kevin Wolf
This series adds qemu-iotests for a few more block drivers (yet more to come in another series) and fixes a few things that previous review and these tests brought up. The only major design change is that I converted the vdi block driver from a boolean 'static' create option to the standard 'preal

[Qemu-block] [PATCH for-2.12 v2 01/12] vdi: Change 'static' create option to 'preallocation' in QMP

2018-03-21 Thread Kevin Wolf
What static=on really does is what we call metadata preallocation for other block drivers. While we can still change the QMP interface, make it more consistent by using 'preallocation' for VDI, too. This doesn't implement any new functionality, so the only supported preallocation modes are 'off' a

[Qemu-block] [PATCH for-2.12 v2 02/12] vdi: Fix build with CONFIG_VDI_DEBUG

2018-03-21 Thread Kevin Wolf
Use qemu_uuid_unparse() instead of uuid_unparse() to make vdi.c compile again when CONFIG_VDI_DEBUG is set. In order to prevent future bitrot, replace '#ifdef CONFIG_VDI_DEBUG' by 'if (VDI_DEBUG)' so that the compiler always sees the code. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- b

[Qemu-block] [PATCH for-2.12 v2 06/12] qemu-iotests: Test invalid resize on luks

2018-03-21 Thread Kevin Wolf
This tests that the .bdrv_truncate implementation for luks doesn't crash for invalid image sizes. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/210 | 37 + tests/qemu-iotests/210.out | 16 2 files changed, 53 insertions(+) diff --git a

[Qemu-block] [PATCH for-2.12 v2 09/12] vhdx: Require power-of-two block size on create

2018-03-21 Thread Kevin Wolf
Images with a non-power-of-two block size are invalid and cannot be opened. Reject such block sizes when creating an image. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Jeff Cody --- block/vhdx.c | 4 1 file changed, 4 insertions(+) diff --git a/block/vhdx.c b/block/vhd

[Qemu-block] [PATCH for-2.12 v2 10/12] vhdx: Don't use error_setg_errno() with constant errno

2018-03-21 Thread Kevin Wolf
error_setg_errno() is meant for cases where we got an errno from the OS that can add useful extra information to an error message. It's pointless if we pass a constant errno, these cases should use plain error_setg(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Jeff Cody ---

[Qemu-block] [PATCH for-2.12 v2 08/12] qemu-iotests: Test parallels image creation with QMP

2018-03-21 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/212 | 326 + tests/qemu-iotests/212.out | 111 +++ tests/qemu-iotests/group | 1 + 3 files changed, 438 insertions(+) create mode 100755 tests/qemu-iotests/212 create mode 100644 tes

[Qemu-block] [PATCH for-2.12 v2 03/12] qemu-iotests: Test vdi image creation with QMP

2018-03-21 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/211 | 246 + tests/qemu-iotests/211.out | 97 ++ tests/qemu-iotests/group | 1 + 3 files changed, 344 insertions(+) create mode 100755 tests/qemu-iotests/211 create mode 100644

[Qemu-block] [PATCH for-2.12 v2 05/12] luks: Turn another invalid assertion into check

2018-03-21 Thread Kevin Wolf
Commit e39e959e fixed an invalid assertion in the .bdrv_length implementation, but left a similar assertion in place for .bdrv_truncate. Instead of crashing when the user requests a too large image size, fail gracefully. A file size of exactly INT64_MAX caused failure before, but is actually legal

[Qemu-block] [PATCH for-2.12 v2 04/12] qemu-iotests: Enable 025 for luks

2018-03-21 Thread Kevin Wolf
We want to test resizing even for luks. The only change that is needed is to explicitly zero out new space for luks because it's undefined. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Daniel P. Berrangé --- tests/qemu-iotests/025 | 9 - 1 file changed, 8 insertions(+

Re: [Qemu-block] [PATCH for-2.12 v2 01/12] vdi: Change 'static' create option to 'preallocation' in QMP

2018-03-21 Thread Eric Blake
On 03/21/2018 12:37 PM, Kevin Wolf wrote: What static=on really does is what we call metadata preallocation for other block drivers. While we can still change the QMP interface, make it more consistent by using 'preallocation' for VDI, too. This doesn't implement any new functionality, so the on

[Qemu-block] [PATCH for-2.12 v2 07/12] parallels: Check maximum cluster size on create

2018-03-21 Thread Kevin Wolf
It's unclear what the real maximum cluster size is for the Parallels format, but let's at least make sure that we don't get integer overflows in our .bdrv_co_create implementation. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/parallels.c | 5 + 1 file changed, 5 insertions(+)

[Qemu-block] [PATCH for-2.12 v2 12/12] qemu-iotests: Test vhdx image creation with QMP

2018-03-21 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/213 | 349 + tests/qemu-iotests/213.out | 121 tests/qemu-iotests/group | 1 + 3 files changed, 471 insertions(+) create mode 100755 tests/qemu-iotests/213 create mode 100644 te

[Qemu-block] [PATCH for-2.12 v2 11/12] vhdx: Check for 4 GB maximum log size on creation

2018-03-21 Thread Kevin Wolf
It's unclear what the real maximum is, but we use an uint32_t to store the log size in vhdx_co_create(), so we should check that the given value fits in 32 bits. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Jeff Cody --- block/vhdx.c | 4 1 file changed, 4 insertions(+)

Re: [Qemu-block] [PATCH for-2.12 v2] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 14:38 hat Alberto Garcia geschrieben: > When we try to allocate new clusters we first look for available ones > starting from s->free_cluster_index and once we find them we increase > their reference counts. Before we get to call update_refcount() to do > this last step s->free_clu

Re: [Qemu-block] [Qemu-devel] [PATCH 2/5] ide: push end_transfer callback to ide_transfer_halt

2018-03-21 Thread John Snow
On 03/21/2018 01:39 AM, Paolo Bonzini wrote: > On 20/03/2018 23:11, John Snow wrote: >> Seems sane, with some lingering questions about what the PIO Setup FIS >> is supposed to do to begin with still remaining. > > I agree here too. Smashing the ATA and controller in the same device > makes thi

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

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

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

2018-03-21 Thread John Snow
On 03/21/2018 04:25 PM, Kevin Wolf wrote: > Am 21.03.2018 um 21:01 hat John Snow geschrieben: >> Adjust each caller of raw_open_common to specify if they are expecting >> host and character devices or not. Tighten expectations of file types upon >> open in the common code and refuse types that ar

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

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 21:01 hat John Snow geschrieben: > Adjust each caller of raw_open_common to specify if they are expecting > host and character devices or not. Tighten expectations of file types upon > open in the common code and refuse types that are not expected. > > This has two effects: > > (

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12 v5] file-posix: specify expected filetypes

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

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12 v5] file-posix: specify expected filetypes

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 21:26 hat Eric Blake geschrieben: > On 03/21/2018 03:01 PM, John Snow wrote: > > Adjust each caller of raw_open_common to specify if they are expecting > > host and character devices or not. Tighten expectations of file types upon > > open in the common code and refuse types that a

Re: [Qemu-block] [Libguestfs] [PATCH] tests: regressions: make test-big-heap use a temporary empty file

2018-03-21 Thread Kevin Wolf
Am 21.03.2018 um 14:48 hat Pino Toscano geschrieben: > On Wednesday, 21 March 2018 14:45:38 CET Eric Blake wrote: > > [adding qemu lists] > > > > On 03/21/2018 07:51 AM, Richard W.M. Jones wrote: > > > On Wed, Mar 21, 2018 at 01:44:17PM +0100, Pino Toscano wrote: > > >> Newer versions of qemu use

Re: [Qemu-block] [Qemu-devel] [Libguestfs] [PATCH] tests: regressions: make test-big-heap use a temporary empty file

2018-03-21 Thread Eric Blake
On 03/21/2018 03:44 PM, Kevin Wolf wrote: You're right that file locking on a character device like /dev/null is not going to work as expected, but is it a case where fcntl() actually fails, or is it worse where the fcntl() claiming the locks "succeeds" but doesn't do what we want? That is, wha

[Qemu-block] raw iotest regressions in 2.12.0-rc0

2018-03-21 Thread John Snow
./check -v -raw Failures: 109 132 136 148 152 183 3fd2457d18edf5736f713dfe1ada9c87a9badab1 is the first bad commit commit 3fd2457d18edf5736f713dfe1ada9c87a9badab1 Author: Peter Xu Date: Fri Mar 9 17:00:03 2018 +0800 monitor: enable IO thread for (qmp & !mux) typed Start to use dedicat

Re: [Qemu-block] [Qemu-devel] [Libguestfs] [PATCH] tests: regressions: make test-big-heap use a temporary empty file

2018-03-21 Thread Richard W.M. Jones
On Wed, Mar 21, 2018 at 03:58:05PM -0500, Eric Blake wrote: > On 03/21/2018 03:44 PM, Kevin Wolf wrote: > >>> > >>>You're right that file locking on a character device like /dev/null is > >>>not going to work as expected, but is it a case where fcntl() actually > >>>fails, or is it worse where the

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Fam Zheng
On Wed, 03/21 11:58, Paolo Bonzini wrote: > diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c > index 7414fe2d67..b3de5df324 100644 > --- a/hw/scsi/scsi-generic.c > +++ b/hw/scsi/scsi-generic.c > @@ -500,9 +500,10 @@ static void scsi_generic_realize(SCSIDevice *s, Error > **errp) >

Re: [Qemu-block] raw iotest regressions in 2.12.0-rc0

2018-03-21 Thread Peter Xu
On Wed, Mar 21, 2018 at 05:58:48PM -0400, John Snow wrote: > ./check -v -raw > Failures: 109 132 136 148 152 183 > > 3fd2457d18edf5736f713dfe1ada9c87a9badab1 is the first bad commit > commit 3fd2457d18edf5736f713dfe1ada9c87a9badab1 > Author: Peter Xu > Date: Fri Mar 9 17:00:03 2018 +0800 > >