Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP

2016-10-11 Thread Fam Zheng
On Wed, 09/28 15:04, Fam Zheng wrote: > Handling this is similar to what is done to the L2 entry in the case of > compressed clusters. Kevin, Max, is there anything else I need to do before this patch can be applied? Fam

Re: [Qemu-block] [Questions] NBD issue or CoMutex->holder issue?

2016-10-11 Thread Changlong Xie
On 10/11/2016 06:47 PM, Paolo Bonzini wrote: the free_sema->queue head, so set free_sema->holder as >revelant coroutine. NBD is using the CoMutex in a way that wasn't anticipated. The simplest fix is to change it to CoQueue, which is like a condition variable. Instead of locking if in_flight

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/2] block/replication: Clarify 'top-id' parameter usage

2016-10-11 Thread Changlong Xie
On 10/11/2016 10:54 PM, Eric Blake wrote: The replication driver only supports the 'top-id' parameter for the secondary side; it must not be supplied for the primary side. Will apply in next version. Thanks -Xie

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] block/replication: prefect the logic to acquire 'top_id'

2016-10-11 Thread Changlong Xie
On 10/11/2016 10:52 PM, Eric Blake wrote: On 10/11/2016 05:46 AM, Changlong Xie wrote: Only g_strdup(top_id) if 'top_id' is not NULL, although there is no memory leak here Signed-off-by: Changlong Xie --- block/replication.c | 4 ++-- 1 file changed, 2

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] Allow blockdev-add for SSH

2016-10-11 Thread no-reply
Hi, Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Message-id: 1476171437-11830-1-git-send-email-ashijeetacha...@gmail.com Subject: [Qemu-devel] [PATCH 0/4] Allow blockdev-add

Re: [Qemu-block] [Qemu-devel] [PATCH v5] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Programmingkid
On Oct 11, 2016, at 2:12 PM, Eric Blake wrote: > On 10/11/2016 01:03 PM, Programmingkid wrote: > >>> +/* Mac OSX has a bug that incorrectly defines SIZE_MAX with >>> + * the wrong type. Our replacement isn't usable in preprocessor >>> + * expressions, but it is sufficient for our needs. */ >>>

Re: [Qemu-block] [Qemu-devel] [PATCH v5] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Peter Maydell
On 11 October 2016 at 19:12, Eric Blake wrote: > On 10/11/2016 01:03 PM, Programmingkid wrote: > >>> +/* Mac OSX has a bug that incorrectly defines SIZE_MAX with >>> + * the wrong type. Our replacement isn't usable in preprocessor >>> + * expressions, but it is sufficient for

Re: [Qemu-block] [Qemu-devel] [PATCH v5] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Eric Blake
On 10/11/2016 01:03 PM, Programmingkid wrote: >> +/* Mac OSX has a bug that incorrectly defines SIZE_MAX with >> + * the wrong type. Our replacement isn't usable in preprocessor >> + * expressions, but it is sufficient for our needs. */ >> +#if defined(HAVE_BROKEN_SIZE_MAX) &&

[Qemu-block] [Qemu-devel] [PATCH v5] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Programmingkid
On Oct 11, 2016, at 12:00 PM, qemu-devel-requ...@nongnu.org wrote: > C99 requires SIZE_MAX to be declared with the same type as the > integral promotion of size_t, but OSX mistakenly defines it as > an 'unsigned long long' expression even though size_t is only > 'unsigned long'. Rather than

Re: [Qemu-block] [Qemu-devel] [PATCH v5] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Markus Armbruster
Eric Blake writes: > C99 requires SIZE_MAX to be declared with the same type as the > integral promotion of size_t, but OSX mistakenly defines it as > an 'unsigned long long' expression even though size_t is only > 'unsigned long'. Rather than futzing around with whether

Re: [Qemu-block] [Qemu-devel] [PATCH 2/2] macio: switch over to new byte-aligned DMA helpers

