[Qemu-block] [PATCH v7 01/10] block: Introduce API for copy offloading

2018-05-29 Thread Fam Zheng
Introduce the bdrv_co_copy_range() API for copy offloading. Block drivers implementing this API support efficient copy operations that avoid reading each block from the source device and writing it to the destination devices. Examples of copy offload primitives are SCSI EXTENDED COPY and Linux

[Qemu-block] [PATCH v7 02/10] raw: Check byte range uniformly

2018-05-29 Thread Fam Zheng
We don't verify the request range against s->size in the I/O callbacks except for raw_co_pwritev. This is inconsistent (especially for raw_co_pwrite_zeroes and raw_co_pdiscard), so fix them, in the meanwhile make the helper reusable by the coming new callbacks. Note that in most cases the block

[Qemu-block] [PATCH v7 00/10] qemu-img convert with copy offloading

2018-05-29 Thread Fam Zheng
v7: Fix qcow2. v6: Pick up rev-by from Stefan and Eric. Tweak patch 2 commit message. v5: - Fix raw offset/bytes check for read. [Eric] - Fix qcow2_handle_l2meta. [Stefan] - Add coroutine_fn whereever appropriate. [Stefan] v4: - Fix raw offset and size. [Eric] - iscsi: Drop

[Qemu-block] [PATCH v7 06/10] iscsi: Query and save device designator when opening

2018-05-29 Thread Fam Zheng
The device designator data returned in INQUIRY command will be useful to fill in source/target fields during copy offloading. Do this when connecting to the target and save the data for later use. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/iscsi.c| 41

[Qemu-block] [PATCH v7 07/10] iscsi: Create and use iscsi_co_wait_for_task

2018-05-29 Thread Fam Zheng
This loop is repeated a growing number times. Make a helper. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake --- block/iscsi.c | 54 +- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git

[Qemu-block] [PATCH v7 05/10] file-posix: Implement bdrv_co_copy_range

2018-05-29 Thread Fam Zheng
With copy_file_range(2), we can implement the bdrv_co_copy_range semantics. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 96 +++-- include/block/raw-aio.h | 10 -- 2 files changed, 101 insertions(+), 5

[Qemu-block] [PATCH v7 04/10] qcow2: Implement copy offloading

2018-05-29 Thread Fam Zheng
The two callbacks are implemented quite similarly to the read/write functions: bdrv_co_copy_range_from maps for read and calls into bs->file or bs->backing depending on the allocation status; bdrv_co_copy_range_to maps for write and calls into bs->file. Reviewed-by: Stefan Hajnoczi

[Qemu-block] [PATCH v7 03/10] raw: Implement copy offloading

2018-05-29 Thread Fam Zheng
Just pass down to ->file. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/raw-format.c | 32 1 file changed, 32 insertions(+) diff --git a/block/raw-format.c b/block/raw-format.c index b69a0674b3..f2e468df6f 100644 --- a/block/raw-format.c +++

[Qemu-block] [PATCH v7 10/10] qemu-img: Convert with copy offloading

2018-05-29 Thread Fam Zheng
The new blk_co_copy_range interface offers a more efficient way in the case of network based storage. Make use of it to allow faster convert operation. Since copy offloading cannot do zero detection ('-S') and compression (-c), only try it when these options are not used. Signed-off-by: Fam

[Qemu-block] [PATCH v7 09/10] block-backend: Add blk_co_copy_range

2018-05-29 Thread Fam Zheng
It's a BlockBackend wrapper of the BDS interface. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 18 ++ include/sysemu/block-backend.h | 4 2 files changed, 22 insertions(+) diff --git a/block/block-backend.c

[Qemu-block] [PATCH v7 08/10] iscsi: Implement copy offloading

2018-05-29 Thread Fam Zheng
Issue EXTENDED COPY (LID1) command to implement the copy_range API. The parameter data construction code is modified from libiscsi's iscsi-dd.c. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/iscsi.c| 219 +++

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

2018-05-29 Thread Kevin Wolf
Am 28.05.2018 um 23:25 hat Richard W.M. Jones geschrieben: > On Mon, May 28, 2018 at 10:20:54PM +0100, Richard W.M. Jones wrote: > > On Mon, May 28, 2018 at 08:38:33PM +0200, Kevin Wolf wrote: > > > Just accessing the image file within a tar archive is possible and we > > > could write a block

Re: [Qemu-block] [PATCH 09/14] qemu-iotests: Rewrite 207 for blockdev-create job

