diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index 69ade0534f..39b82e8ef5 100644 --- a/block/monitor/block-hmp-cmds.c +++ b/block/monitor/block-hmp-cmds.c @@ -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); } diff --git a/hmp-commands.hx b/hmp-commands.hx index ea4a1db78f..f0b8d8914c 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -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"