Re: [Qemu-block] [PATCH v13 2/6] qmp: Use ThrottleLimits structure

2017-11-06 Thread Pradeep Jagadeesh
Hi Manos, Could you please have a look at Eric's comments. Regards, Pradeep On 10/13/2017 4:26 PM, Eric Blake wrote: [adding Markus, and block list] On 10/13/2017 09:16 AM, Alberto Garcia wrote: On Mon 02 Oct 2017 04:33:28 PM CEST, Pradeep Jagadeesh wrote: This patch factors out code to us

Re: [Qemu-block] [PATCH v13 2/6] qmp: Use ThrottleLimits structure

2017-11-06 Thread Manos Pitsidianakis
On Fri, Oct 13, 2017 at 09:26:17AM -0500, Eric Blake wrote: [adding Markus, and block list] On 10/13/2017 09:16 AM, Alberto Garcia wrote: On Mon 02 Oct 2017 04:33:28 PM CEST, Pradeep Jagadeesh wrote: This patch factors out code to use the ThrottleLimits structure. { 'struct': 'BlockIOThrot

Re: [Qemu-block] [PATCH v2 3/7] qcow2: Prevent allocating compressed clusters at offset 0

2017-11-06 Thread Max Reitz
On 2017-11-03 21:32, Alberto Garcia wrote: > On Fri 03 Nov 2017 09:22:39 PM CET, Alberto Garcia wrote: -assert(offset); >>> >>> I don't think this assert() was meant as a protection against offset >>> being 0. :-) >> >> After the new check offset is now guaranteed to be 0, so what's th

Re: [Qemu-block] [PATCH v13 2/6] qmp: Use ThrottleLimits structure

2017-11-06 Thread Pradeep Jagadeesh
On 11/6/2017 10:35 AM, Manos Pitsidianakis wrote: On Fri, Oct 13, 2017 at 09:26:17AM -0500, Eric Blake wrote: [adding Markus, and block list] On 10/13/2017 09:16 AM, Alberto Garcia wrote: On Mon 02 Oct 2017 04:33:28 PM CEST, Pradeep Jagadeesh wrote: This patch factors out code to use the Thro

Re: [Qemu-block] [PATCH v2 3/7] qcow2: Prevent allocating compressed clusters at offset 0

2017-11-06 Thread Alberto Garcia
On Mon 06 Nov 2017 01:36:01 PM CET, Max Reitz wrote: > -assert(offset); I don't think this assert() was meant as a protection against offset being 0. :-) >>> >>> After the new check offset is now guaranteed to be 0, so what's the >>> point of keeping the assert() ? >> >>

Re: [Qemu-block] [PATCH] aio-posix: drop QEMU_AIO_POLL_MAX_NS env var

2017-11-06 Thread Stefan Hajnoczi
On Fri, Nov 03, 2017 at 03:40:41PM +, Stefan Hajnoczi wrote: > This hunk should not have been merged but I forgot to remove it. Let's > remove it before it slips into a QEMU release. > > ¯\_(ツ)_/¯ > > Reviewed-by: Thomas Huth > Signed-off-by: Stefan Hajnoczi > --- > util/aio-posix.c | 7 -

[Qemu-block] [PATCH] block: Close a BlockDriverState completely even when bs->drv is NULL

2017-11-06 Thread Alberto Garcia
bdrv_close() skips much of its logic when bs->drv is NULL. This is fine when we're closing a BlockDriverState that has just been created (because e.g the initialization process failed), but it's not enough in other cases. For example, when a valid qcow2 image is found to be corrupted then QEMU mar

Re: [Qemu-block] [PATCH] qcow2: don't permit changing encryption parameters

2017-11-06 Thread Alberto Garcia
On Fri 03 Nov 2017 03:39:02 PM CET, Daniel P. Berrange wrote: > Currently if trying to change encryption parameters on a qcow2 image, qemu-img > will abort. We already explicitly check for attempt to change encrypt.format > but missed other parameters like encrypt.key-secret. Rather than list each

Re: [Qemu-block] question: I found a qemu crash when attach virtio-scsi disk

2017-11-06 Thread Kevin Wolf
Am 03.11.2017 um 11:26 hat Stefan Hajnoczi geschrieben: > On Wed, Nov 01, 2017 at 06:42:33AM +, lizhengui wrote: > > Hi, when I attach virtio-scsi disk to VM, the qemu crash happened at very > > low probability. > > > > The qemu crash bt is below: > > > > #0 0x7f2be3ada1d7 in raise ()

Re: [Qemu-block] question: I found a qemu crash when attach virtio-scsi disk

2017-11-06 Thread Paolo Bonzini
On 06/11/2017 17:11, Kevin Wolf wrote: > Am 03.11.2017 um 11:26 hat Stefan Hajnoczi geschrieben: >> On Wed, Nov 01, 2017 at 06:42:33AM +, lizhengui wrote: >>> Hi, when I attach virtio-scsi disk to VM, the qemu crash happened at very >>> low probability. >>> >>> The qemu crash bt is below: >>>

[Qemu-block] [PATCH] block: Fix error path in bdrv_backing_update_filename()

2017-11-06 Thread Kevin Wolf
error_setg_errno() takes a positive errno code. Signed-off-by: Kevin Wolf --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 684cb018da..f6415547fe 100644 --- a/block.c +++ b/block.c @@ -998,7 +998,7 @@ static int bdrv_backing_update_filename(

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Fix error path in bdrv_backing_update_filename()

2017-11-06 Thread Eric Blake
On 11/06/2017 10:55 AM, Kevin Wolf wrote: > error_setg_errno() takes a positive errno code. > > Signed-off-by: Kevin Wolf > --- > block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake Worth mentioning Coverity in the commit message? -- Eric Blake, Principal

[Qemu-block] Drainage in bdrv_replace_child_noperm()

2017-11-06 Thread Max Reitz
Hi everyone, On my quest to fix some flaky iotests, I came to a bit of a halt on 129. (Details: Its issue is that block jobs now generally ignore throttling in a BB (because they use their own), so we have to add a throttle node instead. However, when I added it, I got an abort.) My issue can b

Re: [Qemu-block] question: I found a qemu crash when attach virtio-scsi disk

2017-11-06 Thread Stefan Hajnoczi
On Sun, Nov 05, 2017 at 02:51:40PM +, lizhengui wrote: > Ok, thanks for your reply so mush.. Did the patch solve the problem? If it works for you I will send a proper patch to the mailing list. Thanks, Stefan signature.asc Description: PGP signature

Re: [Qemu-block] [PATCH] block: Fix error path in bdrv_backing_update_filename()

2017-11-06 Thread Alberto Garcia
On Mon 06 Nov 2017 05:55:00 PM CET, Kevin Wolf wrote: > error_setg_errno() takes a positive errno code. > > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v2 2/3] block/parallals: Do not update header or truncate image when INMIGRATE

2017-11-06 Thread Jeff Cody
On Fri, Nov 03, 2017 at 02:08:13PM +0300, Denis V. Lunev wrote: > On 11/03/2017 02:05 PM, Stefan Hajnoczi wrote: > > On Mon, Oct 30, 2017 at 02:10:27PM +0100, Jeff Cody wrote: > >> If we write or modify the image file while the QEMU run state is > >> INMIGRATE, then the BDRV_O_INACTIVE BDS flag is

Re: [Qemu-block] [Qemu-devel] [PATCH 3/5] backup: init copy_bitmap from sync_bitmap for incremental

2017-11-06 Thread John Snow
On 10/12/2017 07:23 AM, Vladimir Sementsov-Ogievskiy wrote: > 10.10.2017 01:56, John Snow wrote: >> >> On 10/02/2017 10:39 AM, Vladimir Sementsov-Ogievskiy wrote: >>> We should not copy non-dirty clusters in write notifiers. So, >>> initialize copy_bitmap from sync_bitmap. >>> >> ...! Duh, good f

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/5] backup improvements part 1