2018-05-29 Thread Jeff Cody
On Fri, May 25, 2018 at 06:33:22PM +0200, Kevin Wolf wrote: > This rewrites the test case 207 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > Most of the test cases stay the same as before (the exception being some > improved 'size' options

[Qemu-block] [PATCH v2 10/20] block: Drain recursively with a single BDRV_POLL_WHILE()

2018-05-29 Thread Kevin Wolf
Anything can happen inside BDRV_POLL_WHILE(), including graph changes that may interfere with its callers (e.g. child list iteration in recursive callers of bdrv_do_drained_begin). Switch to a single BDRV_POLL_WHILE() call for the whole subtree at the end of bdrv_do_drained_begin() to avoid such

[Qemu-block] [PATCH 1/4] hw/block/fdc: Replace error_setg(_abort) by error_report() + abort()

2018-05-29 Thread Philippe Mathieu-Daudé
Use error_report() + abort() instead of error_setg(_abort), as suggested by the "qapi/error.h" documentation: Please don't error_setg(_fatal, ...), use error_report() and exit(), because that's more obvious. Likewise, don't error_setg(_abort, ...), use assert(). Use abort() instead

[Qemu-block] [PATCH 0/4] qapi/error: converts error_setg(_fatal) to error_report() + exit()

2018-05-29 Thread Philippe Mathieu-Daudé
Hi, This series converts error_setg(_fatal) to error_report() + exit() as suggested by the "qapi/error.h" documentation. This reduce Coverity and Clang static analyzer positive falses. See http://lists.nongnu.org/archive/html/qemu-devel/2017-07/msg07585.html: On 07/24/2017 04:52 PM, Eric

Re: [Qemu-block] [PATCH 14/14] block/create: Mark blockdev-create stable

2018-05-29 Thread Jeff Cody
On Fri, May 25, 2018 at 06:33:27PM +0200, Kevin Wolf wrote: > We're ready to declare the blockdev-create job stable. This renames the > corresponding QMP command from x-blockdev-create to blockdev-create. > > Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody > --- > qapi/block-core.json

Re: [Qemu-block] [PATCH 08/14] qemu-iotests: Rewrite 206 for blockdev-create job

2018-05-29 Thread Kevin Wolf
Am 29.05.2018 um 14:27 hat Max Reitz geschrieben: > On 2018-05-25 18:33, Kevin Wolf wrote: > > This rewrites the test case 206 to work with the new x-blockdev-create > > job rather than the old synchronous version of the command. > > > > All of the test cases stay the same as before, but in order

Re: [Qemu-block] [libvirt-users] VM I/O performance drops dramatically during storage migration with drive-mirror

2018-05-29 Thread Eric Blake
On 05/28/2018 07:05 AM, Kashyap Chamarthy wrote: Cc the QEMU Block Layer mailing list (qemu-block@nongnu.org), who might have more insights here; and wrap long lines. ... 170 to less than 10. I also show the figure of this experiment in the attachment of this email. [The attachment should

[Qemu-block] [PATCH v2 14/20] block: Defer .bdrv_drain_begin callback to polling phase

2018-05-29 Thread Kevin Wolf
We cannot allow aio_poll() in bdrv_drain_invoke(begin=true) until we're done with propagating the drain through the graph and are doing the single final BDRV_POLL_WHILE(). Just schedule the coroutine with the callback and increase bs->in_flight to make sure that the polling phase will wait for

Re: [Qemu-block] [PATCH v4] block: fix QEMU crash with scsi-hd and drive_del

2018-05-29 Thread Kevin Wolf
Am 28.05.2018 um 14:03 hat Greg Kurz geschrieben: > Removing a drive with drive_del while it is being used to run an I/O > intensive workload can cause QEMU to crash. > > An AIO flush can yield at some point: > > blk_aio_flush_entry() > blk_co_flush(blk) > bdrv_co_flush(blk->root->bs) >

[Qemu-block] [PATCH v2 17/20] block: Move bdrv_drain_all_begin() out of coroutine context

2018-05-29 Thread Kevin Wolf
Before we can introduce a single polling loop for all nodes in bdrv_drain_all_begin(), we must make sure to run it outside of coroutine context like we already do for bdrv_do_drained_begin(). Signed-off-by: Kevin Wolf --- block/io.c | 22 +- 1 file changed, 17 insertions(+),

[Qemu-block] [PATCH v2 19/20] block: Allow graph changes in bdrv_drain_all_begin/end sections

2018-05-29 Thread Kevin Wolf
bdrv_drain_all_*() used bdrv_next() to iterate over all root nodes and did a subtree drain for each of them. This works fine as long as the graph is static, but sadly, reality looks different. If the graph changes so that root nodes are added or removed, we would have to compensate for this.

Re: [Qemu-block] [PATCH] qcow2: Fix Coverity warning when calculating the refcount cache size

2018-05-29 Thread Kevin Wolf
Am 28.05.2018 um 17:01 hat Alberto Garcia geschrieben: > MIN_REFCOUNT_CACHE_SIZE is 4 and the cluster size is guaranteed to be > at most 2MB, so the minimum refcount cache size (in bytes) is always > going to fit in a 32-bit integer. > > Coverity doesn't know that, and since we're storing the

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

2018-05-29 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180529172156.29311-1-kw...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/20] Drain fixes and cleanups, part 3 === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1

Re: [Qemu-block] [PATCH 06/14] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Jeff Cody
On Fri, May 25, 2018 at 06:33:19PM +0200, Kevin Wolf wrote: > This adds a helper function that logs both the QMP request and the > received response before returning it. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/iotests.py | 11 +++ > 1 file changed, 11 insertions(+) > >

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] qapi/error: converts error_setg(_fatal) to error_report() + exit()

