Re: [Qemu-block] [PATCH v3 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-29 Thread Max Reitz
On 2017-09-28 11:27, Pavel Butsykin wrote: > Now after shrinking the image, at the end of the image file, there might be a > tail that probably will never be used. So we can find the last used cluster > and > cut the tail. > > Signed-off-by: Pavel Butsykin >

Re: [Qemu-block] [PATCH v3 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-29 Thread Pavel Butsykin
On 29.09.2017 13:55, Max Reitz wrote: On 2017-09-28 11:27, Pavel Butsykin wrote: Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin

Re: [Qemu-block] [PATCH] block/mirror: check backing in bdrv_mirror_top_refresh_filename

2017-09-29 Thread Max Reitz
On 2017-09-28 14:03, Vladimir Sementsov-Ogievskiy wrote: > Backing may be zero after failed bdrv_attach_child in > bdrv_set_backing_hd, which leads to SIGSEGV. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- Thanks, applied to my block branch:

Re: [Qemu-block] [Qemu-devel] [PATCH v2 43/47] util: Replace fprintf(stderr, "*\n" with error_report()

2017-09-29 Thread Philippe Mathieu-Daudé
On 09/29/2017 09:17 PM, Alistair Francis wrote: Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N;

[Qemu-block] [PATCH v6 04/25] block: Respect backing bs in bdrv_refresh_filename

2017-09-29 Thread Max Reitz
Basically, bdrv_refresh_filename() should respect all children of a BlockDriverState. However, generally those children are driver-specific, so this function cannot handle the general case. On the other hand, there are only few drivers which use other children than @file and @backing (that being

[Qemu-block] [PATCH v6 00/25] block: Fix some filename generation issues

2017-09-29 Thread Max Reitz
[If you have read the cover letter in x \in [v2, v5], there is nothing new here; feel free to skip to the bottom to read the changes from v4.] There are some issues regarding filename generation right now: - You always get a JSON filename if you set even a single qcow2-specific runtime

[Qemu-block] [PATCH v6 11/25] blkverify: Make bdrv_dirname() return NULL

2017-09-29 Thread Max Reitz
blkverify's BDSs have a file BDS, but we do not want this to be preferred over the raw node. There is no way to decide between the two (and not really a reason to, either), so just return NULL in blkverify's implementation of bdrv_dirname(). Signed-off-by: Max Reitz

[Qemu-block] [PATCH v6 02/25] block: Use children list in bdrv_refresh_filename

2017-09-29 Thread Max Reitz
bdrv_refresh_filename() should invoke itself recursively on all children, not just on file. With that change, we can remove the manual invocations in blkverify, quorum, commit, and mirror. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia --- block.c

[Qemu-block] [PATCH v6 22/25] block: Do not copy exact_filename from format file

2017-09-29 Thread Max Reitz
If the a format BDS's file BDS is in turn a format BDS, we cannot simply use the same filename, because when opening a BDS tree based on a filename alone, qemu will create only one format node on top of one protocol node (disregarding a potential backing file). Signed-off-by: Max Reitz

[Qemu-block] [PATCH v6 07/25] block: bdrv_get_full_backing_filename's ret. val.

2017-09-29 Thread Max Reitz
Make bdrv_get_full_backing_filename() return an allocated string instead of placing the result in a caller-provided buffer. Signed-off-by: Max Reitz --- include/block/block.h | 3 +-- block.c | 47 +-- block/qapi.c

Re: [Qemu-block] [PATCH] block/mirror: check backing in bdrv_mirror_top_flush

2017-09-29 Thread Max Reitz
On 2017-09-29 17:22, Vladimir Sementsov-Ogievskiy wrote: > Backing may be zero after failed bdrv_append in mirror_start_job, > which leads to SIGSEGV. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > similar SIGSEGV. > looks like (I guess by code, don't have

Re: [Qemu-block] [Qemu-devel] [PATCH v3] iotests: Add test for dataplane mirroring

2017-09-29 Thread Eric Blake
On 09/29/2017 12:08 PM, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > v3: Make the test actually pass (the reference output from v2 only > worked with v1 of the test...) > --- > tests/qemu-iotests/127 | 97 > ++ >

Re: [Qemu-block] [Qemu-devel] [PATCH v3] iotests: Add test for dataplane mirroring

2017-09-29 Thread Max Reitz
On 2017-09-29 19:33, Eric Blake wrote: > On 09/29/2017 12:08 PM, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >> v3: Make the test actually pass (the reference output from v2 only >> worked with v1 of the test...) >> --- >> tests/qemu-iotests/127 | 97 >>

Re: [Qemu-block] [Qemu-devel] [PATCH v3] iotests: Add test for dataplane mirroring

2017-09-29 Thread Eric Blake
On 09/29/2017 01:08 PM, Max Reitz wrote: > On 2017-09-29 19:33, Eric Blake wrote: >> On 09/29/2017 12:08 PM, Max Reitz wrote: >>> Signed-off-by: Max Reitz >>> --- >>> v3: Make the test actually pass (the reference output from v2 only >>> worked with v1 of the test...) >>

Re: [Qemu-block] [Qemu-devel] [PATCH v4 19/23] qemu-img: Change img_rebase() to be byte-based

2017-09-29 Thread John Snow
On 09/13/2017 12:03 PM, Eric Blake wrote: > In the continuing quest to make more things byte-based, change > the internal iteration of img_rebase(). We can finally drop the > TODO assertion added earlier, now that the entire algorithm is > byte-based and no longer has to shift from bytes to

Re: [Qemu-block] [PATCH] block/mirror: check backing in bdrv_mirror_top_refresh_filename

2017-09-29 Thread John Snow
On 09/28/2017 08:03 AM, Vladimir Sementsov-Ogievskiy wrote: > Backing may be zero after failed bdrv_attach_child in > bdrv_set_backing_hd, which leads to SIGSEGV. > I guess in this case we trust bdrv_set_backing_hd to carry the errp parameter back to the caller indicating that not only did we

[Qemu-block] [PATCH v2 04/47] tests: Replace fprintf(stderr, "*\n" with error_report()

2017-09-29 Thread Alistair Francis
Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,

[Qemu-block] [PATCH v2 06/47] hw/block: Replace fprintf(stderr, "*\n" with error_report()

2017-09-29 Thread Alistair Francis
Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,

[Qemu-block] [PATCH v2 01/47] Replace all occurances of __FUNCTION__ with __func__

2017-09-29 Thread Alistair Francis
Replace all occurs of __FUNCTION__ except for the check in checkpatch with the non GCC specific __func__. One line in hcd-musb.c was manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Gerd Hoffmann Cc: Andrzej Zaborowski

[Qemu-block] [PATCH v2 16/47] hw/ide: Replace fprintf(stderr, "*\n" with error_report()

2017-09-29 Thread Alistair Francis
Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,

[Qemu-block] [PATCH v2 43/47] util: Replace fprintf(stderr, "*\n" with error_report()

2017-09-29 Thread Alistair Francis
Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,

Re: [Qemu-block] [Qemu-devel] [PATCH v3] virtio: introduce `info virtio' hmp command

2017-09-29 Thread Jan Dakinevich
> Same question as before - why not a QMP counterpart as well? > What do you mean? Implement something like `query-virtio' backed by respective qmp_query_virtio() and then use this routine for `virtio info', right? On 09/29/2017 10:29 PM, Michael S. Tsirkin wrote: > On Wed, Sep 27, 2017 at