From: Stefan Hajnoczi <stefanha@gmail.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, phrdina@redhat.com, famz@redhat.com,
armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com,
stefanha@redhat.com, pbonzini@redhat.com, dietmar@proxmox.com
Subject: Re: [Qemu-devel] [PATCH V3 6/9] qmp: add interface blockdev-snapshot-delete-internal-sync
Date: Thu, 4 Jul 2013 14:42:45 +0200 [thread overview]
Message-ID: <20130704124245.GC4213@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1372300908-7546-7-git-send-email-xiawenc@linux.vnet.ibm.com>
On Thu, Jun 27, 2013 at 10:41:45AM +0800, Wenchao Xia wrote:
> diff --git a/blockdev.c b/blockdev.c
> index ce89f83..35fffd6 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -790,6 +790,67 @@ void qmp_blockdev_snapshot_internal_sync(const char *device,
> &snapshot, errp);
> }
>
> +SnapshotInfo *qmp_blockdev_snapshot_delete_internal_sync(const char *device,
> + bool has_id,
> + const char *id,
> + bool has_name,
> + const char *name,
> + Error **errp)
> +{
> + BlockDriverState *bs = bdrv_find(device);
> + QEMUSnapshotInfo sn;
> + Error *local_err = NULL;
> + SnapshotInfo *info = NULL;
> + int ret;
> +
> + if (!bs) {
> + error_set(errp, QERR_DEVICE_NOT_FOUND, device);
> + return NULL;
> + };
Spurious ';'
> +
> + if (!has_id) {
> + id = NULL;
> + }
> +
> + if (!has_name) {
> + name = NULL;
> + }
> +
> + if (!id && !name) {
> + error_setg(errp, "Name or id must be provided");
> + return NULL;
> + }
> +
> + ret = bdrv_snapshot_find_by_id_and_name(bs, id, name, &sn, &local_err);
> + if (error_is_set(&local_err)) {
> + error_propagate(errp, local_err);
> + return NULL;
> + }
> + if (!ret) {
> + error_setg(errp,
> + "Snapshot with id '%s' and name '%s' do not exist on "
s/do not exist/does not exist/
> diff --git a/qapi-schema.json b/qapi-schema.json
> index fba9b15..ffcdca7 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1760,6 +1760,33 @@
> 'data': { 'device': 'str', 'name': 'str'} }
>
> ##
> +# @blockdev-snapshot-delete-internal-sync
> +#
> +# Synchronously delete an internal snapshot of a block device, when the format
> +# of the image used support it. The snapshot is identified by name or id or
> +# both. One of the name or id is required. It will returns SnapshotInfo of
> +# successfully deleted snapshot.
Return SnapshotInfo for the successfully deleted snapshot.
> +SQMP
> +blockdev-snapshot-delete-internal-sync
> +--------------------------------------
> +
> +Synchronously delete an internal snapshot of a block device when the format of
> +image used support it. The snapshot is identified by name or id or both. One
s/support/supports/
> +of the name or id is required. If the snapshot is not found, operation will
> +fail.
s/One of the name or id/One of name or id/
s/operation will fail/the operation will fail/
next prev parent reply other threads:[~2013-07-04 12:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 2:41 [Qemu-devel] [PATCH V3 0/9] add internal snapshot support at block device level Wenchao Xia
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 1/9] snapshot: new function bdrv_snapshot_find_by_id_and_name() Wenchao Xia
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 2/9] snapshot: add paired functions for internal snapshot id and name Wenchao Xia
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 3/9] snapshot: distinguish id and name in snapshot delete Wenchao Xia
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 4/9] qmp: add internal snapshot support in qmp_transaction Wenchao Xia
2013-07-04 12:35 ` Stefan Hajnoczi
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 5/9] qmp: add interface blockdev-snapshot-internal-sync Wenchao Xia
2013-07-04 12:37 ` Stefan Hajnoczi
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 6/9] qmp: add interface blockdev-snapshot-delete-internal-sync Wenchao Xia
2013-07-04 12:42 ` Stefan Hajnoczi [this message]
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 7/9] hmp: add interface hmp_snapshot_blkdev_internal Wenchao Xia
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 8/9] hmp: add interface hmp_snapshot_delete_blkdev_internal Wenchao Xia
2013-06-27 2:41 ` [Qemu-devel] [PATCH V3 9/9] qemu-iotests: add 056 internal snapshot for block device test case Wenchao Xia
2013-07-03 1:52 ` [Qemu-devel] [PATCH V3 0/9] add internal snapshot support at block device level Wenchao Xia
2013-07-04 12:44 ` Stefan Hajnoczi
2013-07-07 22:38 ` Wenchao Xia
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=20130704124245.GC4213@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=armbru@redhat.com \
--cc=dietmar@proxmox.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=phrdina@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=xiawenc@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).