2018-05-29 Thread Auger Eric
Hi, On 05/29/2018 07:48 PM, Philippe Mathieu-Daudé wrote: > Hi, > > This series converts error_setg(_fatal) to error_report() + exit() as > suggested by the "qapi/error.h" documentation. > > This reduce Coverity and Clang static analyzer positive falses. > > See

Re: [Qemu-block] [PATCH 03/14] job: Add error message for failing jobs

2018-05-29 Thread Kevin Wolf
Am 29.05.2018 um 16:43 hat Jeff Cody geschrieben: > On Fri, May 25, 2018 at 06:33:16PM +0200, Kevin Wolf wrote: > > So far we relied on job->ret and strerror() to produce an error message > > for failed jobs. Not surprisingly, this tends to result in completely > > useless messages. > > > > This

[Qemu-block] [PATCH v2 18/20] block: ignore_bds_parents parameter for drain functions

2018-05-29 Thread Kevin Wolf
In the future, bdrv_drained_all_begin/end() will drain all invidiual nodes separately rather than whole subtrees. This means that we don't want to propagate the drain to all parents any more: If the parent is a BDS, it will already be drained separately. Recursing to all parents is unnecessary

Re: [Qemu-block] [PATCH 10/14] qemu-iotests: Rewrite 210 for blockdev-create job

2018-05-29 Thread Jeff Cody
On Fri, May 25, 2018 at 06:33:23PM +0200, Kevin Wolf wrote: > This rewrites the test case 210 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > All of the test cases stay the same as before, but in order to be able > to implement proper job

Re: [Qemu-block] [ovirt-users] Libvirt ERROR cannot access backing file after importing VM from OpenStack