2016-10-11 Thread John Snow
On 10/09/2016 12:43 PM, Mark Cave-Ayland wrote: Now that the DMA helpers are byte-aligned they can be called directly from the macio routines rather than emulating byte-aligned accesses via multiple block-level accesses. _cool_ Signed-off-by: Mark Cave-Ayland

Re: [Qemu-block] [Qemu-devel] [PATCH v10 09/16] block: Add QMP support for streaming to an intermediate layer

2016-10-11 Thread Markus Armbruster
Eric Blake writes: > On 10/11/2016 09:57 AM, Kevin Wolf wrote: >> Should we introduce a new, clean blockdev-stream command that fixes this >> and matches the common name pattern? Of course, block-stream vs. >> blockdev-stream could be a bit confusing, too... >> > > A new

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] block: new bdrv_drain implementation

2016-10-11 Thread no-reply
Hi, Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Subject: [Qemu-devel] [PATCH 0/3] block: new bdrv_drain implementation Message-id:

Re: [Qemu-block] [PATCH 1/3] block: add BDS field to count in-flight requests

2016-10-11 Thread Paolo Bonzini
On 11/10/2016 17:25, Kevin Wolf wrote: > Am 11.10.2016 um 16:09 hat Paolo Bonzini geschrieben: >> Is what you call "a BDS-level bdrv_isolate_begin/end" the same as my >> "bdrv_drained_begin(bs) and bdrv_drained_end(bs), which quiesce all root >> BdrvChildren reachable from bs"? Anyway I think

Re: [Qemu-block] [Qemu-devel] [PATCH v10 09/16] block: Add QMP support for streaming to an intermediate layer

2016-10-11 Thread Markus Armbruster
Kevin Wolf writes: > Am 11.10.2016 um 16:30 hat Alberto Garcia geschrieben: [...] >> 3) QEMU could advertise that feature to the client. This is probably >> simpler than trying to figure it out from the API. I guess that's the >> idea of 'qmp_capabilities'? > > I think that was

Re: [Qemu-block] [Qemu-devel] [PATCH v14 07/21] qapi: permit scalar type conversions in QObjectInputVisitor

2016-10-11 Thread Markus Armbruster
"Daniel P. Berrange" writes: > Currently the QObjectInputVisitor assumes that all scalar > values are directly represented as the final types declared > by the thing being visited. ie it assumes an 'int' is using i.e. > QInt, and a 'bool' is using QBool, etc. This is good

Re: [Qemu-block] [Qemu-devel] [PATCH v10 09/16] block: Add QMP support for streaming to an intermediate layer

2016-10-11 Thread Eric Blake
On 10/11/2016 09:57 AM, Kevin Wolf wrote: > Should we introduce a new, clean blockdev-stream command that fixes this > and matches the common name pattern? Of course, block-stream vs. > blockdev-stream could be a bit confusing, too... > A new command is easy to introspect (query-commands), lets

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] dma-helpers: explicitly pass alignment into dma-helpers

2016-10-11 Thread John Snow
On 10/10/2016 03:23 PM, Mark Cave-Ayland wrote: On 10/10/16 17:34, Eric Blake wrote: On 10/09/2016 11:43 AM, Mark Cave-Ayland wrote: The hard-coded default alignment is BDRV_SECTOR_SIZE, however this is not necessarily the case for all platforms. Use this as the default alignment for all