2017-11-06 Thread John Snow
On 10/12/2017 09:53 AM, Vladimir Sementsov-Ogievskiy wrote: > Hi all. Here is a continuation of my "new backup architecture" series, > The very first part, but it is meaningful itself. > > v2: rebase on master > 01: add test and fix bug Nice, glad you caught it. Reviewed-by: John Snow > 02:

Re: [Qemu-block] [Qemu-devel] question: I found a qemu crash when attach virtio-scsi disk

2017-11-06 Thread Fam Zheng
On Mon, 11/06 17:33, Paolo Bonzini wrote: > On 06/11/2017 17:11, Kevin Wolf wrote: > > Am 03.11.2017 um 11:26 hat Stefan Hajnoczi geschrieben: > >> On Wed, Nov 01, 2017 at 06:42:33AM +, lizhengui wrote: > >>> Hi, when I attach virtio-scsi disk to VM, the qemu crash happened at very > >>> low p

[Qemu-block] Re question: I found a qemu crash when attach virtio-scsi disk

2017-11-06 Thread lizhengui
The qemu works good by now after taking the patch when I attach virtio-scsi disk repeatedly. But the probability of the problem is very low,I only met this problem once. -邮件原件- 发件人: Stefan Hajnoczi [mailto:stefa...@gmail.com] 发送时间: 2017年11月7日 3:06 收件人: lizhengui 抄送: kw...@redhat.com; jc