2018-05-29 Thread Eric Blake
On 05/28/2018 05:27 AM, Arik Hadas wrote: [Answering before reading the entire thread; apologies if I'm repeating things, or if I have to chime in again at other spots] Let me demonstrate briefly the flow for OVA: Let's say that we have a VM that is based on a template and has one disk and

[Qemu-block] [PATCH v2 15/16] qemu-iotests: Rewrite 213 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 213 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin

[Qemu-block] [PATCH v2 16/16] block/create: Mark blockdev-create stable

2018-05-29 Thread Kevin Wolf
We're ready to declare the blockdev-create job stable. This renames the corresponding QMP command from x-blockdev-create to blockdev-create. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- qapi/block-core.json | 4 ++-- qapi/job.json | 2 +-

[Qemu-block] [PATCH v2 09/16] qemu-iotests: iotests.py helper for non-file protocols

2018-05-29 Thread Kevin Wolf
This adds two helper functions that are useful for test cases that make use of a non-file protocol (specifically ssh). Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 17 + 1 file changed, 17 insertions(+) diff --git a/tests/qemu-iotests/iotests.py

[Qemu-block] [PATCH v2 06/16] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Kevin Wolf
This adds a helper function that logs both the QMP request and the received response before returning it. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody --- tests/qemu-iotests/iotests.py | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tests/qemu-iotests/iotests.py

[Qemu-block] [PATCH v2 14/16] qemu-iotests: Rewrite 212 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 212 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin

Re: [Qemu-block] [PATCH] nbd/client: Relax handling of large NBD_CMD_BLOCK_STATUS reply

2018-05-29 Thread Eric Blake
On 05/29/2018 10:34 AM, Vladimir Sementsov-Ogievskiy wrote: 04.05.2018 01:26, Eric Blake wrote: The NBD spec is proposing a relaxation of NBD_CMD_BLOCK_STATUS where a server may have the final extent per context give a length beyond the original request, if it can easily prove that subsequent

[Qemu-block] [PATCH v2 12/16] qemu-iotests: Rewrite 210 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 210 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin

[Qemu-block] [PATCH v2 13/16] qemu-iotests: Rewrite 211 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 211 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin

[Qemu-block] [PATCH v2 03/16] job: Add error message for failing jobs

2018-05-29 Thread Kevin Wolf
So far we relied on job->ret and strerror() to produce an error message for failed jobs. Not surprisingly, this tends to result in completely useless messages. This adds a Job.error field that can contain an error string for a failing job, and a parameter to job_completed() that sets the field.

[Qemu-block] [PATCH v2 08/16] qemu-iotests: Add VM.run_job()

2018-05-29 Thread Kevin Wolf
Add an iotests.py function that runs a job and only returns when it is destroyed. An error is logged when the job failed and job-finalize and job-dismiss commands are issued if necessary. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 19 +++ 1 file changed, 19

Re: [Qemu-block] [ovirt-users] Libvirt ERROR cannot access backing file after importing VM from OpenStack

2018-05-29 Thread Nir Soffer
On Mon, May 28, 2018 at 2:38 PM Kevin Wolf wrote: > Am 28.05.2018 um 12:27 hat Arik Hadas geschrieben: > > On Mon, May 28, 2018 at 11:25 AM, Kevin Wolf wrote: > > > > > [ Adding qemu-block ] > > > > > > Am 27.05.2018 um 10:36 hat Arik Hadas geschrieben: > > > > On Thu, May 24, 2018 at 6:13 PM,

Re: [Qemu-block] [PATCH v4] block: fix QEMU crash with scsi-hd and drive_del

2018-05-29 Thread Greg Kurz
On Tue, 29 May 2018 22:19:17 +0200 Kevin Wolf wrote: > Am 28.05.2018 um 14:03 hat Greg Kurz geschrieben: > > Removing a drive with drive_del while it is being used to run an I/O > > intensive workload can cause QEMU to crash. > > > > An AIO flush can yield at some point: > > > >

Re: [Qemu-block] cmdline: How to connect a SD card to a specific SD controller?

2018-05-29 Thread Philippe Mathieu-Daudé
On 05/28/2018 01:30 AM, Philippe Mathieu-Daudé wrote: > Hi, > > I'd like to connect a specific SD card to a specific SDHCI from command > line, and I'm getting a bit lost with command line options. > > I'm using an updated version of this patch, but this is not relevant to > this thread: >

[Qemu-block] [PATCH v2 05/16] qemu-iotests: Add VM.get_qmp_events_filtered()

2018-05-29 Thread Kevin Wolf
This adds a helper function that returns a list of QMP events that are already filtered through filter_qmp_event(). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/iotests.py

[Qemu-block] [PATCH v2 02/16] vhdx: Fix vhdx_co_create() return value

2018-05-29 Thread Kevin Wolf
.bdrv_co_create() is supposed to return 0 on success, but vhdx could return a positive value instead. Fix this. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- block/vhdx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vhdx.c

[Qemu-block] [PATCH v2 11/16] qemu-iotests: Rewrite 207 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 207 to work with the new x-blockdev-create job rather than the old synchronous version of the command. Most of the test cases stay the same as before (the exception being some improved 'size' options that allow distinguishing which command created the image), but in

[Qemu-block] [PATCH v2 10/16] qemu-iotests: Rewrite 206 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 206 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin

[Qemu-block] [PATCH v2 00/16] block: Make blockdev-create a job and stable API

2018-05-29 Thread Kevin Wolf
This changes the x-blockdev-create QMP command so that it doesn't block the monitor and the main loop any more, but starts a background job that performs the image creation. The basic job as implemented here is all that is necessary to make image creation asynchronous and to provide a QMP

[Qemu-block] [PATCH v2 01/16] vdi: Fix vdi_co_do_create() return value

2018-05-29 Thread Kevin Wolf
.bdrv_co_create() is supposed to return 0 on success, but vdi could return a positive value instead. Fix this. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/vdi.c b/block/vdi.c index

[Qemu-block] [PATCH v2 07/16] qemu-iotests: Add iotests.img_info_log()

2018-05-29 Thread Kevin Wolf
This adds a filter function to postprocess 'qemu-img info' input (similar to what _img_info does), and an img_info_log() function that calls 'qemu-img info' and logs the filtered output. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 18 ++ 1 file changed, 18

[Qemu-block] [PATCH v2 04/16] block/create: Make x-blockdev-create a job

2018-05-29 Thread Kevin Wolf
This changes the x-blockdev-create QMP command so that it doesn't block the monitor and the main loop any more, but starts a background job that performs the image creation. The basic job as implemented here is all that is necessary to make image creation asynchronous and to provide a QMP

Re: [Qemu-block] [ovirt-users] Libvirt ERROR cannot access backing file after importing VM from OpenStack

2018-05-29 Thread Nir Soffer
On Tue, May 29, 2018 at 10:43 PM Eric Blake wrote: > On 05/28/2018 05:27 AM, Arik Hadas wrote: > ... > > Few months ago people from the oVirt-storage team checked the qemu > toolset > > and replied that this capability is not yet provided, therefore we > > implemented the workaround described

Re: [Qemu-block] [ovirt-users] Libvirt ERROR cannot access backing file after importing VM from OpenStack

2018-05-29 Thread Eric Blake
On 05/29/2018 04:11 PM, Nir Soffer wrote: I think real streaming is unlikely to happen because most image formats that QEMU supports aren't made that way. If there is a compelling reason, we can consider it, but it would work only with very few target formats and as such would have to be

Re: [Qemu-block] [PATCH v2 00/16] block: Make blockdev-create a job and stable API

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:54PM +0200, Kevin Wolf wrote: > This changes the x-blockdev-create QMP command so that it doesn't block > the monitor and the main loop any more, but starts a background job that > performs the image creation. > I'm sure modifying the drivers is fodder for a future

Re: [Qemu-block] cmdline: How to connect a SD card to a specific SD controller?

2018-05-29 Thread Thomas Huth
On 30.05.2018 01:08, Philippe Mathieu-Daudé wrote: > On 05/28/2018 01:30 AM, Philippe Mathieu-Daudé wrote: >> Hi, >> >> I'd like to connect a specific SD card to a specific SDHCI from command >> line, and I'm getting a bit lost with command line options. >> >> I'm using an updated version of this

Re: [Qemu-block] [PATCH v2 03/16] job: Add error message for failing jobs

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:57PM +0200, Kevin Wolf wrote: > So far we relied on job->ret and strerror() to produce an error message > for failed jobs. Not surprisingly, this tends to result in completely > useless messages. > > This adds a Job.error field that can contain an error string for a

Re: [Qemu-block] [PATCH v2 04/16] block/create: Make x-blockdev-create a job

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:58PM +0200, Kevin Wolf wrote: > This changes the x-blockdev-create QMP command so that it doesn't block > the monitor and the main loop any more, but starts a background job that > performs the image creation. > > The basic job as implemented here is all that is

Re: [Qemu-block] [PATCH v2 05/16] qemu-iotests: Add VM.get_qmp_events_filtered()

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:59PM +0200, Kevin Wolf wrote: > This adds a helper function that returns a list of QMP events that are > already filtered through filter_qmp_event(). > > Signed-off-by: Kevin Wolf > Reviewed-by: Max Reitz Reviewed-by: Jeff Cody > --- >

Re: [Qemu-block] [PATCH v2 07/16] qemu-iotests: Add iotests.img_info_log()

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:39:01PM +0200, Kevin Wolf wrote: > This adds a filter function to postprocess 'qemu-img info' input > (similar to what _img_info does), and an img_info_log() function that > calls 'qemu-img info' and logs the filtered output. > > Signed-off-by: Kevin Wolf Reviewed-by:

Re: [Qemu-block] [PATCH v2 09/16] qemu-iotests: iotests.py helper for non-file protocols

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:39:03PM +0200, Kevin Wolf wrote: > This adds two helper functions that are useful for test cases that make > use of a non-file protocol (specifically ssh). > > Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody > --- > tests/qemu-iotests/iotests.py | 17

Re: [Qemu-block] [PATCH v2 08/16] qemu-iotests: Add VM.run_job()

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:39:02PM +0200, Kevin Wolf wrote: > Add an iotests.py function that runs a job and only returns when it is > destroyed. An error is logged when the job failed and job-finalize and > job-dismiss commands are issued if necessary. > > Signed-off-by: Kevin Wolf

Re: [Qemu-block] [PATCH 03/14] job: Add error message for failing jobs

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > So far we relied on job->ret and strerror() to produce an error message > for failed jobs. Not surprisingly, this tends to result in completely > useless messages. > > This adds a Job.error field that can contain an error string for a > failing job, and a

Re: [Qemu-block] [PATCH v4 14/21] hw: Do not include "sysemu/blockdev.h" if it is not necessary

2018-05-29 Thread Cornelia Huck
On Mon, 28 May 2018 20:27:12 -0300 Philippe Mathieu-Daudé wrote: > Remove those unneeded includes to speed up the compilation > process a little bit. > > Code change produced with: > > $ git grep '#include "sysemu/blockdev.h"' | \ > cut -d: -f-1 | \ > xargs egrep -L >

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

2018-05-29 Thread Max Reitz
On 2018-05-29 08:44, Kevin Wolf wrote: > Am 28.05.2018 um 23:25 hat Richard W.M. Jones geschrieben: >> On Mon, May 28, 2018 at 10:20:54PM +0100, Richard W.M. Jones wrote: >>> On Mon, May 28, 2018 at 08:38:33PM +0200, Kevin Wolf wrote: Just accessing the image file within a tar archive is

Re: [Qemu-block] [PATCH v4 12/21] hw: Do not include "sysemu/block-backend.h" if it is not necessary

2018-05-29 Thread Cornelia Huck
On Mon, 28 May 2018 20:27:10 -0300 Philippe Mathieu-Daudé wrote: > Remove those unneeded includes to speed up the compilation > process a little bit. (Continue 7eceff5b5a1fa cleanup) > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/arm/collie.c | 1 - >

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

2018-05-29 Thread Kevin Wolf
Am 29.05.2018 um 11:23 hat Max Reitz geschrieben: > On 2018-05-28 21:09, Kevin Wolf wrote: > > Am 28.05.2018 um 20:44 hat Max Reitz geschrieben: > >> On 2018-05-28 20:38, Kevin Wolf wrote: > >>> Am 28.05.2018 um 20:30 hat Richard W.M. Jones geschrieben: > On Mon, May 28, 2018 at 08:10:32PM

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

2018-05-29 Thread Max Reitz
On 2018-05-28 21:09, Kevin Wolf wrote: > Am 28.05.2018 um 20:44 hat Max Reitz geschrieben: >> On 2018-05-28 20:38, Kevin Wolf wrote: >>> Am 28.05.2018 um 20:30 hat Richard W.M. Jones geschrieben: On Mon, May 28, 2018 at 08:10:32PM +0200, Max Reitz wrote: > As someone who is just naive and

Re: [Qemu-block] [ovirt-users] Libvirt ERROR cannot access backing file after importing VM from OpenStack

2018-05-29 Thread Kevin Wolf
Am 29.05.2018 um 11:27 hat Richard W.M. Jones geschrieben: > On Mon, May 28, 2018 at 01:27:21PM +0300, Arik Hadas wrote: > > Let me demonstrate briefly the flow for OVA: > > Let's say that we have a VM that is based on a template and has one disk > > and one snapshot, so its volume-chain would be:

Re: [Qemu-block] [PATCH 02/14] vhdx: Fix vhdx_co_create() return value

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > .bdrv_co_create() is supposed to return 0 on success, but vhdx could > return a positive value instead. Fix this. > > Signed-off-by: Kevin Wolf > --- > block/vhdx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Max Reitz

Re: [Qemu-block] [ovirt-users] Libvirt ERROR cannot access backing file after importing VM from OpenStack

2018-05-29 Thread Richard W.M. Jones
On Mon, May 28, 2018 at 01:27:21PM +0300, Arik Hadas wrote: > Let me demonstrate briefly the flow for OVA: > Let's say that we have a VM that is based on a template and has one disk > and one snapshot, so its volume-chain would be: > T -> S -> V > (V is the volume the VM writes to, S is the

Re: [Qemu-block] [PATCH 01/14] vdi: Fix vdi_co_do_create() return value

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > .bdrv_co_create() is supposed to return 0 on success, but vdi could > return a positive value instead. Fix this. > > Signed-off-by: Kevin Wolf > --- > block/vdi.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Max Reitz signature.asc

Re: [Qemu-block] [Qemu-devel] [PATCH v4 20/21] hw/ide: Remove unused include

2018-05-29 Thread Thomas Huth
On 29.05.2018 01:27, Philippe Mathieu-Daudé wrote: > There is no need to include pci.h in this file. > (Continue f23c81073a cleanup). > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/ide/core.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/hw/ide/core.c b/hw/ide/core.c > index

Re: [Qemu-block] [PATCH 04/14] block/create: Make x-blockdev-create a job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This changes the x-blockdev-create QMP command so that it doesn't block > the monitor and the main loop any more, but starts a background job that > performs the image creation. > > The basic job as implemented here is all that is necessary to make image >

Re: [Qemu-block] [PATCH 06/14] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This adds a helper function that logs both the QMP request and the > received response before returning it. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/iotests.py | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git

Re: [Qemu-block] [Qemu-devel] [PATCH v2 21/40] job: Convert block_job_cancel_async() to Job

2018-05-29 Thread Kashyap Chamarthy
On Fri, May 25, 2018 at 10:00:35AM +0200, Kevin Wolf wrote: > Am 24.05.2018 um 19:42 hat John Snow geschrieben: [...] (Randomly chiming in for a small clarification.) > > >> or some other mechanism that accomplishes the same type of behavior. It > > >> would be nice if it did not have to be

Re: [Qemu-block] [PATCH 09/14] qemu-iotests: Rewrite 207 for blockdev-create job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This rewrites the test case 207 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > Most of the test cases stay the same as before (the exception being some > improved 'size' options that allow

Re: [Qemu-block] [PATCH 11/14] qemu-iotests: Rewrite 211 for blockdev-create job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This rewrites the test case 211 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > All of the test cases stay the same as before, but in order to be able > to implement proper job handling, the test

Re: [Qemu-block] [PATCH 05/14] qemu-iotests: Add VM.get_qmp_events_filtered()

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This adds a helper function that returns a list of QMP events that are > already filtered through filter_qmp_event(). > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/iotests.py | 5 + > 1 file changed, 5 insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-block] [Qemu-devel] [PATCH v2 21/40] job: Convert block_job_cancel_async() to Job

2018-05-29 Thread Kashyap Chamarthy
On Tue, May 29, 2018 at 02:30:47PM +0200, Max Reitz wrote: > On 2018-05-29 13:59, Kashyap Chamarthy wrote: > > On Fri, May 25, 2018 at 10:00:35AM +0200, Kevin Wolf wrote: [...] > >> It can, and it already has its final semantics, so nothing has to change > >> before 3.0. job-cancel is equivalent

Re: [Qemu-block] [PATCH 14/14] block/create: Mark blockdev-create stable

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > We're ready to declare the blockdev-create job stable. This renames the > corresponding QMP command from x-blockdev-create to blockdev-create. > > Signed-off-by: Kevin Wolf > --- > qapi/block-core.json | 4 ++-- > qapi/job.json | 2

Re: [Qemu-block] [PATCH 06/14] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Kevin Wolf
Am 29.05.2018 um 13:48 hat Max Reitz geschrieben: > On 2018-05-25 18:33, Kevin Wolf wrote: > > This adds a helper function that logs both the QMP request and the > > received response before returning it. > > > > Signed-off-by: Kevin Wolf > > --- > > tests/qemu-iotests/iotests.py | 11

Re: [Qemu-block] [PATCH 08/14] qemu-iotests: Rewrite 206 for blockdev-create job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This rewrites the test case 206 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > All of the test cases stay the same as before, but in order to be able > to implement proper job handling, the test

Re: [Qemu-block] [Qemu-devel] [PATCH v2 21/40] job: Convert block_job_cancel_async() to Job

2018-05-29 Thread Max Reitz
On 2018-05-29 13:59, Kashyap Chamarthy wrote: > On Fri, May 25, 2018 at 10:00:35AM +0200, Kevin Wolf wrote: >> Am 24.05.2018 um 19:42 hat John Snow geschrieben: > > [...] > > (Randomly chiming in for a small clarification.) > > or some other mechanism that accomplishes the same type of

Re: [Qemu-block] [PATCH 06/14] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Kevin Wolf
Am 29.05.2018 um 14:15 hat Max Reitz geschrieben: > On 2018-05-29 14:12, Kevin Wolf wrote: > > Am 29.05.2018 um 13:48 hat Max Reitz geschrieben: > >> On 2018-05-25 18:33, Kevin Wolf wrote: > >>> This adds a helper function that logs both the QMP request and the > >>> received response before

Re: [Qemu-block] [PATCH 09/14] qemu-iotests: Rewrite 207 for blockdev-create job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This rewrites the test case 207 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > Most of the test cases stay the same as before (the exception being some > improved 'size' options that allow

Re: [Qemu-block] [Qemu-devel] [PATCH v2 21/40] job: Convert block_job_cancel_async() to Job

2018-05-29 Thread Kashyap Chamarthy
On Tue, May 29, 2018 at 03:10:58PM +0200, Kashyap Chamarthy wrote: > On Tue, May 29, 2018 at 02:30:47PM +0200, Max Reitz wrote: [...] > > The special behavior is that you can use block-job-cancel after > > BLOCK_JOB_READY to complete the job, but not pivot to it. I don't think > > we have a

Re: [Qemu-block] [PATCH 13/14] qemu-iotests: Rewrite 213 for blockdev-create job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This rewrites the test case 213 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > All of the test cases stay the same as before, but in order to be able > to implement proper job handling, the test

Re: [Qemu-block] [PATCH 07/14] qemu-iotests: Add iotests.img_info_log()

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This adds a filter function to postprocess 'qemu-img info' input > (similar to what _img_info does), and an img_info_log() function that > calls 'qemu-img info' and logs the filtered output. > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-block] [PATCH 06/14] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Max Reitz
On 2018-05-29 14:12, Kevin Wolf wrote: > Am 29.05.2018 um 13:48 hat Max Reitz geschrieben: >> On 2018-05-25 18:33, Kevin Wolf wrote: >>> This adds a helper function that logs both the QMP request and the >>> received response before returning it. >>> >>> Signed-off-by: Kevin Wolf >>> --- >>>

Re: [Qemu-block] [PATCH 06/14] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Max Reitz
On 2018-05-29 14:39, Kevin Wolf wrote: > Am 29.05.2018 um 14:15 hat Max Reitz geschrieben: >> On 2018-05-29 14:12, Kevin Wolf wrote: >>> Am 29.05.2018 um 13:48 hat Max Reitz geschrieben: On 2018-05-25 18:33, Kevin Wolf wrote: > This adds a helper function that logs both the QMP request

Re: [Qemu-block] [PATCH 10/14] qemu-iotests: Rewrite 210 for blockdev-create job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This rewrites the test case 210 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > All of the test cases stay the same as before, but in order to be able > to implement proper job handling, the test

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

2018-05-29 Thread Eduardo Habkost
On Tue, May 29, 2018 at 12:14:28PM +0200, Kevin Wolf wrote: > Am 29.05.2018 um 11:23 hat Max Reitz geschrieben: > > On 2018-05-28 21:09, Kevin Wolf wrote: > > > Am 28.05.2018 um 20:44 hat Max Reitz geschrieben: > > >> On 2018-05-28 20:38, Kevin Wolf wrote: > > >>> Am 28.05.2018 um 20:30 hat

Re: [Qemu-block] [PATCH 12/14] qemu-iotests: Rewrite 212 for blockdev-create job

2018-05-29 Thread Max Reitz
On 2018-05-25 18:33, Kevin Wolf wrote: > This rewrites the test case 212 to work with the new x-blockdev-create > job rather than the old synchronous version of the command. > > All of the test cases stay the same as before, but in order to be able > to implement proper job handling, the test

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

2018-05-29 Thread Eduardo Habkost
On Tue, May 29, 2018 at 03:03:16PM +0100, Dr. David Alan Gilbert wrote: > * Richard W.M. Jones (rjo...@redhat.com) wrote: > > On Fri, May 18, 2018 at 06:09:56PM +0100, Daniel P. Berrangé wrote: > > > The closest to a cross-hypervisor standard is OVF which can store > > > metadata about required

Re: [Qemu-block] [PATCH 02/14] vhdx: Fix vhdx_co_create() return value

2018-05-29 Thread Jeff Cody
On Fri, May 25, 2018 at 06:33:15PM +0200, Kevin Wolf wrote: > .bdrv_co_create() is supposed to return 0 on success, but vhdx could > return a positive value instead. Fix this. > > Signed-off-by: Kevin Wolf > --- > block/vhdx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff

Re: [Qemu-block] [PATCH 03/14] job: Add error message for failing jobs

2018-05-29 Thread Jeff Cody
On Fri, May 25, 2018 at 06:33:16PM +0200, Kevin Wolf wrote: > So far we relied on job->ret and strerror() to produce an error message > for failed jobs. Not surprisingly, this tends to result in completely > useless messages. > > This adds a Job.error field that can contain an error string for a

Re: [Qemu-block] [PATCH 01/14] vdi: Fix vdi_co_do_create() return value

2018-05-29 Thread Jeff Cody
On Fri, May 25, 2018 at 06:33:14PM +0200, Kevin Wolf wrote: > .bdrv_co_create() is supposed to return 0 on success, but vdi could > return a positive value instead. Fix this. > > Signed-off-by: Kevin Wolf > --- > block/vdi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/block/vdi.c

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

2018-05-29 Thread Dr. David Alan Gilbert
* Richard W.M. Jones (rjo...@redhat.com) wrote: > On Fri, May 18, 2018 at 06:09:56PM +0100, Daniel P. Berrangé wrote: > > The closest to a cross-hypervisor standard is OVF which can store > > metadata about required hardware for a VM. I'm pretty sure it does > > not have the concept of machine

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

2018-05-29 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > Seriously, though: are disk images a sane way to package software? They're not actually terrible. You can just start a VM with them straight away, no unpacking required, no installation time. Especially when used with something like -snapshot.

  1   2   >