[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/7] migration: improve error reporting of block driver st
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH v3 1/7] migration: improve error reporting of block driver state name |
Date: |
Thu, 27 Aug 2020 18:17:12 +0100 |
User-agent: |
Mutt/1.14.6 (2020-07-11) |
* Daniel P. Berrangé (berrange@redhat.com) wrote:
> With blockdev, a BlockDriverState may not have a device name,
> so using a node name is required as an alternative.
>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Queuing this one by itself since it's useful anyway.
Dave
> ---
> migration/savevm.c | 12 ++++++------
> tests/qemu-iotests/267.out | 4 ++--
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/migration/savevm.c b/migration/savevm.c
> index a843d202b5..304d98ff78 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -2682,7 +2682,7 @@ int save_snapshot(const char *name, Error **errp)
>
> if (!bdrv_all_can_snapshot(&bs)) {
> error_setg(errp, "Device '%s' is writable but does not support "
> - "snapshots", bdrv_get_device_name(bs));
> + "snapshots", bdrv_get_device_or_node_name(bs));
> return ret;
> }
>
> @@ -2691,7 +2691,7 @@ int save_snapshot(const char *name, Error **errp)
> ret = bdrv_all_delete_snapshot(name, &bs1, errp);
> if (ret < 0) {
> error_prepend(errp, "Error while deleting snapshot on device "
> - "'%s': ", bdrv_get_device_name(bs1));
> + "'%s': ", bdrv_get_device_or_node_name(bs1));
> return ret;
> }
> }
> @@ -2766,7 +2766,7 @@ int save_snapshot(const char *name, Error **errp)
> ret = bdrv_all_create_snapshot(sn, bs, vm_state_size, &bs);
> if (ret < 0) {
> error_setg(errp, "Error while creating snapshot on '%s'",
> - bdrv_get_device_name(bs));
> + bdrv_get_device_or_node_name(bs));
> goto the_end;
> }
>
> @@ -2884,14 +2884,14 @@ int load_snapshot(const char *name, Error **errp)
> if (!bdrv_all_can_snapshot(&bs)) {
> error_setg(errp,
> "Device '%s' is writable but does not support snapshots",
> - bdrv_get_device_name(bs));
> + bdrv_get_device_or_node_name(bs));
> return -ENOTSUP;
> }
> ret = bdrv_all_find_snapshot(name, &bs);
> if (ret < 0) {
> error_setg(errp,
> "Device '%s' does not have the requested snapshot '%s'",
> - bdrv_get_device_name(bs), name);
> + bdrv_get_device_or_node_name(bs), name);
> return ret;
> }
>
> @@ -2920,7 +2920,7 @@ int load_snapshot(const char *name, Error **errp)
> ret = bdrv_all_goto_snapshot(name, &bs, errp);
> if (ret < 0) {
> error_prepend(errp, "Could not load snapshot '%s' on '%s': ",
> - name, bdrv_get_device_name(bs));
> + name, bdrv_get_device_or_node_name(bs));
> goto err_drain;
> }
>
> diff --git a/tests/qemu-iotests/267.out b/tests/qemu-iotests/267.out
> index d6d80c099f..215902b3ad 100644
> --- a/tests/qemu-iotests/267.out
> +++ b/tests/qemu-iotests/267.out
> @@ -81,11 +81,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
> Testing: -blockdev driver=file,filename=TEST_DIR/t.IMGFMT,node-name=file
> QEMU X.Y.Z monitor - type 'help' for more information
> (qemu) savevm snap0
> -Error: Device '' is writable but does not support snapshots
> +Error: Device 'file' is writable but does not support snapshots
> (qemu) info snapshots
> No available block device supports snapshots
> (qemu) loadvm snap0
> -Error: Device '' is writable but does not support snapshots
> +Error: Device 'file' is writable but does not support snapshots
> (qemu) quit
>
> Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
> --
> 2.26.2
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- [PATCH v3 0/7] migration: bring improved savevm/loadvm/delvm to QMP, Daniel P . Berrangé, 2020/08/27
- [PATCH v3 1/7] migration: improve error reporting of block driver state name, Daniel P . Berrangé, 2020/08/27
- Re: [PATCH v3 1/7] migration: improve error reporting of block driver state name,
Dr. David Alan Gilbert <=
- [PATCH v3 2/7] block: push error reporting into bdrv_all_*_snapshot functions, Daniel P . Berrangé, 2020/08/27
- [PATCH v3 3/7] migration: stop returning errno from load_snapshot(), Daniel P . Berrangé, 2020/08/27
- [PATCH v3 4/7] block: add ability to specify list of blockdevs during snapshot, Daniel P . Berrangé, 2020/08/27
- [PATCH v3 5/7] block: allow specifying name of block device for vmstate storage, Daniel P . Berrangé, 2020/08/27
- [PATCH v3 6/7] iotests: add support for capturing and matching QMP events, Daniel P . Berrangé, 2020/08/27
- [PATCH v3 7/7] migration: introduce snapshot-{save, load, delete} QMP commands, Daniel P . Berrangé, 2020/08/27