All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Pavel Butsykin <pbutsykin@virtuozzo.com>,
	Jeff Cody <jcody@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 11/16] block: simplify drive-backup
Date: Thu, 21 Jul 2016 17:21:32 -0600	[thread overview]
Message-ID: <579158FC.9080402@redhat.com> (raw)
In-Reply-To: <1469130019-18497-12-git-send-email-den@openvz.org>

[-- Attachment #1: Type: text/plain, Size: 2274 bytes --]

On 07/21/2016 01:40 PM, Denis V. Lunev wrote:
> From: Pavel Butsykin <pbutsykin@virtuozzo.com>
> 
> Now that we can support boxed commands, use it to greatly reduce the
> number of parameters (and likelihood of getting out of sync) when
> adjusting drive-backup parameters..

s/.././

> 
> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Jeff Cody <jcody@redhat.com>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Eric Blake <eblake@redhat.com>
> CC: John Snow <jsnow@redhat.com>
> CC: Stefan Hajnoczi <stefanha@redhat.com>
> CC: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c           | 115 +++++++++++++++++----------------------------------
>  hmp.c                |  29 ++++++++-----
>  qapi/block-core.json |   3 +-
>  3 files changed, 58 insertions(+), 89 deletions(-)
> 

> +++ b/hmp.c
> @@ -1109,8 +1109,24 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
>      const char *format = qdict_get_try_str(qdict, "format");
>      bool reuse = qdict_get_try_bool(qdict, "reuse", false);
>      bool full = qdict_get_try_bool(qdict, "full", false);
> -    enum NewImageMode mode;
>      Error *err = NULL;
> +    DriveBackup backup = {
> +        .device = (char *)device,
> +        .target = (char *)filename,
> +        .has_format = !!format,
> +        .format = (char *)format,
> +        .sync = full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
> +        .has_mode = true,
> +        .mode = reuse ? NEW_IMAGE_MODE_EXISTING : NEW_IMAGE_MODE_ABSOLUTE_PATHS,

Good.

> +        .has_speed = false,
> +        .speed = 0,
> +        .has_bitmap = false,
> +        .bitmap = NULL,
> +        .has_on_source_error = false,
> +        .on_source_error = 0,
> +        .has_on_target_error = false,
> +        .on_target_error = 0,

I'd drop these. C guarantees that they'll be zero-initialized, and
unless HMP has a way to set them to non-default values, it's not worth
wasting the lines of code.

With those fixups,
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-07-21 23:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 19:40 [Qemu-devel] [PATCH v6 00/16] backup compression Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 01/16] block: switch blk_write_compressed() to byte-based interface Denis V. Lunev
2016-07-21 23:08   ` Eric Blake
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 02/16] block: Convert bdrv_pwrite_compressed() to BdrvChild Denis V. Lunev
2016-07-21 23:10   ` Eric Blake
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 03/16] block/io: reuse bdrv_co_pwritev() for write compressed Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 04/16] qcow2: add qcow2_co_pwritev_compressed Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 05/16] qcow2: cleanup qcow2_co_pwritev_compressed to avoid the recursion Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 06/16] vmdk: add vmdk_co_pwritev_compressed Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 07/16] qcow: add qcow_co_pwritev_compressed Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 08/16] qcow: cleanup qcow_co_pwritev_compressed to avoid the recursion Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 09/16] block: remove BlockDriver.bdrv_write_compressed Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 10/16] block/io: turn on dirty_bitmaps for the compressed writes Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 11/16] block: simplify drive-backup Denis V. Lunev
2016-07-21 23:21   ` Eric Blake [this message]
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 12/16] block: simplify blockdev-backup Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 13/16] drive-backup: added support for data compression Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 14/16] blockdev-backup: " Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 15/16] qemu-iotests: test backup compression in 055 Denis V. Lunev
2016-07-21 19:40 ` [Qemu-devel] [PATCH v6 16/16] qemu-iotests: add vmdk for " Denis V. Lunev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=579158FC.9080402@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbutsykin@virtuozzo.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.