Re: [Qemu-block] [PATCH v2 2/3] block/parallals: Do not update header or truncate image when INMIGRATE

2017-11-06 Thread Jeff Cody
On Mon, Nov 06, 2017 at 03:23:43PM -0500, Jeff Cody wrote: > On Fri, Nov 03, 2017 at 02:08:13PM +0300, Denis V. Lunev wrote: > > On 11/03/2017 02:05 PM, Stefan Hajnoczi wrote: > > > On Mon, Oct 30, 2017 at 02:10:27PM +0100, Jeff Cody wrote: > > >> If we write or modify the image file while the QEMU

[Qemu-block] [PATCH v3 2/4] block/parallels: Do not update header or truncate image when INMIGRATE

2017-11-06 Thread Jeff Cody
If we write or modify the image file while the QEMU run state is INMIGRATE, then the BDRV_O_INACTIVE BDS flag is set. This will cause an assert, since the image is marked inactive. Make sure we obey this flag. Tested-by: Alexey Kardashevskiy Signed-off-by: Jeff Cody --- block/parallels.c | 7

[Qemu-block] [PATCH v3 1/4] block/vhdx.c: Don't blindly update the header

2017-11-06 Thread Jeff Cody
The VHDX specification requires that before user data modification of the vhdx image, the VHDX header file and data GUIDs need to be updated. In vhdx_open(), if the image is set to RDWR, we go ahead and update the header. However, just because the image is set to RDWR does not mean we can go ahead

[Qemu-block] [PATCH v3 0/4] Don't write headers if BDS is INACTIVE

2017-11-06 Thread Jeff Cody
Changes from v2->v3: Patch 2: Uh... fix that misspelling. Thanks Stefan :) Patch 3: New patch to block migration in parallels git-backport-diff -r qemu/master.. -u 6dc6acb 001/4:[] [--] 'block/vhdx.c: Don't blindly update the header' 002/4:[] [--] 'block/parallels: Do not update header

[Qemu-block] [PATCH v3 4/4] qemu-iotests: update unsupported image formats in 194

2017-11-06 Thread Jeff Cody
Test 194 checks for 'luks' to exclude as an unsupported format, However, most formats are unsupported, due to migration blockers. Rather than specifying a blacklist of unsupported formats, whitelist supported formats (specifically, qcow2, qed, raw, dmg). Tested-by: Alexey Kardashevskiy Signed-of

[Qemu-block] [PATCH v3 3/4] block/parallels: add migration blocker

2017-11-06 Thread Jeff Cody
Migration does not work for parallels, and has been broken for a while (see patch 'block/parallels: Do not update header or truncate image when INMIGRATE'). The bdrv_invalidate_cache() method needs to be added for migration to be supported. Until this is done, prohibit migration. Signed-off-by:

[Qemu-block] [PATCH 1/8] nbd-client: Fix error message typos

2017-11-06 Thread Eric Blake
Provide missing spaces that are required when using string concatenation to break error messages across source lines. Signed-off-by: Eric Blake --- block/nbd-client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index b44d4d4a0

[Qemu-block] [PATCH 0/8] various NBD fixes for 2.11

2017-11-06 Thread Eric Blake
Sparked by my question on whether we were handling zero-length reads correctly according to the NBD spec, but grew to fix other things as well such as some typos, tracing weaknesses, and better handling of read-only exports. The order these patches are listed here is bisection-friendly, but applyi

[Qemu-block] [PATCH 2/8] nbd/client: Nicer trace of structured reply

2017-11-06 Thread Eric Blake
It's useful to know which structured reply chunk is being processed. Signed-off-by: Eric Blake --- nbd/client.c | 4 +++- nbd/trace-events | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nbd/client.c b/nbd/client.c index 3d680e63e1..1880103d2a 100644 --- a/nbd/client.c

[Qemu-block] [PATCH 3/8] raw: Reflect read-only protocol layer

