qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH V2 00/12] add internal snapshot support at block dev


From: Wenchao Xia
Subject: [Qemu-devel] [PATCH V2 00/12] add internal snapshot support at block device level
Date: Fri, 14 Jun 2013 19:39:47 +0800

  This series brings internal snapshot support at block devices level, now we
have two main methods to do snapshot: 1) backing chain and 2) internal one, and
3) Stefan's unmerged backing up approach. Compared with 1), internal snapshot
is faster in R/W/Delete. Compared with 3), it complete faster, take less space
in total, but take more space in local image. As a summary, When user want to
take a local snapshot quickly, it is encouraged to use internal snapshot when
possible for performance reason. If user want to duplicate or backup vm to
another place, it is encouraged to use backing up approach.

  A full view may be: it can take snapshot by 1), 2), and the snapshot can
be exported to 3rd place. it can also directly export/backup data by 3).
export means transfering the data out of qemu/libvirt's scope, let 3rd party
take over.

host A                       backup server B
 vm         --------->
  |           backup
 \|/                     Data that can distinguish base/delta, disk/memory 
snapshot v0   export
snapshot v1 --------->

Next steps to better full VM snapshot:
  Add support to export internal snapshot data lively, possible use qemu-img
or qemu-nbd.
  Better vmstate saving.

Note:
  I think in most case, saving vmstate in an standalone file is better than
saving it inside qcow2, So suggest treat internal snapshot as block level
methods and not encourage user to savevm in qcow2 any more. We can
have "internal snapshot (or backing chain) + standing alone vmstate file" as
replacement.  


Some details:
  To avoid trouble, this serial have hide ID in interfaces, this make sure
no chaos of ID and name will be introduced by these interfaces.
  There is one patch may be common to Pavel's savvm transaction, patch 4/11,
others are not quite related. Patch 4/11 will not set errp when no snapshot
find, since patch 7/11 need to distinguish real error case.

Thanks Kevin to give advisement about how add it in qmp_transaction, oldest
version comes drom Dietmar Maurer.

V2:
  Add test case for it.
  Address Kevin's comments:
  04/12: use assert(id || name), instead of abort().
  05/12: better snapshot_name_wellformed().
  06/12: rename parameter *name to *id_or_name in
find_snapshot_by_id_or_name(), add {} for old code, add a macro in
qemu-common.h to avoid print NULL char*.


  Address Fam Zheng's comments:
  06/12: better error message.
  08/12: better document and spell fix.
  10/12, 11/12: rename the command and related function to
snapshot_blkdev_internal.

Stefan Hajnoczi (3):
  1 blockdev: drop redundant proto_drv check
  2 blockdev: rename BlkTransactionStates to singular
  3 blockdev: allow BdrvActionOps->commit() to be NULL

Wenchao Xia (9):
  4 snapshot: new function bdrv_snapshot_find_by_id_and_name()
  5 snapshot: add paired functions for internal snapshot id and name
  6 snapshot: distinguish id and name in snapshot delete
  7 qmp: add internal snapshot support in qmp_transaction
  8 qmp: add interface blockdev-snapshot-internal-sync
  9 qmp: add interface blockdev-snapshot-delete-internal-sync
  10 hmp: add interface hmp_snapshot_blkdev_internal
  11 hmp: add interface hmp_snapshot_delete_blkdev_internal
  12 qemu-iotests: add 055 internal snapshot for block device test case

 block/qcow2-snapshot.c     |   67 ++++++++---
 block/qcow2.h              |    5 +-
 block/rbd.c                |   19 +++-
 block/sheepdog.c           |    5 +-
 block/snapshot.c           |  130 ++++++++++++++++++++-
 blockdev.c                 |  278 +++++++++++++++++++++++++++++++++-----------
 hmp-commands.hx            |   43 +++++++-
 hmp.c                      |   20 +++
 hmp.h                      |    2 +
 include/block/block_int.h  |    5 +-
 include/block/snapshot.h   |   14 ++-
 include/qemu-common.h      |    3 +
 qapi-schema.json           |   58 +++++++++
 qemu-img.c                 |    5 +-
 qmp-commands.hx            |   93 ++++++++++++++-
 savevm.c                   |   10 ++-
 tests/qemu-iotests/055     |  157 +++++++++++++++++++++++++
 tests/qemu-iotests/055.out |    5 +
 tests/qemu-iotests/group   |    1 +
 19 files changed, 815 insertions(+), 105 deletions(-)
 create mode 100755 tests/qemu-iotests/055
 create mode 100644 tests/qemu-iotests/055.out





reply via email to

[Prev in Thread] Current Thread [Next in Thread]