[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v13 08/14] qemu-img: Implement commit like QMP
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v13 08/14] qemu-img: Implement commit like QMP |
Date: |
Wed, 22 Oct 2014 10:22:54 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 10/22/2014 06:51 AM, Max Reitz wrote:
> qemu-img should use QMP commands whenever possible in order to ensure
> feature completeness of both online and offline image operations. As
> qemu-img itself has no access to QMP (since this would basically require
> just everything being linked into qemu-img), imitate QMP's
> implementation of block-commit by using commit_active_start() and then
> waiting for the block job to finish.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/Makefile.objs | 3 +-
> qemu-img.c | 82
> ++++++++++++++++++++++++++++++++++++++++-------------
> 2 files changed, 64 insertions(+), 21 deletions(-)
>
> +done:
> blk_unref(blk);
> - if (ret) {
> +
> + if (local_err) {
> + qerror_report_err(local_err);
> + error_free(local_err);
> return 1;
Igor has a patch that simplifies this style of cleanup:
https://lists.gnu.org/archive/html/qemu-devel/2014-10/msg01992.html
But it does so by using exit(1) instead of return 1, not to mention that
there are probably a lot of places in qemu-img.c that could be similarly
cleaned at the same time as a separate patch.
So for this patch, as-is,
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v13 09/14] qemu-img: Empty image after commit, Max Reitz, 2014/10/22
[Qemu-devel] [PATCH v13 10/14] qemu-img: Enable progress output for commit, Max Reitz, 2014/10/22
[Qemu-devel] [PATCH v13 11/14] qemu-img: Specify backing file for commit, Max Reitz, 2014/10/22