[Qemu-devel] [PATCH v3 19/19] block: remove keep_read_only flag from BlockDriverState struct

2012-09-18 Thread Jeff Cody
The keep_read_only flag is no longer used, in favor of the bdrv flag BDRV_O_ALLOW_RDWR. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 2 -- block_int.h | 1 - 2 files changed, 3 deletions(-) diff --git a/block.c b/block.c index ebdbf61..5db1df1 100644 --- a/block.c +++ b/block.c

[Qemu-devel] [PATCH v3 05/19] block: move open flag parsing in raw block drivers to helper functions

2012-09-18 Thread Jeff Cody
Code motion, to move parsing of open flags into a helper function. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 38 -- block/raw-win32.c | 43 +++ 2 files changed, 47 insertions(+), 34 deletions

[Qemu-devel] [PATCH v3 07/19] block: use BDRV_O_NOCACHE instead of s-aligned_buf in raw-posix.c

2012-09-18 Thread Jeff Cody
Rather than check for a non-NULL aligned_buf to determine if raw_aio_submit needs to check for alignment, check for the presence of BDRV_O_NOCACHE in the bs-open_flags. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [Qemu-devel] [PATCH v3 09/19] block: raw-posix image file reopen

2012-09-18 Thread Jeff Cody
On 09/18/2012 05:20 PM, Eric Blake wrote: On 09/18/2012 12:53 PM, Jeff Cody wrote: This is derived from the Supriya Kannery's reopen patches. This contains the raw-posix driver changes for the bdrv_reopen_* functions. All changes are staged into a temporary scratch buffer during the prepare

Re: [Qemu-devel] [PATCH v3 03/19] block: Framework for reopening files safely

2012-09-20 Thread Jeff Cody
On 09/20/2012 07:24 AM, Kevin Wolf wrote: Am 18.09.2012 20:53, schrieb Jeff Cody: This is based on Supriya Kannery's bdrv_reopen() patch series. This provides a transactional method to reopen multiple images files safely. Image files are queue for reopen via bdrv_reopen_queue

Re: [Qemu-devel] [PATCH v3 09/19] block: raw-posix image file reopen

2012-09-20 Thread Jeff Cody
On 09/20/2012 10:10 AM, Kevin Wolf wrote: Am 18.09.2012 20:53, schrieb Jeff Cody: This is derived from the Supriya Kannery's reopen patches. This contains the raw-posix driver changes for the bdrv_reopen_* functions. All changes are staged into a temporary scratch buffer during the prepare

Re: [Qemu-devel] [PATCH v3 14/19] block: vmdk image file reopen

2012-09-20 Thread Jeff Cody
On 09/20/2012 10:12 AM, Kevin Wolf wrote: Am 18.09.2012 20:53, schrieb Jeff Cody: This patch supports reopen for VMDK image files. VMDK extents are added to the existing reopen queue, so that the transactional model of reopen is maintained with multiple image files. Signed-off-by: Jeff Cody

Re: [Qemu-devel] [PATCH v3 04/19] block: move aio initialization into a helper function

2012-09-20 Thread Jeff Cody
On 09/20/2012 09:14 AM, Kevin Wolf wrote: Am 18.09.2012 20:53, schrieb Jeff Cody: Move AIO initialization for raw-posix block driver into a helper function. In addition to just code motion, the aio_ctx pointer is checked for NULL, prior to calling laio_init(), to make sure laio_init() is only

[Qemu-devel] [PATCH v4 02/19] block: make bdrv_set_enable_write_cache() modify open_flags

2012-09-20 Thread Jeff Cody
-by: Jeff Cody jc...@redhat.com --- block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block.c b/block.c index 4c0e7f5..458bcc9 100644 --- a/block.c +++ b/block.c @@ -2168,6 +2168,13 @@ int bdrv_enable_write_cache(BlockDriverState *bs) void bdrv_set_enable_write_cache

[Qemu-devel] [PATCH v4 04/19] block: move aio initialization into a helper function

2012-09-20 Thread Jeff Cody
Move AIO initialization for raw-posix block driver into a helper function. In addition to just code motion, the aio_ctx pointer is checked for NULL, prior to calling laio_init(), to make sure laio_init() is only run once. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 53

[Qemu-devel] [PATCH v4 17/19] block: vpc image file reopen

2012-09-20 Thread Jeff Cody
There is currently nothing that needs to be done for VPC image file reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/vpc.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index c0b82c4..b6bf52f 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -265,6

[Qemu-devel] [PATCH v4 03/19] block: Framework for reopening files safely

2012-09-20 Thread Jeff Cody
for the reopen * opaque pointer for any driver-specific data that needs to be persistent from _prepare to _commit/_abort * reopen queue pointer, if the driver needs to queue additional BDS for a reopen Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 232