2017-11-06 Thread Eric Blake
We forbid operations like a zero-length write zero or a discard at the protocol layer when it is marked read-only, but those same operations were succeeding at the format layer because the raw format was not reflecting the underlying read-only status to the block layer, which then took short circui

[Qemu-block] [PATCH 4/8] nbd-client: Honor server read-only advertisement

2017-11-06 Thread Eric Blake
The NBD spec says that clients should not try to write/trim to an export advertised as read-only by the server. But we failed to inform the block layer of what we learned from the server, meaning that we were depending on the server sending a proper EPERM failure for various commands. In fact, th

[Qemu-block] [PATCH 7/8] nbd-client: Stricter enforcing of structured reply spec

2017-11-06 Thread Eric Blake
Ensure that the server is not sending unexpected chunk lengths for either the NONE or the OFFSET_DATA chunk, nor unexpected hole length for OFFSET_HOLE. This will flag any server that responds to a zero-length read with an OFFSET_DATA as broken, but we just fixed things to never send that request.

[Qemu-block] [PATCH 8/8] nbd/server: Fix structured read of length 0

2017-11-06 Thread Eric Blake
The NBD spec is being clarified that a read of length 0 should not be attempted by a compliant client; but that a server must handle it correctly. However, it also implies that NBD_REPLY_TYPE_OFFSET_DATA must have a non-zero payload length, which means that we must either give an error or use a no

[Qemu-block] [PATCH 2/2] nbd/server: Optimize final chunk of sparse read

2017-11-06 Thread Eric Blake
If we are careful to handle 0-length read requests correctly, we can optimize our sparse read to send the NBD_REPLY_FLAG_DONE bit on our last OFFSET_DATA or OFFSET_HOLE chunk rather than needing a separate chunk. Signed-off-by: Eric Blake --- nbd/server.c | 13 +++-- 1 file changed, 7 in

[Qemu-block] [PATCH 5/8] nbd: Fix struct name for structured reads

2017-11-06 Thread Eric Blake
A closer read of the NBD spec shows that a structured reply chunk for a hole is not quite identical to the prefix of a data chunk, because the hole has to also send a 32-bit size field. Although we do not yet send holes, we should fix the misleading information in our header and make it easier for

[Qemu-block] [PATCH 6/8] nbd-client: Short-circuit 0-length operations

2017-11-06 Thread Eric Blake
The NBD spec is being clarified to state that clients should not send 0-length requests to the server, as the server behavior is undefined. While such requests are unlikely to occur from real guest behavior, qemu-io can force the driver to perform them; avoid any questionable server implementation

[Qemu-block] [PATCH 0/2] Optimize sparse reads over NBD

2017-11-06 Thread Eric Blake
When I first proposed the NBD extension of structured reads, it was in order to more efficiently read sparse files without sending lots of zeroes over the wire. These two patches feel like a feature addition, and missed soft freeze, so I'm reluctant to include them in a 2.11 pull request; on the o

[Qemu-block] [PATCH 1/2] nbd/server: Implement sparse reads atop structured reply

2017-11-06 Thread Eric Blake
The reason that NBD added structured reply in the first place was to allow for efficient reads of sparse files, by allowing the reply to include chunks to quickly communicate holes to the client without sending lots of zeroes over the wire. Time to implement this in the server; our client can alre

Re: [Qemu-block] [Qemu-devel] Drainage in bdrv_replace_child_noperm()

2017-11-06 Thread Fam Zheng
On Mon, 11/06 19:49, Max Reitz wrote: > Hi everyone, > > On my quest to fix some flaky iotests, I came to a bit of a halt on 129. > (Details: Its issue is that block jobs now generally ignore throttling > in a BB (because they use their own), so we have to add a throttle node > instead. However,

Re: [Qemu-block] [Qemu-devel] [PATCH v3 0/4] Don't write headers if BDS is INACTIVE

2017-11-06 Thread Fam Zheng
On Mon, 11/06 21:31, Jeff Cody wrote: > Changes from v2->v3: > > Patch 2: Uh... fix that misspelling. Thanks Stefan :) > Patch 3: New patch to block migration in parallels Reviewed-by: Fam Zheng

[Qemu-block] about qemu-img info on block dev

2017-11-06 Thread wang.guang55
hello if we create a qcow2 file on a block dev. we can,t get the right disk size by qemu-img info。 [root@host-120-79 qemu]# ./qemu-img create -f qcow2 /dev/zs/lvol0 1G Formatting '/dev/zs/lvol0', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16 [root@hos