[Qemu-block] [PATCH v5] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Eric Blake
C99 requires SIZE_MAX to be declared with the same type as the integral promotion of size_t, but OSX mistakenly defines it as an 'unsigned long long' expression even though size_t is only 'unsigned long'. Rather than futzing around with whether size_t is 32- or 64-bits wide (which would be needed

[Qemu-block] [PATCH v6 08.5/15] fixup! qstring: Add qstring_wrap_str()

2016-10-11 Thread Eric Blake
Signed-off-by: Eric Blake --- squash this in to address Marc-Andre's finding on a harmless extra g_free. --- block.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 16d5981..6f00fd4 100644 --- a/block.c +++ b/block.c @@

Re: [Qemu-block] [PATCH 1/3] block: add BDS field to count in-flight requests

2016-10-11 Thread Kevin Wolf
Am 11.10.2016 um 16:09 hat Paolo Bonzini geschrieben: > > Anyway, let's see which of the existing bdrv_drained_begin/end users > > would use this (please correct): > > > > * Block jobs use during completion > > > > * The QMP transaction commands to start block jobs drain as well, but > > they

Re: [Qemu-block] [Qemu-devel] [PATCH v5 06/14] nbd: Send message along with server NBD_REP_ERR errors

2016-10-11 Thread Eric Blake
On 07/19/2016 12:15 AM, Fam Zheng wrote: > On Mon, 07/18 22:07, Eric Blake wrote: >> nbd/server.c | 78 >> +--- >> 1 file changed, 59 insertions(+), 19 deletions(-) >> >> diff --git a/nbd/server.c b/nbd/server.c >> index c8716f1..ad31c4a

Re: [Qemu-block] [Qemu-devel] [PATCH v6 08/15] qstring: Add qstring_wrap_str()

2016-10-11 Thread Eric Blake
On 10/11/2016 10:04 AM, Eric Blake wrote: > On 10/11/2016 06:08 AM, Marc-André Lureau wrote: > >>> +++ b/block.c >>> @@ -1640,7 +1640,8 @@ static BlockDriverState >>> *bdrv_append_temp_snapshot(BlockDriverState *bs, >>> qdict_put(snapshot_options, "file.driver", >>>

Re: [Qemu-block] [Qemu-devel] [PATCH v6 08/15] qstring: Add qstring_wrap_str()

2016-10-11 Thread Eric Blake
On 10/11/2016 06:08 AM, Marc-André Lureau wrote: >> +++ b/block.c >> @@ -1640,7 +1640,8 @@ static BlockDriverState >> *bdrv_append_temp_snapshot(BlockDriverState *bs, >> qdict_put(snapshot_options, "file.driver", >>qstring_from_str("file")); >>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/2] block/replication: Clarify 'top-id' parameter usage

2016-10-11 Thread Eric Blake
On 10/11/2016 05:46 AM, Changlong Xie wrote: > Replication driver only support 'top-id' parameter in secondary side, > and it must not be supplied in primary side Grammar suggestion: The replication driver only supports the 'top-id' parameter for the secondary side; it must not be supplied for

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] block/replication: prefect the logic to acquire 'top_id'

2016-10-11 Thread Eric Blake
On 10/11/2016 05:46 AM, Changlong Xie wrote: > Only g_strdup(top_id) if 'top_id' is not NULL, although there > is no memory leak here > > Signed-off-by: Changlong Xie > --- > block/replication.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff

Re: [Qemu-block] [Qemu-devel] [PATCH v10 09/16] block: Add QMP support for streaming to an intermediate layer

2016-10-11 Thread Alberto Garcia
On Mon 10 Oct 2016 09:09:25 PM CEST, Eric Blake wrote: >> # @job-id: #optional identifier for the newly-created block job. If >> # omitted, the device name will be used. (Since 2.7) >> # >> -# @device: the device name or node-name of a root node >> +# @device: the device or node name

Re: [Qemu-block] [Qemu-devel] [PATCH v4] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Eric Blake
On 10/11/2016 02:18 AM, Markus Armbruster wrote: >> +#define SIZE_MAX ((sizeof(char)) * -1) > > All right, let's see how this works. > > > Cute, but what's wrong with straightforward > > #define SIZE_MAX ((size_t)-1) I was trying to make the macro usable even in situations where

Re: [Qemu-block] [PATCH 1/3] block: add BDS field to count in-flight requests

2016-10-11 Thread Paolo Bonzini
First of all, a correction: >> The exception is that there are places >> where we don't have a BlockBackend and thus call >> bdrv_drain/bdrv_co_drain instead of blk_drain/blk_co_drain Nevermind---it's just that there is no blk_drained_begin/end yet. On 11/10/2016 13:00, Kevin Wolf wrote: >

[Qemu-block] [PATCH v5 1/1] block: improve error handling in raw_open

2016-10-11 Thread Halil Pasic
Make raw_open for POSIX more consistent in handling errors by setting the error object also when qemu_open fails. The error object was set generally set in case of errors, but I guess this case was overlooked. Do the same for win32. Signed-off-by: Halil Pasic

Re: [Qemu-block] [PATCH v10 03/16] block: Use block_job_add_bdrv() in mirror_start_job()

2016-10-11 Thread Kevin Wolf
Am 11.10.2016 um 15:46 hat Alberto Garcia geschrieben: > On Mon 10 Oct 2016 06:03:41 PM CEST, Kevin Wolf wrote: > > >> Use block_job_add_bdrv() instead of blocking all operations in > >> mirror_start_job() and unblocking them in mirror_exit(). > >> > >> Signed-off-by: Alberto Garcia

Re: [Qemu-block] [PATCH v10 03/16] block: Use block_job_add_bdrv() in mirror_start_job()

2016-10-11 Thread Alberto Garcia
On Mon 10 Oct 2016 06:03:41 PM CEST, Kevin Wolf wrote: >> Use block_job_add_bdrv() instead of blocking all operations in >> mirror_start_job() and unblocking them in mirror_exit(). >> >> Signed-off-by: Alberto Garcia > > Compared to the old code, this unblocks

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/11] blockjob: centralize QMP event emissions

2016-10-11 Thread Kashyap Chamarthy
On Mon, Oct 10, 2016 at 02:28:52PM -0500, Eric Blake wrote: > On 10/10/2016 01:36 PM, John Snow wrote: [...] > > I'll be honest that I don't know; this is related to Replication which I > > know reasonably little about overall. It got added in the 2.8 timeframe, > > so the behavior it currently

[Qemu-block] [PATCH v3] block: Remove "options" indirection from blockdev-add

2016-10-11 Thread Kevin Wolf
Now that QAPI supports boxed types, we can have unions at the top level of a command, so let's put our real options directly there for blockdev-add instead of having a single "options" dict that contains the real arguments. blockdev-add is still experimental and we already made substantial

Re: [Qemu-block] [PATCH 06/22] qcow2: add dirty bitmaps extension

2016-10-11 Thread Vladimir Sementsov-Ogievskiy
On 01.10.2016 17:46, Max Reitz wrote: On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: Add dirty bitmap extension as specified in docs/specs/qcow2.txt. For now, just mirror extension header into Qcow2 state and check constraints. For now, disable image resize if it has bitmaps. It will

Re: [Qemu-block] [PATCH 05/22] qcow2-bitmap: structs and consts

2016-10-11 Thread Vladimir Sementsov-Ogievskiy
On 01.10.2016 17:34, Max Reitz wrote: On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: Create block/qcow2-bitmap.c Add data structures and constraints accordingly to docs/specs/qcow2.txt Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/Makefile.objs |

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] qemu-img: change img_open() and opening method in dd