[Qemu-devel] [PATCH v4 01/19] block: correctly set the keep_read_only flag

2012-09-20 Thread Jeff Cody
, ro = 1 | v [ snap-1 ] kro = 0, ro = 1 | v [ snap-2 ] kro = 0, ro = 1 | v [ active ] kro = 0, ro = 0 Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 14 +++--- block.h | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/block.c b

[Qemu-devel] [PATCH v4 18/19] block: convert bdrv_commit() to use bdrv_reopen()

2012-09-20 Thread Jeff Cody
Currently, bdrv_commit() reopens images r/w itself, via risky _delete() and _open() calls. Use the new safe method for drive reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 48 +--- 1 file changed, 5 insertions(+), 43 deletions(-) diff

[Qemu-devel] [PATCH v4 08/19] block: purge s-aligned_buf and s-aligned_buf_size from raw-posix.c

2012-09-20 Thread Jeff Cody
The aligned_buf pointer and aligned_buf size are no longer used in raw_posix.c, so remove all references to them. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/block/raw-posix.c b/block

[Qemu-devel] [PATCH v4 10/19] block: raw image file reopen

2012-09-20 Thread Jeff Cody
These are the stubs for the file reopen drivers for the raw format. There is currently nothing that needs to be done by the raw driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/raw.c b/block/raw.c

[Qemu-devel] [PATCH v4 15/19] block: raw-win32 driver reopen support

2012-09-20 Thread Jeff Cody
, this is not always feasible, and there are times when we must close the existing file and then open the new file, breaking the transactional nature of the reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-win32.c | 105 ++ 1 file changed, 105

[Qemu-devel] [PATCH v4 16/19] block: vdi image file reopen

2012-09-20 Thread Jeff Cody
There is currently nothing that needs to be done for VDI reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/vdi.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/vdi.c b/block/vdi.c index 550cf58..f35b12e 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -454,6 +454,12

[Qemu-devel] [PATCH v4 11/19] block: qed image file reopen

2012-09-20 Thread Jeff Cody
These are the stubs for the file reopen drivers for the qed format. There is currently nothing that needs to be done by the qed driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/qed.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/qed.c b/block/qed.c

[Qemu-devel] [PATCH v4 07/19] block: use BDRV_O_NOCACHE instead of s-aligned_buf in raw-posix.c

2012-09-20 Thread Jeff Cody
Rather than check for a non-NULL aligned_buf to determine if raw_aio_submit needs to check for alignment, check for the presence of BDRV_O_NOCACHE in the bs-open_flags. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[Qemu-devel] [PATCH v4 00/19] block: bdrv_reopen() patches

2012-09-20 Thread Jeff Cody
, not necessarily safe. If anyone knows a better way to do it under win32, without potentially having to close the handle first, please let me know. Patch 15/16: New patch, move bdrv_commit to use bdrv_reopen() Patch 16/16: [Kevin] Get rid of keep_read_only flag completely Jeff

[Qemu-devel] [PATCH v4 09/19] block: raw-posix image file reopen

2012-09-20 Thread Jeff Cody
(), the duplicate/new fd is closed. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 114 ++ 1 file changed, 114 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 0ffb3d0..28d439f 100644 --- a/block/raw-posix.c +++ b

[Qemu-devel] [PATCH v4 14/19] block: vmdk image file reopen

2012-09-20 Thread Jeff Cody
This patch supports reopen for VMDK image files. VMDK extents are added to the existing reopen queue, so that the transactional model of reopen is maintained with multiple image files. Signed-off-by: Jeff Cody jc...@redhat.com --- block/vmdk.c | 35 +++ 1 file

[Qemu-devel] [PATCH v4 06/19] block: do not parse BDRV_O_CACHE_WB in block drivers

2012-09-20 Thread Jeff Cody
Block drivers should ignore BDRV_O_CACHE_WB in .bdrv_open flags, and in the bs-open_flags. This patch removes the code, leaving the behaviour behind as if BDRV_O_CACHE_WB was set. Signed-off-by: Jeff Cody jc...@redhat.com --- block/iscsi.c | 4 block/raw-posix.c | 3 --- block/raw

[Qemu-devel] [PATCH v4 19/19] block: remove keep_read_only flag from BlockDriverState struct

2012-09-20 Thread Jeff Cody
The keep_read_only flag is no longer used, in favor of the bdrv flag BDRV_O_ALLOW_RDWR. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 2 -- block_int.h | 1 - 2 files changed, 3 deletions(-) diff --git a/block.c b/block.c index 84544d2..751ebdc 100644 --- a/block.c +++ b/block.c

[Qemu-devel] [PATCH v4 13/19] block: qcow image file reopen

2012-09-20 Thread Jeff Cody
These are the stubs for the file reopen drivers for the qcow format. There is currently nothing that needs to be done by the qcow driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/qcow.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/qcow.c b/block

