[libvirt] [PATCHv6 0/5] Handling of undefine and redefine snapshots with VirtualBox 4.2

Manuel VIVES manuel.vives at diateam.net
Thu Jan 23 09:28:28 UTC 2014

This is a serie of patches in order to support undefining and redefining
snapshots with VirtualBox 4.2.

The serie of patches is rather big, and adds among other things some utility
functions unrelated to VirtualBox in patches 1 & 2.
The code review could be done in several parts: e.g. patches 1 & 2 separately to
validate the utility functions.

The VirtualBox API provides only high level operations to manipulate snapshots,
so it not possible to support flags like VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE and
Following an IRC talk with Eric Blake, the decision was taken to emulate these
behaviours by manipulating directly the .vbox XML files.

The first two patches are some util methods for handling regexp and strings that
will be used after.

The third patch brings more details in the snapshot XML returned by libvirt.
We will need those modifications in order to redefine the snapshots.

The fourth patch brings the support of the VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE
and VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT flags in virDomainSnapshotCreateXML.

The fifth and last patch brings the support of the
flag in virDomainSnapshotDelete.

The patches are only tested with Virtualbox 4.2 but the code is
compliant with Virtualbox 4.3 API.

Manuel VIVES

* Rebased because of a massive change in vbox_tmpl.c due to changes in
the handling of different versions of VirtualBox

* The patches are modified according to a first review by Laine Stump:
    * renamed virSearchUuid to virSearchRegex and moved it from
        viruuid.{c,h} to virstring.{c,h}.
    * Various fixes.

* The code is compliant with Virtualbox 4.3 API
* Some minor modifications in order to satisfy "make syntax-check"

* Use of STREQ_NULLABLE instead of STREQ in one case
* Fix the method for finding uuids according to Ján Tomko review

* Fix a licence problem with the method for string replacement

Manuel VIVES (5):
  virstring.h/c: Util method for finding regexp patterns in some
  virstring.h/c: Util method for making some find and replace in
  vbox_tmpl.c: Better XML description for snapshots
  vbox_tmpl.c: Patch for redefining snapshots
  vbox_tmpl.c: Add methods for undefining snapshots

 po/POTFILES.in           |    1 +
 src/libvirt_private.syms |    2 +
 src/util/virstring.c     |  163 +++-
 src/util/virstring.h     |    4 +
 src/vbox/vbox_tmpl.c     | 2346 ++++++++++++++++++++++++++++++++++++++++++----
 5 files changed, 2346 insertions(+), 170 deletions(-)


More information about the libvir-list mailing list