Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-11 Thread Michal Suchánek
On Mon, 11 Jun 2018 05:06:53 +0300 "Michael S. Tsirkin" wrote: > On Sat, Jun 09, 2018 at 11:34:03PM +0200, Max Reitz wrote: > > Dave was saying that the worst thing about the whole q35 thing is > > that users download an image and have no idea why it isn't > > working. Figuring that out

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-11 Thread Richard W.M. Jones
On Wed, Jun 06, 2018 at 01:32:47PM +0200, Max Reitz wrote: > ext2? I wrote an nbdkit plugin for ext2/ext3/ext4 last week. https://github.com/libguestfs/nbdkit/tree/master/plugins/ext2 It uses libext2fs from e2fsprogs and I think there are some lessons for anyone who wants to use ext2 to store

[Qemu-block] [PATCH] util/async: avoid NULL pointer dereference

2018-06-11 Thread Jie Wang
if laio_init create linux_aio failed and return NULL, NULL pointer dereference will occur when laio_attach_aio_context dereference linux_aio in aio_get_linux_aio, so add assert to avoid it. Signed-off-by: Jie Wang --- util/async.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/async.c

Re: [Qemu-block] [PATCH] util/async: avoid NULL pointer dereference

2018-06-11 Thread Fam Zheng
On Mon, 06/11 15:04, Jie Wang wrote: > if laio_init create linux_aio failed and return NULL, NULL pointer > dereference will occur when laio_attach_aio_context dereference > linux_aio in aio_get_linux_aio, so add assert to avoid it. > > Signed-off-by: Jie Wang > --- > util/async.c | 1 + > 1

Re: [Qemu-block] [VDSM] travis tests fail consistently since Apr 14

2018-06-11 Thread Nir Soffer
On Mon, Jun 11, 2018 at 1:03 PM Maor Lipchuk wrote: > On Tue, Jun 5, 2018 at 9:40 AM, Dan Kenigsberg wrote: > >> On Mon, Jun 4, 2018 at 7:14 PM, Nir Soffer wrote: >> > On Mon, Jun 4, 2018 at 6:56 PM Dan Kenigsberg >> wrote: >> >> >> >> On Tue, May 8, 2018 at 11:59 AM, Nir Soffer >> wrote: >>

Re: [Qemu-block] [RFC] Intermediate block mirroring

2018-06-11 Thread Kevin Wolf
Am 01.06.2018 um 12:51 hat Alberto Garcia geschrieben: > On Thu 03 May 2018 02:22:41 PM CEST, Kevin Wolf wrote: > >> > Were the (more or less) exact requirements of QMP blockdev-reopen > >> > discussed? How is it different from qemu-io's "reopen" command? > >> > What are the options that you can

Re: [Qemu-block] [PATCH v2 00/20] Drain fixes and cleanups, part 3

2018-06-11 Thread Kevin Wolf
ping? Am 29.05.2018 um 19:21 hat Kevin Wolf geschrieben: > This is the third and hopefully for now last part of my work to fix > drain. The main goal of this series is to make drain robust against > graph changes that happen in any callbacks of in-flight requests while > we drain a block node. >

Re: [Qemu-block] [RFC] Intermediate block mirroring

2018-06-11 Thread Alberto Garcia
On Mon 11 Jun 2018 02:20:06 PM CEST, Kevin Wolf wrote: > Am 01.06.2018 um 12:51 hat Alberto Garcia geschrieben: >> On Thu 03 May 2018 02:22:41 PM CEST, Kevin Wolf wrote: >> >> > Were the (more or less) exact requirements of QMP blockdev-reopen >> >> > discussed? How is it different from qemu-io's

Re: [Qemu-block] [PATCH] qemu-img: align is_allocated_sectors to 4k

2018-06-11 Thread Max Reitz
On 2018-06-07 14:46, Peter Lieven wrote: > We currently don't enforce that the sparse segments we detect during convert > are > aligned. This leads to unnecessary and costly read-modify-write cycles either > internally in Qemu or in the background on the storage device as nearly all > modern

Re: [Qemu-block] [PATCH] fixup! python: futurize -f libfuturize.fixes.fix_print_with_import