[Qemu-devel] [PATCH v4 05/19] block: move open flag parsing in raw block drivers to helper functions

2012-09-20 Thread Jeff Cody
Code motion, to move parsing of open flags into a helper function. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 38 -- block/raw-win32.c | 43 +++ 2 files changed, 47 insertions(+), 34 deletions

[Qemu-devel] [PATCH v4 12/19] block: qcow2 image file reopen

2012-09-20 Thread Jeff Cody
These are the stubs for the file reopen drivers for the qcow2 format. There is currently nothing that needs to be done by the qcow2 driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/qcow2.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/qcow2.c b/block

Re: [Qemu-devel] [PATCH v4 15/19] block: raw-win32 driver reopen support

2012-09-21 Thread Jeff Cody
On 09/21/2012 04:43 AM, Paolo Bonzini wrote: Il 21/09/2012 10:33, Kevin Wolf ha scritto: +/* could not reopen the file handle, so fall back to opening + * new file (CreateFile) */ +if (raw_s-hfile == INVALID_HANDLE_VALUE) { +raw_s-hfile = CreateFile(state-bs-filename,

[Qemu-devel] [PATCH v2 6/7] qemu-iotests: add initial tests for live block commit

2012-09-25 Thread Jeff Cody
that 'block-commit' with the 'speed' parameter sets the speed parameter, as reported by 'query-block-jobs' 3. Verifies that a bogus 'device' parameter to 'block-commit' results in error Signed-off-by: Jeff Cody jc...@redhat.com --- tests/qemu-iotests/040 | 142

[Qemu-devel] [PATCH v2 4/7] block: helper function, to find the base image of a chain

2012-09-25 Thread Jeff Cody
This is a simple helper function, that will return the base image of a given image chain. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 16 block.h | 1 + 2 files changed, 17 insertions(+) diff --git a/block.c b/block.c index d044529..4a9bdc1 100644 --- a/block.c

[Qemu-devel] [PATCH v2 5/7] QAPI: add command for live block commit, 'block-commit'

2012-09-25 Thread Jeff Cody
. If the active layer is passed in currently as top, or top is left to the default, then an error will be returned. The is done as a block job, so upon completion a BLOCK_JOB_COMPLETED will be emitted. Signed-off-by: Jeff Cody jc...@redhat.com --- QMP/qmp-events.txt | 6

[Qemu-devel] [PATCH v2 1/7] block: add support functions for live commit, to find and delete images.

2012-09-25 Thread Jeff Cody
- active Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 150 block.h | 4 ++ 2 files changed, 154 insertions(+) diff --git a/block.c b/block.c index 751ebdc..d044529 100644 --- a/block.c +++ b/block.c @@ -1724,6

[Qemu-devel] [PATCH v2 0/7] Live block commit

2012-09-25 Thread Jeff Cody
on the reopen() series with transactional reopen. * The target release for this series is 1.3 * Found some mistakes in the reopen calls * Dropped the BlockdevOnError argument (for now), will add in if rebasing on top of Paolo's series. * Used the new qerror system Jeff Cody (7): block: add

[Qemu-devel] [PATCH v2 7/7] block: after creating a live snapshot, make old image read-only

2012-09-25 Thread Jeff Cody
on the bdrv_reopen() series. Signed-off-by: Jeff Cody jc...@redhat.com --- blockdev.c | 5 + 1 file changed, 5 insertions(+) diff --git a/blockdev.c b/blockdev.c index 6f1080c..fa7efae 100644 --- a/blockdev.c +++ b/blockdev.c @@ -803,6 +803,11 @@ void qmp_transaction(BlockdevActionList *dev_list

[Qemu-devel] [PATCH v2 2/7] block: add live block commit functionality

2012-09-25 Thread Jeff Cody
, intermediate images are deleted, and the chain stitched together. Images are restored to their original open flags upon completion. Signed-off-by: Jeff Cody jc...@redhat.com --- block/Makefile.objs | 1 + block/commit.c | 246

[Qemu-devel] [PATCH v2 3/7] blockdev: rename block_stream_cb to a generic block_job_cb

2012-09-25 Thread Jeff Cody
Signed-off-by: Jeff Cody jc...@redhat.com --- blockdev.c | 6 +++--- trace-events | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/blockdev.c b/blockdev.c index 7c83baa..9caa16f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1063,12 +1063,12 @@ static QObject

Re: [Qemu-devel] [PATCH v2 6/7] qemu-iotests: add initial tests for live block commit

2012-09-25 Thread Jeff Cody
On 09/25/2012 02:02 PM, Eric Blake wrote: On 09/25/2012 10:29 AM, Jeff Cody wrote: Derived from the streaming test cases (030), this adds the following tests: 1. For the following image chain, commit [mid] into [backing], and use qemu-io to verify [backing] has its original data

Re: [Qemu-devel] [PATCH v2 2/7] block: add live block commit functionality

2012-09-25 Thread Jeff Cody
On 09/25/2012 02:12 PM, Eric Blake wrote: On 09/25/2012 10:29 AM, Jeff Cody wrote: This adds the live commit coroutine. This iteration focuses on the commit only below the active layer, and not the active layer itself. The behaviour is similar to block streaming; the sectors are walked

Re: [Qemu-devel] [PATCH v2 4/7] block: helper function, to find the base image of a chain

2012-09-25 Thread Jeff Cody
On 09/25/2012 03:13 PM, Eric Blake wrote: On 09/25/2012 10:29 AM, Jeff Cody wrote: This is a simple helper function, that will return the base image of a given image chain. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 16 block.h | 1 + 2 files changed, 17

Re: [Qemu-devel] [PATCH v2 5/7] QAPI: add command for live block commit, 'block-commit'

2012-09-25 Thread Jeff Cody
On 09/25/2012 03:42 PM, Eric Blake wrote: On 09/25/2012 10:29 AM, Jeff Cody wrote: The command for live block commit is added, which has the following arguments: device: the block device to perform the commit on (mandatory) base: the base image to commit into; optional (if not specified

Re: [Qemu-devel] [PATCH v2 7/7] block: after creating a live snapshot, make old image read-only

2012-09-26 Thread Jeff Cody
On 09/26/2012 10:20 AM, Kevin Wolf wrote: Am 25.09.2012 18:29, schrieb Jeff Cody: Currently, after a live snapshot of a drive, the image that has been 'demoted' to be below the new active layer remains r/w. This patch reopens it read-only. Note that we do not check for error on the reopen

Re: [Qemu-devel] [PATCH v2 5/7] QAPI: add command for live block commit, 'block-commit'

2012-09-26 Thread Jeff Cody
On 09/26/2012 10:13 AM, Kevin Wolf wrote: Am 25.09.2012 18:29, schrieb Jeff Cody: The command for live block commit is added, which has the following arguments: device: the block device to perform the commit on (mandatory) base: the base image to commit into; optional (if not specified

[Qemu-devel] [PATCH v3 0/6] Live block commit

2012-09-27 Thread Jeff Cody
(for now), will add in if rebasing on top of Paolo's series. * Used the new qerror system Jeff Cody (6): block: add support functions for live commit, to find and delete images. block: add live block commit functionality blockdev: rename block_stream_cb to a generic block_job_cb block

[Qemu-devel] [PATCH v3 1/6] block: add support functions for live commit, to find and delete images.

2012-09-27 Thread Jeff Cody
- active Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 143 block.h | 4 ++ 2 files changed, 147 insertions(+) diff --git a/block.c b/block.c index 751ebdc..54209a5 100644 --- a/block.c +++ b/block.c @@ -1724,6

[Qemu-devel] [PATCH v3 4/6] block: helper function, to find the base image of a chain

2012-09-27 Thread Jeff Cody
This is a simple helper function, that will return the base image of a given image chain. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 16 block.h | 1 + 2 files changed, 17 insertions(+) diff --git a/block.c b/block.c index 54209a5..d7a6d14 100644 --- a/block.c

[Qemu-devel] [PATCH v3 5/6] QAPI: add command for live block commit, 'block-commit'

2012-09-27 Thread Jeff Cody
in as top, then an error will be returned. Once merging down the active layer is supported, the 'top' argument may become optional, and default to the active layer. The is done as a block job, so upon completion a BLOCK_JOB_COMPLETED will be emitted. Signed-off-by: Jeff Cody jc

[Qemu-devel] [PATCH v3 6/6] qemu-iotests: add initial tests for live block commit

2012-09-27 Thread Jeff Cody
is nonexistent * base is nonexistent * top == active layer (this is currently not supported) * top and base arguments are reversed * top argument is omitted Signed-off-by: Jeff Cody jc...@redhat.com --- tests/qemu-iotests/040 | 178 + tests

Re: [Qemu-devel] [PATCH v3 5/6] QAPI: add command for live block commit, 'block-commit'

2012-09-27 Thread Jeff Cody
On 09/27/2012 01:57 PM, Eric Blake wrote: On 09/27/2012 11:29 AM, Jeff Cody wrote: The command for live block commit is added, which has the following arguments: device: the block device to perform the commit on (mandatory) base: the base image to commit into; optional (if not specified

[Qemu-devel] [PATCH v3 3/6] blockdev: rename block_stream_cb to a generic block_job_cb

2012-09-27 Thread Jeff Cody
Signed-off-by: Jeff Cody jc...@redhat.com --- blockdev.c | 6 +++--- trace-events | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/blockdev.c b/blockdev.c index 7c83baa..9caa16f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1063,12 +1063,12 @@ static QObject

Re: [Qemu-devel] [PATCH v2 21/45] block: add bdrv_open_backing_file

2012-09-27 Thread Jeff Cody
On 09/26/2012 11:56 AM, Paolo Bonzini wrote: Mirroring runs without the backing file so that it can be copied outside QEMU. However, we need to add it at the time the job is completed and QEMU switches to the target. Factor out the common bits of opening an image and completing a mirroring

[Qemu-devel] [PATCH v3 2/6] block: add live block commit functionality

2012-09-27 Thread Jeff Cody
, intermediate images are deleted, and the chain stitched together. Images are restored to their original open flags upon completion. Signed-off-by: Jeff Cody jc...@redhat.com --- block/Makefile.objs | 1 + block/commit.c | 267

Re: [Qemu-devel] [PATCH v2 27/45] qmp: add drive-mirror command

2012-09-27 Thread Jeff Cody
On 09/26/2012 11:56 AM, Paolo Bonzini wrote: This adds the monitor commands that start the mirroring job. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- blockdev.c | 125 ++- hmp-commands.hx | 21 ++ hmp.c

Re: [Qemu-devel] [PATCH v2 09/45] block: rename block_job_complete to block_job_completed

2012-09-27 Thread Jeff Cody
On 09/27/2012 08:30 AM, Kevin Wolf wrote: Am 26.09.2012 17:56, schrieb Paolo Bonzini: The imperative will be used for the QMP command. Signed-off-by: Paolo Bonzini pbonz...@redhat.com I would still be glad if we found a better name. Having two functions block_job_complete() and

Re: [Qemu-devel] [PATCH 1/3] qapi: Allow QMP/QAPI commands to have array inputs

2012-02-22 Thread Jeff Cody
On 02/22/2012 09:53 AM, Anthony Liguori wrote: On 02/20/2012 11:31 AM, Jeff Cody wrote: The QAPI scripts allow for generating commands that receive parameter input consisting of a list of custom structs, but the QMP input paramter checking did not support receiving a qlist as opposed to a qdict

Re: [Qemu-devel] [PATCH 1/3] qapi: Allow QMP/QAPI commands to have array inputs

2012-02-22 Thread Jeff Cody
On 02/22/2012 12:35 PM, Anthony Liguori wrote: On 02/22/2012 10:12 AM, Jeff Cody wrote: On 02/22/2012 09:53 AM, Anthony Liguori wrote: On 02/20/2012 11:31 AM, Jeff Cody wrote: The QAPI scripts allow for generating commands that receive parameter input consisting of a list of custom structs

Re: [Qemu-devel] [PATCH 1/3] qapi: Allow QMP/QAPI commands to have array inputs

2012-02-22 Thread Jeff Cody
On 02/22/2012 12:56 PM, Anthony Liguori wrote: On 02/22/2012 11:47 AM, Eric Blake wrote: On 02/22/2012 10:35 AM, Anthony Liguori wrote: [1] JSON schema definition: { 'type': 'SnapshotDev', 'data': {'device': 'str', 'snapshot-file': 'str', '*format': 'str' } } { 'command':

[Qemu-devel] [PATCH v2 0/2] Group Live Snapshots

2012-02-26 Thread Jeff Cody
the contents of the current top bs? Jeff Cody (2): qapi: Introduce blockdev-group-snapshot-sync command QMP: Add qmp command for blockdev-group-snapshot-sync block.c | 47 block.h |1 + blockdev.c | 128

[Qemu-devel] [PATCH v2 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-26 Thread Jeff Cody
to remain consistent with each other, even across snapshot failures. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 47 block.h |1 + blockdev.c | 128 ++ qapi-schema.json | 38

[Qemu-devel] [PATCH v2 2/2] QMP: Add qmp command for blockdev-group-snapshot-sync

2012-02-26 Thread Jeff Cody
/file.img + format:snapshot format. e.g., qcow2. Optional There is no HMP equivalent for the command. Signed-off-by: Jeff Cody jc...@redhat.com --- qmp-commands.hx | 39 +++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/qmp

Re: [Qemu-devel] [PATCH v2 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-27 Thread Jeff Cody
On 02/27/2012 06:13 AM, Stefan Hajnoczi wrote: On Sun, Feb 26, 2012 at 7:31 PM, Jeff Cody jc...@redhat.com wrote: Do you have automated tests for this feature? No, not yet. The testing has been manual. +/* + * Add new bs contents at the top of an image chain while the chain is live

Re: [Qemu-devel] [PATCH v2 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-27 Thread Jeff Cody
On 02/27/2012 09:40 AM, Stefan Hajnoczi wrote: On Mon, Feb 27, 2012 at 2:26 PM, Jeff Cody jc...@redhat.com wrote: On 02/27/2012 06:13 AM, Stefan Hajnoczi wrote: On Sun, Feb 26, 2012 at 7:31 PM, Jeff Cody jc...@redhat.com wrote: Do you have automated tests for this feature? No, not yet

Re: [Qemu-devel] [PATCH v2 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-27 Thread Jeff Cody
On 02/27/2012 10:46 AM, Kevin Wolf wrote: Am 26.02.2012 20:31, schrieb Jeff Cody: This is a QAPI/QMP only command to take a snapshot of a group of devices. This is similar to the blockdev-snapshot-sync command, except blockdev-group-snapshot-sync accepts a list devices, filenames, and formats

Re: [Qemu-devel] [PATCH v2 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-27 Thread Jeff Cody
On 02/27/2012 12:22 PM, Kevin Wolf wrote: Am 27.02.2012 18:02, schrieb Jeff Cody: + +/* keep the same entry in bdrv_states */ +pstrcpy(tmp.device_name, sizeof(tmp.device_name), bs_top-device_name); +tmp.list = bs_top-list; + +/* swap contents of the fixed new bs

[Qemu-devel] [PATCH v3 0/2] Group Live Snapshots

2012-02-27 Thread Jeff Cody
: - Note at the top of the BlockDriverState struct Jeff Cody (2): qapi: Introduce blockdev-group-snapshot-sync command QMP: Add qmp command for blockdev-group-snapshot-sync block.c | 80 block.h |1 + block_int.h |6

[Qemu-devel] [PATCH v3 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-27 Thread Jeff Cody
to remain consistent with each other, even across snapshot failures. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 80 block.h |1 + block_int.h |6 +++ blockdev.c | 133

[Qemu-devel] [PATCH v3 2/2] QMP: Add qmp command for blockdev-group-snapshot-sync

2012-02-27 Thread Jeff Cody
/file.img + format:snapshot format. e.g., qcow2. Optional There is no HMP equivalent for the command. Signed-off-by: Jeff Cody jc...@redhat.com --- qmp-commands.hx | 39 +++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/qmp

[Qemu-devel] [PATCH v4 2/2] QMP: Add qmp command for blockdev-group-snapshot-sync

2012-02-28 Thread Jeff Cody
/file.img + format:snapshot format. e.g., qcow2. Optional There is no HMP equivalent for the command. Signed-off-by: Jeff Cody jc...@redhat.com --- qmp-commands.hx | 39 +++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/qmp

[Qemu-devel] [PATCH v4 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-28 Thread Jeff Cody
to remain consistent with each other, even across snapshot failures. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 81 + block.h |1 + block_int.h |6 +++ blockdev.c | 132

[Qemu-devel] [PATCH v4 0/2] Group Live Snapshots

2012-02-28 Thread Jeff Cody
. This differs from v3 in that: * blockdev.c - QSIMPLEQ_INSERT_TAIL() moved to right after the malloc * block.c - tmp.backing_file set as well Jeff Cody (2): qapi: Introduce blockdev-group-snapshot-sync command QMP: Add qmp command for blockdev-group-snapshot-sync block.c

[Qemu-devel] [PATCH v5 0/2] Group Live Snapshots

2012-02-28 Thread Jeff Cody
. This differs from v4 in that: * blockdev.c - all failures in the group snapshot command should go to delete_and_fail Jeff Cody (2): qapi: Introduce blockdev-group-snapshot-sync command QMP: Add qmp command for blockdev-group-snapshot-sync block.c | 81

[Qemu-devel] [PATCH v5 1/2] qapi: Introduce blockdev-group-snapshot-sync command

2012-02-28 Thread Jeff Cody
to remain consistent with each other, even across snapshot failures. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 81 + block.h |1 + block_int.h |6 +++ blockdev.c | 131

[Qemu-devel] [PATCH v5 2/2] QMP: Add qmp command for blockdev-group-snapshot-sync

2012-02-28 Thread Jeff Cody
/file.img + format:snapshot format. e.g., qcow2. Optional There is no HMP equivalent for the command. Signed-off-by: Jeff Cody jc...@redhat.com --- qmp-commands.hx | 39 +++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/qmp

[Qemu-devel] [PATCH] monitor: Remove unused bool field 'qapi' in mon_cmd_t struct

2012-03-12 Thread Jeff Cody
Some minor code cleanup: the 'qapi' bool field in mon_cmd_t is unused, and can be removed. Signed-off-by: Jeff Cody jc...@redhat.com --- monitor.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/monitor.c b/monitor.c index a787aab..34272eb 100644 --- a/monitor.c +++ b

Re: [Qemu-devel] [PATCH 3/3] qapi: convert sendkey

2012-05-25 Thread Jeff Cody
On 05/25/2012 09:00 AM, Luiz Capitulino wrote: On Fri, 25 May 2012 14:20:33 +0800 Amos Kong ak...@redhat.com wrote: On 25/05/12 11:51, Eric Blake wrote: On 05/24/2012 09:32 PM, Amos Kong wrote: Convert 'sendkey' to use. do_sendkey() depends on some variables in monitor.c, so reserve

Re: [Qemu-devel] [PATCH 4/8] block: add mirror job

2012-05-30 Thread Jeff Cody
On 04/13/2012 12:23 PM, Paolo Bonzini wrote: This patch adds the implementation of a new job that mirrors a disk to a new image while letting the guest continue using the old image. The target is treated as a black box and data is copied from the source to the target in the background. The

Re: [Qemu-devel] [PATCH 3/7] block: fix snapshot with QED format

2012-04-10 Thread Jeff Cody
Cc: Jeff Cody jc...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block.c | 10 ++ block/qed.c |7 +++ block/vvfat.c |7 +++ block_int.h |1 + 4 files changed, 25 insertions(+) diff --git a/block.c b/block.c index b3117ef

[Qemu-devel] [RFC PATCH] block: for a streaming job, fix relative base name arguments

2012-04-11 Thread Jeff Cody
it so that it is stored in the top-layer image relative to the top-layer image: base(bak:) - snap2(bak:../a/base.raw) Signed-off-by: Jeff Cody jc...@redhat.com I submitted this as an RFC, because I had made a few assumptions that I would like to get vetted. Assumptions: 1.) bs-backing_hd-filename

Re: [Qemu-devel] [RFC PATCH] block: for a streaming job, fix relative base name arguments

2012-04-12 Thread Jeff Cody
On 04/12/2012 04:50 AM, Kevin Wolf wrote: Am 11.04.2012 19:29, schrieb Jeff Cody: When block streaming an image, if a base name is passed in that is a relative name, but not accessible from the top-level snapshot, then the relative name is stored incorrectly in the image file. For instance

Re: [Qemu-devel] [RFC PATCH] block: for a streaming job, fix relative base name arguments

2012-04-12 Thread Jeff Cody
On 04/12/2012 09:41 AM, Kevin Wolf wrote: Am 12.04.2012 15:17, schrieb Jeff Cody: + * + * Returns NULL if no relative or absolute path can be found. + */ +static char *path_find_relative(char *current, char *backing) +{ +char *src; +char *dest; +char *src_tmp; +char

[Qemu-devel] [PATCH 0/3] Fix relative pathnames for block streaming

2012-04-17 Thread Jeff Cody
path between two file paths, and fixes for block streaming to use this when a base backing file is specified, and it is not an absolute pathname. 3/3: Tests via qemu-io tests, to verify the correct behavior Jeff Cody (3): cutils: Add multiplatform capability to resolve canonical

[Qemu-devel] [PATCH 1/3] cutils: Add multiplatform capability to resolve canonical filenames

2012-04-17 Thread Jeff Cody
was added. Signed-off-by: Jeff Cody jc...@redhat.com --- configure | 21 + cutils.c | 270 + qemu-common.h |8 ++ 3 files changed, 299 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 671b232..6b204de

[Qemu-devel] [PATCH 3/3] block: qemu-io tests for block streaming, with relative filenames

2012-04-17 Thread Jeff Cody
Verify that after block streaming, if there are base files in different relative directories that the resulting top-level image contains a correct relative pathname to its backing file. Signed-off-by: Jeff Cody jc...@redhat.com --- tests/qemu-iotests/031 | 75

[Qemu-devel] [PATCH 2/3] block: fix relative backing filenames for block streaming

2012-04-17 Thread Jeff Cody
it so that it is stored in the top-layer image relative to the top-layer image. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c|5 +++ block.h|1 + block/stream.c | 12 +++- cutils.c | 92 qemu

Re: [Qemu-devel] [PATCH v2 2/2] vmdk: Read footer for streamOptimized images

2012-08-17 Thread Jeff Cody
= footer.header; +} + l1_entry_sectors = le32_to_cpu(header.num_gtes_per_gte) * le64_to_cpu(header.granularity); if (l1_entry_sectors == 0) { Reviewed-by: Jeff Cody jc...@redhat.com

Re: [Qemu-devel] [RFC PATCH 0/4] Live block commit

2012-08-29 Thread Jeff Cody
missed it when you first sent it). Thanks, Jeff Am Dienstag, den 31.07.2012, 01:16 -0400 schrieb Jeff Cody: These are proposed changes, to add live block commit functionality. I originally had intended for this RFC series to include the more complicated case of a live commit of the active

[Qemu-devel] [PATCH 0/7] block: bdrv_reopen() patches

2012-08-30 Thread Jeff Cody
into temporary stashes in prepare(), and copied over in commit() (discarded in abort()). * Driver-level reopen file changes are mainly contained in the raw-* files. TODO: The raw-win32 driver still needs to be finished TODO: The vmdk driver still needs to be finished Jeff Cody (7): block

[Qemu-devel] [RFC v2 PATCH 6/6] QAPI: add command for live block commit, 'block-commit'

2012-08-30 Thread Jeff Cody
. If the active layer is passed in currently as top, or top is left to the default, then the error QERR_TOP_NOT_FOUND will be returned. The is done as a block job, so upon completion a BLOCK_JOB_COMPLETED will be emitted. Signed-off-by: Jeff Cody jc...@redhat.com --- blockdev.c | 83

[Qemu-devel] [RFC v2 PATCH 4/6] qerror: new error for live block commit, QERR_TOP_NOT_FOUND

2012-08-30 Thread Jeff Cody
Signed-off-by: Jeff Cody jc...@redhat.com --- qerror.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qerror.h b/qerror.h index d0a76a4..7396184 100644 --- a/qerror.h +++ b/qerror.h @@ -219,6 +219,9 @@ void assert_no_error(Error *err); #define QERR_TOO_MANY_FILES

[Qemu-devel] [PATCH 4/7] block: raw image file reopen

2012-08-30 Thread Jeff Cody
These are the stubs for the file reopen drivers for the raw format. There is currently nothing that needs to be done by the raw driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/block/raw.c b

[Qemu-devel] [PATCH 3/7] block: raw-posix image file reopen

2012-08-30 Thread Jeff Cody
(), the duplicate/new fd is closed. Signed-off-by: Jeff Cody jc...@redhat.com --- block/raw-posix.c | 153 +- 1 file changed, 139 insertions(+), 14 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 6be20b1..48086d7 100644 --- a/block/raw

[Qemu-devel] [PATCH 2/7] block: Framework for reopening files safely

2012-08-30 Thread Jeff Cody
in bdrv_reopen_prepare() and in the equivalent driver level functions. If any of the staged images fails a prepare, then all of the images left untouched, and the staged changes for each image abandoned. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 226

[Qemu-devel] [PATCH 5/7] block: qed image file reopen

2012-08-30 Thread Jeff Cody
These are the stubs for the file reopen drivers for the qed format. There is currently nothing that needs to be done by the qed driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/qed.c | 20 1 file changed, 20 insertions(+) diff --git a/block/qed.c b

[Qemu-devel] [RFC v2 PATCH 5/6] block: helper function, to find the base image of a chain

2012-08-30 Thread Jeff Cody
This is a simple helper function, that will return the base image of a given image chain. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 16 block.h | 1 + 2 files changed, 17 insertions(+) diff --git a/block.c b/block.c index 11e275c..5f58600 100644 --- a/block.c

[Qemu-devel] [PATCH 7/7] block: qcow image file reopen

2012-08-30 Thread Jeff Cody
These are the stubs for the file reopen drivers for the qcow format. There is currently nothing that needs to be done by the qcow driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/qcow.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/block

[Qemu-devel] [PATCH 6/7] block: qcow2 image file reopen

2012-08-30 Thread Jeff Cody
These are the stubs for the file reopen drivers for the qcow2 format. There is currently nothing that needs to be done by the qcow2 driver in reopen. Signed-off-by: Jeff Cody jc...@redhat.com --- block/qcow2.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/block

[Qemu-devel] [RFC v2 PATCH 0/6] Live block commit

2012-08-30 Thread Jeff Cody
. * The target release for this series is 1.3 * Found some mistakes in the reopen calls * Dropped the BlockdevOnError argument (for now), will add in if rebasing on top of Paolo's series. * Used the new qerror system Jeff Cody (6): 1/6 block: add support functions for live commit, to find

[Qemu-devel] [RFC v2 PATCH 2/6] block: add live block commit functionality

2012-08-30 Thread Jeff Cody
, intermediate images are deleted, and the chain stitched together. Images are restored to their original open flags upon completion. Signed-off-by: Jeff Cody jc...@redhat.com --- block/Makefile.objs | 1 + block/commit.c | 202

[Qemu-devel] [RFC v2 PATCH 1/6] block: add support functions for live commit, to find and delete images.

2012-08-30 Thread Jeff Cody
- active where top == active is permitted, although active will not be deleted. Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 142 block.h | 5 ++- 2 files changed, 146 insertions(+), 1

[Qemu-devel] [RFC v2 PATCH 3/6] blockdev: rename block_stream_cb to a generic block_job_cb

2012-08-30 Thread Jeff Cody
Signed-off-by: Jeff Cody jc...@redhat.com --- blockdev.c | 8 +--- trace-events | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/blockdev.c b/blockdev.c index 7c83baa..68d65fb 100644 --- a/blockdev.c +++ b/blockdev.c @@ -53,6 +53,8 @@ static const int if_max_devs

<    1   2   3   4   5   6   7   8   9   10   >