2016-10-11 Thread no-reply
Hi, Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Subject: [Qemu-devel] [PATCH 0/2] qemu-img: change img_open() and opening method in dd Message-id:

Re: [Qemu-block] [Qemu-devel] [PATCH v6 08/15] qstring: Add qstring_wrap_str()

2016-10-11 Thread Marc-André Lureau
Hi On Mon, Oct 10, 2016 at 5:25 PM Eric Blake wrote: > Several spots in the code malloc a string, then wrap it in a > QString, which has to duplicate the input. Adding a new > constructor with transfer semantics makes this pattern more > efficient, comparable to the

Re: [Qemu-block] [PATCH v10 01/16] block: Pause all jobs during bdrv_reopen_multiple()

2016-10-11 Thread Kevin Wolf
Am 11.10.2016 um 11:54 hat Paolo Bonzini geschrieben: > On 11/10/2016 11:39, Kevin Wolf wrote: > > Am 10.10.2016 um 18:41 hat Paolo Bonzini geschrieben: > >> On 10/10/2016 17:37, Kevin Wolf wrote: > +while ((job = block_job_next(job))) { > +AioContext *aio_context =

Re: [Qemu-block] [PATCH 1/3] block: add BDS field to count in-flight requests

2016-10-11 Thread Kevin Wolf
Am 10.10.2016 um 18:37 hat Paolo Bonzini geschrieben: > On 10/10/2016 12:36, Kevin Wolf wrote: > > > > At the BlockBackend level (or really anywhere in the graph), we have two > > different kinds of drain requests that we just fail to implement > > differently today: > > > > 1. blk_drain(), i.e.

Re: [Qemu-block] [Questions] NBD issue or CoMutex->holder issue?

2016-10-11 Thread Paolo Bonzini
On 11/10/2016 12:35, Changlong Xie wrote: > For nbd client, if request number is large than MAX_NBD_REQUESTS(16), we > will queue the rest requests into free_sema->queue. > When nbd client receives one reply, it will unlock free_sema, then pop > the free_sema->queue head, so set

[Qemu-block] [PATCH v2 0/2] block/replication fixes

2016-10-11 Thread Changlong Xie
V2: 1. fix typo Changlong Xie (2): block/replication: prefect the logic to acquire 'top_id' block/replication: Clarify 'top-id' parameter usage block/replication.c | 9 +++-- qapi/block-core.json | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) -- 1.9.3

