mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-10-28 11:54:41 +08:00
hmp: fix snapshot_blkdev argument type
The `snapshot-file` argument for `snapshot_blkdev` is mandatory. Correct
the `args_type` definition to reflect this.
Fixes: 6106e2492f ("qapi: Convert blockdev_snapshot_sync")
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260828-qemu-no-hmp-v5-4-9227de146347@redhat.com>
This commit is contained in:
1 parent
25ad0dbb74
commit
a22c9e5056
2 files changed
+2
-12
No files matched your search
@@ -344,25 +344,15 @@ void hmp_block_job_complete(Monitor *mon, const QDict *qdict)
|
||||
void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
const char *device = qdict_get_str(qdict, "device");
|
||||
const char *filename = qdict_get_try_str(qdict, "snapshot-file");
|
||||
const char *filename = qdict_get_str(qdict, "snapshot-file");
|
||||
const char *format = qdict_get_try_str(qdict, "format");
|
||||
bool reuse = qdict_get_try_bool(qdict, "reuse", false);
|
||||
enum NewImageMode mode;
|
||||
Error *err = NULL;
|
||||
|
||||
if (!filename) {
|
||||
/*
|
||||
* In the future, if 'snapshot-file' is not specified, the snapshot
|
||||
* will be taken internally. Today it's actually required.
|
||||
*/
|
||||
error_setg(&err, QERR_MISSING_PARAMETER, "snapshot-file");
|
||||
goto end;
|
||||
}
|
||||
|
||||
mode = reuse ? NEW_IMAGE_MODE_EXISTING : NEW_IMAGE_MODE_ABSOLUTE_PATHS;
|
||||
qmp_blockdev_snapshot_sync(device, NULL, filename, NULL, format,
|
||||
true, mode, &err);
|
||||
end:
|
||||
hmp_handle_error(mon, err);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1173,7 +1173,7 @@ ERST
|
||||
|
||||
{
|
||||
.name = "snapshot_blkdev",
|
||||
.args_type = "reuse:-n,device:B,snapshot-file:s?,format:s?",
|
||||
.args_type = "reuse:-n,device:B,snapshot-file:s,format:s?",
|
||||
.params = "[-n] device [new-image-file] [format]",
|
||||
.help = "initiates a live snapshot\n\t\t\t"
|
||||
"of device. If a new image file is specified, the\n\t\t\t"
|
||||
|
||||
Reference in new issue
Block a user