qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, Juan Quintela <quintela@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Max Reitz <mreitz@redhat.com>,
	Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>,
	Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>
Subject: Re: [PATCH v10 12/12] migration: introduce snapshot-{save,load,delete} QMP commands
Date: Tue, 2 Feb 2021 12:14:23 -0600	[thread overview]
Message-ID: <02126b54-f7eb-5ad7-b7f0-b66e60b26b50@redhat.com> (raw)
In-Reply-To: <20210202154138.246464-13-berrange@redhat.com>

On 2/2/21 9:41 AM, Daniel P. Berrangé wrote:
> savevm, loadvm and delvm are some of the few HMP commands that have never
> been converted to use QMP. The reasons for the lack of conversion are
> that they blocked execution of the event thread, and the semantics
> around choice of disks were ill-defined.
> 

> Note that the existing "query-named-block-nodes" can be used to query
> what snapshots currently exist for block nodes.
> 
> Acked-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  migration/savevm.c                            | 184 +++++++
>  qapi/job.json                                 |   9 +-
>  qapi/migration.json                           | 157 ++++++
>  .../tests/internal-snapshots-qapi             | 386 +++++++++++++
>  .../tests/internal-snapshots-qapi.out         | 520 ++++++++++++++++++

Not this patch's fault: I find the name tests/qemu-iotests/tests/name to
be rather long and a bit repetitive; maybe we want to rename the
directory structure to something simpler, like:

tests/iotests/name

(that is, move the named tests into a sibling directory of
qemu-iotests/check, rather than a subdirectory).  And maybe rename
qemu-iotests/check to something that requires less typing.  Oh, and
while I'm asking for rainbows and ponies, being able to run check from
the same directory where I run make, instead of having to change
directories, would be nice.  But as I said, that's a wish list for a
separate series.

For _this_ patch,

> +++ b/migration/savevm.c

> +++ b/qapi/migration.json

> +# Example:
> +#
> +# -> { "execute": "snapshot-save",
> +#      "data": {
> +#         "job-id": "snapsave0",
> +#         "tag": "my-snap",
> +#         "vmstate": "disk0",
> +#         "devices": ["disk0", "disk1"]
> +#      }
> +#    }
> +# <- { "return": { } }
> +# <- {"event": "JOB_STATUS_CHANGE",
> +#     "data": {"status": "created", "id": "snapsave0"}}

Nice example here with events...

> +##
> +# @snapshot-delete:
> +#
> +# Delete a VM snapshot
> +#
> +# @job-id: identifier for the newly created job
> +# @tag: name of the snapshot to delete.
> +# @devices: list of block device node names to delete a snapshot from
> +#
> +# Applications should not assume that the snapshot save is complete
> +# when this command returns. The job commands / events must be used
> +# to determine completion and to fetch details of any errors that arise.

...which makes this paragraph feel out of place: there is no snapshot
save going on during snapshot-delete, and...

> +#
> +# Returns: nothing
> +#
> +# Example:
> +#
> +# -> { "execute": "snapshot-delete",
> +#      "data": {
> +#         "job-id": "snapdelete0",
> +#         "tag": "my-snap",
> +#         "devices": ["disk0", "disk1"]
> +#      }
> +#    }
> +# <- { "return": { } }

...the example shows no events.  On the other hand...

> +++ b/tests/qemu-iotests/tests/internal-snapshots-qapi
> @@ -0,0 +1,386 @@
> +#!/usr/bin/env bash
> +# group: rw auto quick snapshot
> +#

> +_cleanup()
> +{
> +    _cleanup_qemu
> +    _cleanup_test_img
> +    TEST_IMG="$TEST_IMG.alt1" _cleanup_test_img
> +    TEST_IMG="$TEST_IMG.alt2" _cleanup_test_img
> +    rm -f "$SOCK_DIR/nbd"

$SOCK_DIR/nbd seems like a rather generic name, liable to collide with
other tests.  Oh right, we still haven't improved './check' to be able
to run tests in parallel each in their own subdirectory, so we aren't
pulling the rug out from any other parallel test because there are no
other parallel tests.


> +run_delete()
> +{
> +    local job=$1
> +    local devices=$2
> +    local fail=$3
> +
> +    _send_qemu_cmd $QEMU_HANDLE "{\"execute\": \"snapshot-delete\",
> +                                  \"arguments\": {
> +                                     \"job-id\": \"$job\",
> +                                     \"tag\": \"snap0\",
> +                                     \"devices\": $devices}}" "return"
> +    if [ $fail = 0 ]; then
> +        # job status: waiting, pending
> +        wait_job $job "JOB_STATUS_CHANGE" "JOB_STATUS_CHANGE"
> +    else
> +        # job status: aborting
> +        wait_job $job "JOB_STATUS_CHANGE"

...you ARE testing that it uses events.  Looks like you have a tweak to
make to the QAPI docs still.


> +echo
> +echo "=====  Snapshot bad error reporting to stderr ====="
> +echo
> +
> +# This demonstrates that we're not capturing vmstate loading failures
> +# into QMP errors, they're ending up in stderr instead. vmstate needs
> +# to report errors via Error object but that is a major piece of work
> +# for the future. This test case's expected output log will need
> +# adjusting when that is done.

At least you documented what to expect down the road ;)

Overall, we're really close.  If you post the necessary tweaks to squash
in to the migration.json file, I could give R-b.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2021-02-02 18:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 15:41 [PATCH v10 00/12] migration: bring improved savevm/loadvm/delvm to QMP Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 01/12] block: push error reporting into bdrv_all_*_snapshot functions Daniel P. Berrangé
2021-02-02 17:25   ` Eric Blake
2021-02-02 15:41 ` [PATCH v10 02/12] migration: Make save_snapshot() return bool, not 0/-1 Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 03/12] migration: stop returning errno from load_snapshot() Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 04/12] block: add ability to specify list of blockdevs during snapshot Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 05/12] block: allow specifying name of block device for vmstate storage Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 06/12] block: rename and alter bdrv_all_find_snapshot semantics Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 07/12] migration: control whether snapshots are ovewritten Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 08/12] migration: wire up support for snapshot device selection Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 09/12] migration: introduce a delete_snapshot wrapper Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 10/12] iotests: add support for capturing and matching QMP events Daniel P. Berrangé
2021-02-02 15:41 ` [PATCH v10 11/12] iotests: fix loading of common.config from tests/ subdir Daniel P. Berrangé
2021-02-02 16:13   ` Vladimir Sementsov-Ogievskiy
2021-02-02 16:24   ` Philippe Mathieu-Daudé
2021-02-02 15:41 ` [PATCH v10 12/12] migration: introduce snapshot-{save, load, delete} QMP commands Daniel P. Berrangé
2021-02-02 18:14   ` Eric Blake [this message]
2021-02-02 18:43     ` [PATCH v10 12/12] migration: introduce snapshot-{save,load,delete} " Vladimir Sementsov-Ogievskiy
2021-02-02 18:56       ` Eric Blake

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=02126b54-f7eb-5ad7-b7f0-b66e60b26b50@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=vsementsov@virtuozzo.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).