[Qemu-block] [PATCH v2 1/2] block/replication: prefect the logic to acquire 'top_id'

2016-10-11 Thread Changlong Xie
Only g_strdup(top_id) if 'top_id' is not NULL, although there is no memory leak here Signed-off-by: Changlong Xie --- block/replication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/replication.c b/block/replication.c index

Re: [Qemu-block] [PATCH v10 01/16] block: Pause all jobs during bdrv_reopen_multiple()

2016-10-11 Thread Paolo Bonzini
On 11/10/2016 11:39, Kevin Wolf wrote: > Am 10.10.2016 um 18:41 hat Paolo Bonzini geschrieben: >> On 10/10/2016 17:37, Kevin Wolf wrote: +while ((job = block_job_next(job))) { +AioContext *aio_context = blk_get_aio_context(job->blk); + +

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/11] blockjob: centralize QMP event emissions

2016-10-11 Thread Markus Armbruster
John Snow writes: > On 10/05/2016 09:43 AM, Kevin Wolf wrote: [...] >> Here we have an additional caller in block/replication.c and qemu-img, >> so the parameters must stay. For qemu-img, nothing changes. For >> replication, the block job events are added as a side effect. >>

Re: [Qemu-block] [PATCH v10 01/16] block: Pause all jobs during bdrv_reopen_multiple()

2016-10-11 Thread Kevin Wolf
Am 10.10.2016 um 18:41 hat Paolo Bonzini geschrieben: > On 10/10/2016 17:37, Kevin Wolf wrote: > > > +while ((job = block_job_next(job))) { > > > +AioContext *aio_context = blk_get_aio_context(job->blk); > > > + > > > +aio_context_acquire(aio_context); > > > +

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/11] blockjob: refactor backup_start as backup_job_create

2016-10-11 Thread Kevin Wolf
Am 11.10.2016 um 00:51 hat John Snow geschrieben: > >>Sadly for me, I realized this patch has a potential problem. When we > >>were adding the bitmap operations, it became clear that the > >>atomicity point was during .prepare, not .commit. > >> > >>e.g. the bitmap is cleared or created during

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/11] blockjob: refactor backup_start as backup_job_create