2018-06-11 Thread Stefan Hajnoczi
On Fri, Jun 08, 2018 at 10:37:45AM -0300, Eduardo Habkost wrote: > On Fri, Jun 08, 2018 at 09:29:43AM -0300, Eduardo Habkost wrote: > > Change all Python code to use print as a function. > > > > This is necessary for Python 3 compatibility. > > > > Done using: > > > > $ py=$( (g grep -l -E

Re: [Qemu-block] [PATCH] qemu-img: align is_allocated_sectors to 4k

2018-06-11 Thread Peter Lieven
Am 11.06.2018 um 15:30 schrieb Max Reitz: On 2018-06-07 14:46, Peter Lieven wrote: We currently don't enforce that the sparse segments we detect during convert are aligned. This leads to unnecessary and costly read-modify-write cycles either internally in Qemu or in the background on the

Re: [Qemu-block] [PATCH] qemu-img: align is_allocated_sectors to 4k

2018-06-11 Thread Max Reitz
On 2018-06-11 15:59, Peter Lieven wrote: > Am 11.06.2018 um 15:30 schrieb Max Reitz: >> On 2018-06-07 14:46, Peter Lieven wrote: >>> We currently don't enforce that the sparse segments we detect during >>> convert are >>> aligned. This leads to unnecessary and costly read-modify-write >>> cycles

Re: [Qemu-block] [Qemu-devel] [PATCH 0/6] More conversions away from old_mmio

2018-06-11 Thread Peter Maydell
On 1 June 2018 at 15:12, Peter Maydell wrote: > Half a dozen miscellaneous conversions away from old_mmio usage > in the MemoryRegionOps struct. This leaves us with only 10 > remaining in the tree. > > NB: mips parts tested only via 'make check'. > > thanks > -- PMM > > Peter Maydell (6): >

Re: [Qemu-block] [PATCH] qemu-img: align is_allocated_sectors to 4k

2018-06-11 Thread Peter Lieven
Am 11.06.2018 um 16:04 schrieb Max Reitz: On 2018-06-11 15:59, Peter Lieven wrote: Am 11.06.2018 um 15:30 schrieb Max Reitz: On 2018-06-07 14:46, Peter Lieven wrote: We currently don't enforce that the sparse segments we detect during convert are aligned. This leads to unnecessary and costly

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-11 Thread Kevin Wolf
Am 06.06.2018 um 16:55 hat Michael S. Tsirkin geschrieben: > On Wed, Jun 06, 2018 at 10:42:33AM -0300, Eduardo Habkost wrote: > > > If we want a grand vision where a single file stores the whole VM, why > > > not invest the work and make it right from the start? > > > > We don't want a grand

[Qemu-block] [PULL 00/29] Block patches

2018-06-11 Thread Max Reitz
The following changes since commit 9f55925b8f50a962d1d08d815044db7767ae3838: Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-3.0-pull-request' into staging (2018-06-11 12:46:16 +0100) are available in the Git repository at: git://github.com/XanClic/qemu.git

[Qemu-block] [PULL 07/29] qemu-img: Add print_amend_option_help()

2018-06-11 Thread Max Reitz
The more generic print_block_option_help() function is not really suitable for qemu-img amend, for a couple of reasons: (1) We do not need to append the protocol-level options, as amendment happens only on one node and does not descend downwards to its children. (2)

[Qemu-block] [PULL 01/29] block/file-posix: Pass FD to locking helpers

2018-06-11 Thread Max Reitz
raw_apply_lock_bytes() and raw_check_lock_bytes() currently take a BDRVRawState *, but they only use the lock_fd field. During image creation, we do not have a BDRVRawState, but we do have an FD; so if we want to reuse the functions there, we should modify them to receive only the FD.

[Qemu-block] [PULL 02/29] block/file-posix: File locking during creation

2018-06-11 Thread Max Reitz
When creating a file, we should take the WRITE and RESIZE permissions. We do not need either for the creation itself, but we do need them for clearing and resizing it. So we can take the proper permissions by replacing O_TRUNC with an explicit truncation to 0, and by taking the appropriate file

[Qemu-block] [PULL 05/29] block: Add Error parameter to bdrv_amend_options

2018-06-11 Thread Max Reitz
Looking at the qcow2 code that is riddled with error_report() calls, this is really how it should have been from the start. Along the way, turn the target_version/current_version comparisons at the beginning of qcow2_downgrade() into assertions (the caller has to make sure these conditions are

[Qemu-block] [PULL 06/29] qemu-option: Pull out "Supported options" print

2018-06-11 Thread Max Reitz
It really is up to the caller to decide what this list of options means. Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Eric Blake Message-id: 20180509210023.20283-4-mre...@redhat.com Signed-off-by: Max Reitz --- qemu-img.c | 1 + util/qemu-option.c | 1 - 2 files

[Qemu-block] [PULL 03/29] iotests: Add creation test to 153

2018-06-11 Thread Max Reitz
This patch adds a test case to 153 which tries to overwrite an image (using qemu-img create) while it is in use. Without the original user explicitly sharing the necessary permissions (writing and truncation), this should not be allowed. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng

[Qemu-block] [PULL 04/29] qemu-img: Amendment support implies create_opts

2018-06-11 Thread Max Reitz
Instead of checking whether a driver has a non-NULL create_opts we should check whether it supports image amendment in the first place. If it does, it must have create_opts. On the other hand, if it does not have create_opts (so it does not support amendment either), the error message "does not

[Qemu-block] [PULL 10/29] iotests: Rework 113

2018-06-11 Thread Max Reitz
This test case has been broken since 398e6ad014df261d (roughly half a year). qemu-img amend requires its output image to be R/W, so it opens it as such; the node is then turned into an read-only node automatically which is now accompanied by a warning, however. This warning has not been part of

[Qemu-block] [PULL 20/29] qemu-img: Special post-backing convert handling

2018-06-11 Thread Max Reitz
Currently, qemu-img convert writes zeroes when it reads zeroes. Sometimes it does not because the target is initialized to zeroes anyway, so we do not need to overwrite (and thus potentially allocate) it. This is never the case for targets with backing files, though. But even they may have an

[Qemu-block] [PULL 23/29] iotests: Fix 219's timing

2018-06-11 Thread Max Reitz
219 has two issues that may lead to sporadic failure, both of which are the result of issuing query-jobs too early after a job has been modified. This can then lead to different results based on whether the modification has taken effect already or not. First, query-jobs is issued right after the

[Qemu-block] [PULL 22/29] iotests: improve pause_job

2018-06-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy It's possible, that job was finished during waiting. In this case we will see error message "Timeout waiting for job to pause" which is not very informative. So, let's check during waiting iteration that the job exists. Signed-off-by: Vladimir

[Qemu-block] [PULL 15/29] qemu-io: Exit with error when a command failed

2018-06-11 Thread Max Reitz
Currently, qemu-io basically always returns success when it gets to interactive mode (so once the whole command line has been parsed; even before the commands on the command line are interpreted). That is not very useful. This patch makes qemu-io return failure when any of the executed commands

[Qemu-block] [PULL 11/29] qcow2: Repair OFLAG_COPIED when fixing leaks

2018-06-11 Thread Max Reitz
Repairing OFLAG_COPIED is usually safe because it is done after the refcounts have been repaired. Therefore, it we did not find anyone else referencing a data or L2 cluster, it makes no sense to not set OFLAG_COPIED -- and the other direction (clearing OFLAG_COPIED) is always safe, anyway, it may

[Qemu-block] [PULL 18/29] qemu-img: Resolve relative backing paths in rebase

2018-06-11 Thread Max Reitz
Currently, rebase interprets a relative path for the new backing image as follows: (1) Open the new backing image with the given relative path (thus relative to qemu-img's working directory). (2) Write it directly into the overlay's backing path field (thus relative to the overlay). If

[Qemu-block] [PULL 19/29] iotests: Add test for rebasing with relative paths

2018-06-11 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-id: 20180509182002.8044-3-mre...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/024 | 82 -- tests/qemu-iotests/024.out | 30 ++ 2 files changed, 109 insertions(+), 3

[Qemu-block] [PULL 25/29] block/qcow2-bitmap: fix free_bitmap_clusters

2018-06-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy This assert may fail, because bitmap_table is not initialized. Just drop it, as it's obvious, that bitmap_table_load sets bitmap_table parameter only when returning zero. Reported-by: Pavel Butsykin Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id:

[Qemu-block] [PULL 14/29] qemu-io: Let command functions return error code

2018-06-11 Thread Max Reitz
This is basically what everything else in the qemu code base does, so we can do it here, too. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-id: 20180509194302.21585-3-mre...@redhat.com Signed-off-by: Max Reitz --- include/qemu-io.h | 9 +- qemu-io-cmds.c| 346

[Qemu-block] [PULL 24/29] qemu-img: Remove deprecated -s snapshot_id_or_name option

2018-06-11 Thread Max Reitz
From: Thomas Huth It has been marked as deprecated since QEMU v2.0 already, so it is time now to finally remove it. Signed-off-by: Thomas Huth Message-id: 1528288551-31641-1-git-send-email-th...@redhat.com Reviewed-by: Jeff Cody Signed-off-by: Max Reitz --- qemu-img.c | 7

Re: [Qemu-block] [RFC PATCH 06/19] block: Fix -blockdev for certain non-string scalars

2018-06-11 Thread Max Reitz
On 2018-06-07 08:25, Markus Armbruster wrote: > Configuration flows through the block subsystem in a rather peculiar > way. Configuration made with -drive enters it as QemuOpts. > Configuration made with -blockdev / blockdev-add enters it as QAPI > type BlockdevOptions. The block subsystem uses

[Qemu-block] [PULL 12/29] iotests: Repairing error during snapshot deletion

2018-06-11 Thread Max Reitz
This adds a test for an I/O error during snapshot deletion, and maybe more importantly, for how to repair the resulting image. If the snapshot has been deleted before the error occurs, the only negative result will be leaked clusters -- and those should be repairable with qemu-img check -r leaks.

[Qemu-block] [PULL 17/29] iotests: Let 216 make use of qemu-io's exit code

2018-06-11 Thread Max Reitz
As a showcase of how you can use qemu-io's exit code to determine success or failure (same for qemu-img), this test is changed to use qemu_io_silent() instead of qemu_io(), and to assert the exit code instead of logging the filtered result. One real advantage of this is that in case of an error,

[Qemu-block] [PULL 13/29] qemu-io: Drop command functions' return values

2018-06-11 Thread Max Reitz
For qemu-io, a function returns an integer with two possible values: 0 for "qemu-io may continue execution", or 1 for "qemu-io should exit". However, there is only a single command that returns 1, and that is "quit". So let's turn this case into a global variable instead so we can make better use

[Qemu-block] [PULL 26/29] throttle: Fix crash on reopen

2018-06-11 Thread Max Reitz
From: Alberto Garcia The throttle block filter can be reopened, and with this it is possible to change the throttle group that the filter belongs to. The way the code does that is the following: - On throttle_reopen_prepare(): create a new ThrottleGroupMember and attach it to the new

[Qemu-block] [PULL 08/29] qemu-img: Recognize no creation support in -o help

2018-06-11 Thread Max Reitz
The only users of print_block_option_help() are qemu-img create and qemu-img convert for the output image, so this function is always used for image creation (it used to be used for amendment also, but that is no longer the case). So if image creation is not supported by either the format or the

[Qemu-block] [PULL 29/29] iotests: Add case for a corrupted inactive image

2018-06-11 Thread Max Reitz
Reviewed-by: John Snow Tested-by: Jeff Cody Reviewed-by: Jeff Cody Signed-off-by: Max Reitz Message-id: 20180606193702.7113-4-mre...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/060 | 30 ++ tests/qemu-iotests/060.out | 14 ++ 2 files

[Qemu-block] [PULL 21/29] iotests: Test post-backing convert target behavior

2018-06-11 Thread Max Reitz
This adds a test case to 122 for what happens when you convert to a target with a backing file that is shorter than the target, and the image format does not support efficient zero writes (as is the case with qcow2 v2). Signed-off-by: Max Reitz Message-id:

[Qemu-block] [PULL 16/29] iotests.py: Add qemu_io_silent

2018-06-11 Thread Max Reitz
With qemu-io now returning a useful exit code, some tests may find it sufficient to just query that instead of logging (and filtering) the whole output. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-id: 20180509194302.21585-5-mre...@redhat.com Signed-off-by: Max Reitz ---

[Qemu-block] [PULL 27/29] block: Make bdrv_is_writable() public

2018-06-11 Thread Max Reitz
This is a useful function for the whole block layer, so make it public. At the same time, users outside of block.c probably do not need to make use of the reopen functionality, so rename the current function to bdrv_is_writable_after_reopen() create a new bdrv_is_writable() function that just

[Qemu-block] [PULL 09/29] iotests: Test help option for unsupporting formats

2018-06-11 Thread Max Reitz
This adds test cases to 082 for qemu-img create/convert/amend "-o help" on formats that do not support creation or amendment, respectively. Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Eric Blake Message-id: 20180509210023.20283-7-mre...@redhat.com Signed-off-by: Max Reitz ---

Re: [Qemu-block] [RFC PATCH 00/19] block: Configuration fixes and rbd authentication

2018-06-11 Thread Max Reitz
On 2018-06-07 08:25, Markus Armbruster wrote: > This series is RFC because: > > * It clashes with parts of Max's "[PATCH 00/13] block: Try to create > well typed json:{} filenames". I missed that one until too late, > sorry. > > - I stole "[PATCH 06/13] block: Add block-specific QDict

[Qemu-block] [PULL 28/29] qcow2: Do not mark inactive images corrupt

2018-06-11 Thread Max Reitz
When signaling a corruption on a read-only image, qcow2 already makes fatal events non-fatal (i.e., they will not result in the image being closed, and the image header's corrupt flag will not be set). This is necessary because we cannot set the corrupt flag on read-only images, and it is

[Qemu-block] [PATCH v2] util/async: avoid NULL pointer dereference

2018-06-11 Thread Jie Wang
if laio_init create linux_aio failed and return NULL, NULL pointer dereference will occur when laio_attach_aio_context dereference linux_aio in aio_get_linux_aio. Let's avoid it and report error. Signed-off-by: Jie Wang --- block/file-posix.c | 19 +-- util/async.c | 5

Re: [Qemu-block] [PATCH v4 03/10] block: Add a mechanism for passing a block driver a block configuration

2018-06-11 Thread Ari Sundholm
Ping regarding this patch and the ones following it in the series. I would very much appreciate any feedback on the new callback and related plumbing I'm proposing for passing things like the guest block device sector size to block drivers (such as the filter type one proposed earlier in this

Re: [Qemu-block] [PULL 00/29] Block patches

2018-06-11 Thread Peter Maydell
On 11 June 2018 at 15:25, Max Reitz wrote: > The following changes since commit 9f55925b8f50a962d1d08d815044db7767ae3838: > > Merge remote-tracking branch > 'remotes/vivier/tags/m68k-for-3.0-pull-request' into staging (2018-06-11 > 12:46:16 +0100) > > are available in the Git repository at: >

Re: [Qemu-block] [Qemu-devel] [PATCH 3/6] hw/block/pflash_cfi02: Convert away from old_mmio

2018-06-11 Thread Philippe Mathieu-Daudé
On 06/01/2018 11:12 AM, Peter Maydell wrote: > Convert the pflash_cfi02 device away from using the old_mmio field > of MemoryRegionOps. > > Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé > --- > hw/block/pflash_cfi02.c | 97 - > 1

Re: [Qemu-block] [Qemu-devel] [PATCH 6/6] hw/char/parallel: Convert away from old_mmio

2018-06-11 Thread Philippe Mathieu-Daudé
On 06/01/2018 11:12 AM, Peter Maydell wrote: > Convert the parallel device away from using the old_mmio field > of MemoryRegionOps. This change only affects the memory-mapped > variant, which is used by the MIPS Jazz boards 'magnum' and 'pica61'. > > Signed-off-by: Peter Maydell Reviewed-by:

Re: [Qemu-block] [Qemu-devel] [PATCH 5/6] hw/input/pckbd: Convert away from old_mmio

2018-06-11 Thread Philippe Mathieu-Daudé
On 06/01/2018 11:12 AM, Peter Maydell wrote: > Convert the pckbd device away from using the old_mmio field > of MemoryRegionOps. This change only affects the memory-mapped > variant of the i8042, which is used by the Unicore32 'puv3' > board and the MIPS Jazz boards 'magnum' and 'pica61'. > >

Re: [Qemu-block] [Qemu-devel] [PATCH v2] util/async: avoid NULL pointer dereference

2018-06-11 Thread Philippe Mathieu-Daudé
Hi Jie, On 06/11/2018 09:42 AM, Jie Wang wrote: > if laio_init create linux_aio failed and return NULL, NULL pointer > dereference will occur when laio_attach_aio_context dereference > linux_aio in aio_get_linux_aio. Let's avoid it and report error. > > Signed-off-by: Jie Wang > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH 1/6] hw/sh/sh7750: Convert away from old_mmio

2018-06-11 Thread Philippe Mathieu-Daudé
On 06/01/2018 11:12 AM, Peter Maydell wrote: > Convert the sh7750 device away from using the old_mmio field > of MemoryRegionOps. This device is used by the sh4 r2d board. > > Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé > --- > hw/sh4/sh7750.c | 44

Re: [Qemu-block] [Qemu-devel] [PATCH 4/6] hw/watchdog/wdt_i6300esb: Convert away from old_mmio

2018-06-11 Thread Philippe Mathieu-Daudé
On 06/01/2018 11:12 AM, Peter Maydell wrote: > Convert the wdt_i6300esb device away from using the old_mmio field > of MemoryRegionOps. > > Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé > --- > hw/watchdog/wdt_i6300esb.c | 48 -- > 1

Re: [Qemu-block] [PATCH v4 00/40] Use the IEC binary prefix definitions

2018-06-11 Thread Eric Blake
On 06/10/2018 08:14 PM, Philippe Mathieu-Daudé wrote: Hi, This series: - split the byte-based definitions from "qemu/cutils.h" to "qemu/units.h" (this now triggers WARNING: 1 added file, does MAINTAINERS need updating?) - clean hw/ includes; - replace different constants used for byte size

Re: [Qemu-block] [PATCH v4 00/40] Use the IEC binary prefix definitions

2018-06-11 Thread Peter Maydell
On 11 June 2018 at 16:55, Eric Blake wrote: > On 06/10/2018 08:14 PM, Philippe Mathieu-Daudé wrote: >> >> Hi, >> >> This series: >> >> - split the byte-based definitions from "qemu/cutils.h" to "qemu/units.h" >>(this now triggers WARNING: 1 added file, does MAINTAINERS need >> updating?) >> -

Re: [Qemu-block] [PATCH v4 00/40] Use the IEC binary prefix definitions

2018-06-11 Thread Cornelia Huck
On Sun, 10 Jun 2018 22:14:21 -0300 Philippe Mathieu-Daudé wrote: > Hi, > > This series: > > - split the byte-based definitions from "qemu/cutils.h" to "qemu/units.h" > (this now triggers WARNING: 1 added file, does MAINTAINERS need updating?) > - clean hw/ includes; > - replace different

Re: [Qemu-block] [VDSM] travis tests fail consistently since Apr 14

2018-06-11 Thread Kevin Wolf
Am 11.06.2018 um 12:43 hat Nir Soffer geschrieben: > On Mon, Jun 11, 2018 at 1:03 PM Maor Lipchuk wrote: > > > On Tue, Jun 5, 2018 at 9:40 AM, Dan Kenigsberg wrote: > > > >> On Mon, Jun 4, 2018 at 7:14 PM, Nir Soffer wrote: > >> > On Mon, Jun 4, 2018 at 6:56 PM Dan Kenigsberg > >> wrote: > >>

Re: [Qemu-block] [PATCH v4 00/40] Use the IEC binary prefix definitions

2018-06-11 Thread Michael S. Tsirkin
On Mon, Jun 11, 2018 at 10:55:17AM -0500, Eric Blake wrote: > On 06/10/2018 08:14 PM, Philippe Mathieu-Daudé wrote: > > Hi, > > > > This series: > > > > - split the byte-based definitions from "qemu/cutils.h" to "qemu/units.h" > >(this now triggers WARNING: 1 added file, does MAINTAINERS

Re: [Qemu-block] [PATCH v2] util/async: avoid NULL pointer dereference

2018-06-11 Thread Jeff Cody
On Tue, Jun 12, 2018 at 07:26:25AM +0800, Jie Wang wrote: > if laio_init create linux_aio failed and return NULL, NULL pointer > dereference will occur when laio_attach_aio_context dereference > linux_aio in aio_get_linux_aio. Let's avoid it and report error. > > Signed-off-by: Jie Wang

Re: [Qemu-block] [VDSM] travis tests fail consistently since Apr 14

2018-06-11 Thread Eric Blake
On 06/11/2018 06:07 PM, Nir Soffer wrote: Correct image files should be aligned to 512 byte sectors, so something is wrong with your image to start with (hard disks don't have half sectors). Ideally, a guest will never see an unaligned image size: qemu should round UP when creating an

[Qemu-block] [PATCH v2] util/async: avoid NULL pointer dereference

2018-06-11 Thread Jie Wang
if laio_init create linux_aio failed and return NULL, NULL pointer dereference will occur when laio_attach_aio_context dereference linux_aio in aio_get_linux_aio. Let's avoid it and report error. Signed-off-by: Jie Wang --- block/file-posix.c | 19 +-- util/async.c | 5

[Qemu-block] [PATCH 0/1] blockdev: implement n-ary bitmap merge

2018-06-11 Thread John Snow
requires: 20180606182449.1607-1-js...@redhat.com See patch for details; this is somewhat an RFC that I suspect will be useful for libvirt in some situations, but maybe it's actually overkill. John Snow (1): blockdev: n-ary bitmap merge blockdev.c | 40

[Qemu-block] [PATCH 1/1] blockdev: n-ary bitmap merge

2018-06-11 Thread John Snow
It might be nice to have an all-or-nothing merge command that either succeeds in merging all bitmaps or fails for all of them. This way, when assembling bitmaps that represent arbitrary points in time from component bitmaps, we always know the state of the target bitmap even in cases of failure.

Re: [Qemu-block] [Qemu-devel] [PATCH 0/1] blockdev: implement n-ary bitmap merge

2018-06-11 Thread John Snow
I mis-typed Vladimir's email, I have corrected it here. On 06/11/2018 06:43 PM, John Snow wrote: > requires: 20180606182449.1607-1-js...@redhat.com > > See patch for details; this is somewhat an RFC that I suspect > will be useful for libvirt in some situations, but maybe it's > actually

Re: [Qemu-block] [VDSM] travis tests fail consistently since Apr 14

2018-06-11 Thread Nir Soffer
On Mon, Jun 11, 2018 at 7:20 PM Kevin Wolf wrote: > Am 11.06.2018 um 12:43 hat Nir Soffer geschrieben: > > On Mon, Jun 11, 2018 at 1:03 PM Maor Lipchuk > wrote: > > > > > On Tue, Jun 5, 2018 at 9:40 AM, Dan Kenigsberg > wrote: > > > > > >> On Mon, Jun 4, 2018 at 7:14 PM, Nir Soffer > wrote: >

[Qemu-block] [PATCH] m25p80: add support for two bytes WRSR for Macronix chips

2018-06-11 Thread Cédric Le Goater
On Macronix chips, two bytes can written to the WRSR. First byte will configure the status register and the second the configuration register. It is important to save the configuration value as it contains the dummy cycle setting when using dual or quad IO mode. Signed-off-by: Cédric Le Goater

Re: [Qemu-block] [PATCH] m25p80: add support for two bytes WRSR for Macronix chips

2018-06-11 Thread Cédric Le Goater
On 06/11/2018 07:15 PM, Cédric Le Goater wrote: > On Macronix chips, two bytes can written to the WRSR. First byte will > configure the status register and the second the configuration > register. It is important to save the configuration value as it > contains the dummy cycle setting when using

Re: [Qemu-block] [RFC PATCH 00/19] block: Configuration fixes and rbd authentication

2018-06-11 Thread Max Reitz
On 2018-06-11 16:52, Max Reitz wrote: > On 2018-06-07 08:25, Markus Armbruster wrote: >> This series is RFC because: >> >> * It clashes with parts of Max's "[PATCH 00/13] block: Try to create >> well typed json:{} filenames". I missed that one until too late, >> sorry. >> >> - I stole

Re: [Qemu-block] [Qemu-devel] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h"

2018-06-11 Thread Stefan Weil
Am 11.06.2018 um 03:14 schrieb Philippe Mathieu-Daudé: > Signed-off-by: Philippe Mathieu-Daudé > --- > block/vdi.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/block/vdi.c b/block/vdi.c > index 668af0a828..35b51dc5c5 100644 > --- a/block/vdi.c > +++

[Qemu-block] [PATCH v2 10/10] iotests: qcow2's encrypt.format is now optional

2018-06-11 Thread Max Reitz
Remove the encrypt.format option from the two blockdev-add test cases for encrypted qcow2 images in 087 to explicitly test that this parameter is now optional. Additionally, show that explicitly specifying encrypt.format=auto works just as well, the same for specifying the correct format

Re: [Qemu-block] [PATCH v2 04/10] qapi: Formalize qcow2 encryption probing

2018-06-11 Thread Eric Blake
On 06/11/2018 03:51 PM, Max Reitz wrote: Currently, you can give no encryption format for a qcow2 file while still passing a key-secret. That does not conform to the schema, so this patch changes the schema to allow it. Signed-off-by: Max Reitz --- qapi/block-core.json | 44

Re: [Qemu-block] [PATCH v2 05/10] qapi: Formalize qcow encryption probing

2018-06-11 Thread Eric Blake
On 06/11/2018 03:51 PM, Max Reitz wrote: qcow only supports a single encryption (and there is no reason why that would change in the future), so we can make it the default. Signed-off-by: Max Reitz --- qapi/block-core.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [Qemu-block] [PATCH v2 04/10] qapi: Formalize qcow2 encryption probing

2018-06-11 Thread Max Reitz
On 2018-06-11 23:02, Eric Blake wrote: > On 06/11/2018 03:51 PM, Max Reitz wrote: >> Currently, you can give no encryption format for a qcow2 file while >> still passing a key-secret.  That does not conform to the schema, so >> this patch changes the schema to allow it. >> >> Signed-off-by: Max

[Qemu-block] [PATCH 0/2] Fix qemu-img map on unaligned image

2018-06-11 Thread Eric Blake
See https://bugzilla.redhat.com/1589738; thanks to Nir, Maor, and Dan for figuring out that it was a qemu-img regression and coming up with a test case; and for Kevin for then bisecting it to point to my byte-based conversion code being at fault. Eric Blake (2): qemu-img: Fix assert when

[Qemu-block] [PATCH 1/2] qemu-img: Fix assert when mapping unaligned raw file

2018-06-11 Thread Eric Blake
Commit a290f085 exposed a latent bug in qemu-img map introduced during the conversion of block status to be byte-based. Earlier in commit 5e344dd8, the internal interface get_block_status() switched to take byte-based parameters, but still called a sector-based block layer function; as such,

[Qemu-block] [PATCH 2/2] iotests: Add test 221 to catch qemu-img map regression

2018-06-11 Thread Eric Blake
Although qemu-img creates aligned files (by rounding up), it must also gracefully handle files that are not sector-aligned. Test that the bug fixed in the previous patch does not recur. It's a bit annoying that we can see the (implicit) hole past the end of the file on to the next sector

[Qemu-block] [PATCH v2 06/10] qdict: Make qdict_flatten() shallow-clone-friendly

2018-06-11 Thread Max Reitz
In its current form, qdict_flatten() removes all entries from nested QDicts that are moved to the root QDict. It is completely sufficient to remove all old entries from the root QDict, however. If the nested dicts have a refcount of 1, this will automatically delete them, too. And if they have a

Re: [Qemu-block] [VDSM] travis tests fail consistently since Apr 14

2018-06-11 Thread Eric Blake
On 06/11/2018 11:19 AM, Kevin Wolf wrote: Opened the following bug: https://bugzilla.redhat.com/1589738 Adding qemu-block It's related to the unaligned image size. Correct image files should be aligned to 512 byte sectors, so something is wrong with your image to start with (hard disks

[Qemu-block] [PATCH v2 02/10] docs/qapi: Document optional discriminators

2018-06-11 Thread Max Reitz
Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- docs/devel/qapi-code-gen.txt | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index 1366228b2a..f0a2101096 100644 ---

[Qemu-block] [PATCH v2 04/10] qapi: Formalize qcow2 encryption probing

2018-06-11 Thread Max Reitz
Currently, you can give no encryption format for a qcow2 file while still passing a key-secret. That does not conform to the schema, so this patch changes the schema to allow it. Signed-off-by: Max Reitz --- qapi/block-core.json | 44 block/qcow2.c

[Qemu-block] [PATCH v2 03/10] tests: Add QAPI optional discriminator tests

2018-06-11 Thread Max Reitz
There already is an optional discriminator test, although it also noted the discriminator name itself as optional. This already gives us one error test case, to which this patch adds various others. Furthermore, a passing test case is added to qapi-schema-test. Signed-off-by: Max Reitz ---

[Qemu-block] [PATCH v2 00/10] block: Try to create well typed json:{} filenames

2018-06-11 Thread Max Reitz
See cover letter of v1 here: http://lists.nongnu.org/archive/html/qemu-block/2018-05/msg00290.html This series depends on Markus's series "block: Configuration fixes and rbd authentication": Based-on: <20180607062559.16127-1-arm...@redhat.com> Changes in v2: - Rebased on top of Markus's

[Qemu-block] [PATCH v2 01/10] qapi: Add default-variant for flat unions

2018-06-11 Thread Max Reitz
This patch allows specifying a discriminator that is an optional member of the base struct. In such a case, a default value must be provided that is used when no value is given. Signed-off-by: Max Reitz --- qapi/introspect.json | 8 + scripts/qapi/common.py | 57

[Qemu-block] [PATCH v2 05/10] qapi: Formalize qcow encryption probing

2018-06-11 Thread Max Reitz
qcow only supports a single encryption (and there is no reason why that would change in the future), so we can make it the default. Signed-off-by: Max Reitz --- qapi/block-core.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

[Qemu-block] [PATCH v2 08/10] block: Try to create well typed json:{} filenames

2018-06-11 Thread Max Reitz
By applying a health mix of qdict_flatten(), qdict_crumple(), qdict_stringify_for_keyval(), the keyval input visitor, and the QObject output visitor (not necessarily in that order), we can at least try to bring bs->full_open_options into accordance with the QAPI schema. This may not always work

[Qemu-block] [PATCH v2 07/10] tests: Add QDict clone-flatten test

2018-06-11 Thread Max Reitz
This new test verifies that qdict_flatten() does not modify a shallow clone of the given QDict. Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/check-block-qdict.c | 33 + 1 file changed, 33 insertions(+) diff --git a/tests/check-block-qdict.c

[Qemu-block] [PATCH v2 09/10] iotests: Test internal option typing

2018-06-11 Thread Max Reitz
It would be nice if qemu used the correct types for blockdev options internally, even if the user specified string values (either through -drive or by being not so nice and using json:{} with string values). This patch adds a test verifying that fact. Signed-off-by: Max Reitz ---

Re: [Qemu-block] [Qemu-devel] [PATCH] m25p80: add support for two bytes WRSR for Macronix chips

2018-06-11 Thread Alistair Francis
On Mon, Jun 11, 2018 at 10:18 AM, Cédric Le Goater wrote: > On 06/11/2018 07:15 PM, Cédric Le Goater wrote: >> On Macronix chips, two bytes can written to the WRSR. First byte will >> configure the status register and the second the configuration >> register. It is important to save the

Re: [Qemu-block] [Qemu-devel] [PATCH 2/2] iotests: Add test 221 to catch qemu-img map regression

2018-06-11 Thread Eric Blake
On 06/11/2018 04:39 PM, Eric Blake wrote: Although qemu-img creates aligned files (by rounding up), it must also gracefully handle files that are not sector-aligned. Test that the bug fixed in the previous patch does not recur. It's a bit annoying that we can see the (implicit) hole past the