Skip to content

covert savevm, loadvm and delvm into qapi

Pavel Hrdina qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 31 repliesIn review
  2. v111 patches 36 repliesSuperseded

Changes in v2 from the cover letter

- patch for updating bdrv_snapshot_goto and bdrv_snapshot_list is split into two patches
- fixes typos and grammar
- vm-snapshot-delete and vm-snapshot-load now returns an error also if snapshot for delete or load not exists
- all error messages starts with uppercase and are without trailing dot
- updated error messages recording to comments

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12qemu-img: introduce qemu_img_handle_error()qemu-img.c+11 -63 replies
2/12block: update error reporting for bdrv_snapshot_delete() and related functionsblock.c block/qcow2-snapshot.c block/qcow2.h +6 more+65 -434 replies
3/12savevm: update bdrv_snapshot_find() to find snapshot by id or name and add error parametersavevm.c+67 -268 replies
4/12qapi: Convert delvmhmp-commands.hx hmp.c hmp.h +4 more+153 -205 replies
5/12block: update error reporting for bdrv_snapshot_goto() and related functionsblock.c block/qcow2-snapshot.c block/qcow2.h +6 more+66 -512 replies
6/12block: update error reporting for bdrv_snapshot_list() and related functionsblock.c block/qcow2-snapshot.c block/qcow2.h +6 more+60 -321 reply
7/12savevm: update error reporting for qemu_loadvm_state()include/sysemu/sysemu.h migration.c savevm.c+40 -381 reply
8/12qapi: Convert loadvmhmp-commands.hx hmp.c hmp.h +6 more+172 -471 reply
9/12block: update error reporting for bdrv_snapshot_create() and related functionsblock.c block/qcow2-snapshot.c block/qcow2.h +6 more+60 -560 replies
10/12savevm: update error reporting of qemu_savevm_state() and related functionsinclude/sysemu/sysemu.h migration.c savevm.c+26 -251 reply
11/12qapi: Convert savevmhmp-commands.hx hmp.c hmp.h +4 more+147 -701 reply
12/12savevm: remove backward compatibility from bdrv_snapshot_find()savevm.c+12 -231 reply

Reviews trailers per patch

4 of 12 patches have a Reviewed-by or Acked-by.

PatchEric BlakeWenchao Xia
1/12R-b R-b
2/12R-b R-b
3/12
4/12
5/12R-b
6/12R-b
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/12] covert savevm, loadvm and delvm into qapi

I'm sending patches for all commands in one patch series because the savevm command depends on delvm command.

This patch series introduces new design of these commands:

* QMP vm-snapshot-save:
- { 'command': 'vm-snapshot-save',
'data': { 'name': 'str' },
'returns': 'SnapshotInfo' }
- vm-snapshot-save returns an error if there is an existing snapshot with the same name
- you cannot provide an id for a new snapshot
- all information about created snapshot will be returned

* QMP vm-snapshot-load
- { 'command': 'vm-snapshot-load',
'data': { '*name': 'str', '*id': 'str' },
'returns': 'SnapshotInfo' }
- one of the name or id must be provided
- if both are provided they will match only the snapshot with the same name and id
- returns SnapshotInfo only if the snapshot exists.

* QMP vm-snapshot-delete:
- { 'command': 'vm-snapshot-delete',
'data': { '*name': 'str', '*id': 'str' },
'returns': 'SnapshotInfo' }
- same rules as vm-snapshot-load

* HMP savevm:
- args_type = "force:-f,name:s?",
- if the name is not provided the HMP command will generates new one for QMP command
- if there is already a snapshot with provided or generated name it will fails
- there will be an optional -f parameter to force saving requested snapshot and it will internally use vm-snapshot-delete and then vm-snapshot-save
- all information about created snapshot will be printed

* HMP loadvm:
- args_type = "id:-i,name:s",
- follow almost the same behavior as the QMP command (QMP command has two parameters but HMP command has one parameter with flag to switch between name and id)
- it load snapshot that match the provided name
- if an id flag is provided, it load snapshot that match the name parameter as an id of snapshot

* HMP delvm:
- args_type = "id:-i,name:s"
- same rules as loadvm

changes from v1:
- patch for updating bdrv_snapshot_goto and bdrv_snapshot_list is split into two patches
- fixes typos and grammar
- vm-snapshot-delete and vm-snapshot-load now returns an error also if snapshot for delete or load not exists
- all error messages starts with uppercase and are without trailing dot
- updated error messages recording to comments

Pavel Hrdina (12):
qemu-img: introduce qemu_img_handle_error()
block: update error reporting for bdrv_snapshot_delete() and related
functions
savevm: update bdrv_snapshot_find() to find snapshot by id or name and
add error parameter
qapi: Convert delvm
block: update error reporting for bdrv_snapshot_goto() and related
functions
block: update error reporting for bdrv_snapshot_list() and related
functions
savevm: update error reporting for qemu_loadvm_state()
qapi: Convert loadvm
block: update error reporting for bdrv_snapshot_create() and related
functions
savevm: update error reporting of qemu_savevm_state() and related
functions
qapi: Convert savevm
savevm: remove backward compatibility from bdrv_snapshot_find()

 block.c                   |  99 ++++++-----
 block/qcow2-snapshot.c    |  63 ++++---
 block/qcow2.h             |  16 +-
 block/rbd.c               |  53 +++---
 block/sheepdog.c          |  66 +++----
 hmp-commands.hx           |  48 +++---
 hmp.c                     | 115 +++++++++++++
 hmp.h                     |   3 +
 include/block/block.h     |  17 +-
 include/block/block_int.h |  17 +-
 include/sysemu/sysemu.h   |  12 +-
 migration.c               |  17 +-
 monitor.c                 |  12 --
 qapi-schema.json          |  54 ++++++
 qemu-img.c                |  50 +++---
 qmp-commands.hx           | 115 +++++++++++++
 savevm.c                  | 428 ++++++++++++++++++++++++++++------------------
 vl.c                      |   7 +-
 18 files changed, 817 insertions(+), 375 deletions(-)
Signature · 1 line
1.8.1.4