2016-10-11 Thread Paolo Bonzini
On 11/10/2016 00:51, John Snow wrote: >> Clearing the bitmap is a bug because the caller could expect that the >> bitmap is in its original state if the transaction fails. I doubt this >> is a problem in practice, but we should fix it anyway. > > We make a backup to undo the process if it

Re: [Qemu-block] [PATCH v10 03/16] block: Use block_job_add_bdrv() in mirror_start_job()

2016-10-11 Thread Paolo Bonzini
On 10/10/2016 18:03, Kevin Wolf wrote: >> > Use block_job_add_bdrv() instead of blocking all operations in >> > mirror_start_job() and unblocking them in mirror_exit(). >> > >> > Signed-off-by: Alberto Garcia > Compared to the old code, this unblocks BLOCK_OP_TYPE_DATAPLANE,

Re: [Qemu-block] [Qemu-devel] [PATCH v2] block: Remove "options" indirection from blockdev-add

2016-10-11 Thread Markus Armbruster
Kevin Wolf writes: > Now that QAPI supports boxed types, we can have unions at the top level > of a command, so let's put our real options directly there for > blockdev-add instead of having a single "options" dict that contains the > real arguments. > > blockdev-add is still

[Qemu-block] [PATCH 4/4] qapi: allow blockdev-add for ssh

2016-10-11 Thread Ashijeet Acharya
Introduce new object 'BlockdevOptionsSsh' in qapi/block-core.json to support blockdev-add for SSH network protocol driver. Use only 'struct InetSocketAddress' since SSH only supports connection over TCP. Signed-off-by: Ashijeet Acharya --- qapi/block-core.json | 24

[Qemu-block] [PATCH 2/4] block/ssh: Add InetSocketAddress and accept it

2016-10-11 Thread Ashijeet Acharya
Add InetSocketAddress compatibility to SSH driver. Add a new option "server" to the SSH block driver which then accepts a InetSocketAddress. "host" and "port" are supported as legacy options and are mapped to their InetSocketAddress representation. Signed-off-by: Ashijeet Acharya

[Qemu-block] [PATCH 1/4] block/ssh: Add ssh_has_filename_options_conflict()

2016-10-11 Thread Ashijeet Acharya
We have 5 options plus ("server") option which is added in the next patch that conflict with specifying a SSH filename. We need to iterate over all the options to check whether its key has an "server." prefix. This iteration will help us adding the new option "server" easily. Signed-off-by:

[Qemu-block] [PATCH 0/4] Allow blockdev-add for SSH

2016-10-11 Thread Ashijeet Acharya
This series adds blockdev-add support for SSH block driver. Patch 1 prepares the code for the addition of a new option prefix, which is "server.". This is accomplished by adding a ssh_has_filename_options_conflict() function which helps to iterate over the various options and check for conflict.

Re: [Qemu-block] [Qemu-devel] [PATCH v4] build: Work around SIZE_MAX bug in OSX headers

2016-10-11 Thread Markus Armbruster
Eric Blake writes: > C99 requires SIZE_MAX to be declared with the same type as the > integral promotion of size_t, but OSX mistakenly defines it as > an 'unsigned long long' expression even though size_t is only > 'unsigned long'. Rather than futzing around with whether

Re: [Qemu-block] [Qemu-devel] [PATCH v1 2/2] block/replication: Clarify 'top-id' parameter usage

2016-10-11 Thread Fam Zheng
On Tue, 10/11 13:39, Changlong Xie wrote: > Replication driver only support 'top-id' parameter in secondary side, > and it must not be supplied in primary side > > Signed-off-by: Changlong Xie > --- > block/replication.c | 5 + > qapi/block-core.json | 3 ++- > 2