Re: [PATCH v8 2/4] Add vbox_snapshot_conf struct

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

 



On Mon, May 19, 2014 at 02:47:31PM +0200, Yohan BELLEGUIC wrote:
> This structure contains the data to be saved in the VirtualBox XML file
> and can be manipulated with severals exposed functions.
> The structure is created by vboxSnapshotLoadVboxFile taking the
> machine XML file.
> It also can rewrite the XML by using vboxSnapshotSaveVboxFile.
> ---
>  po/POTFILES.in                                     |    1 +
>  src/Makefile.am                                    |    1 +
>  src/vbox/vbox_snapshot_conf.c                      | 1490 ++++++++++++++++++++
>  src/vbox/vbox_snapshot_conf.h                      |  105 ++
>  tests/Makefile.am                                  |   15 +
>  tests/vboxsnapshotxmldata/2disks-1snap.vbox        |  322 +++++
>  tests/vboxsnapshotxmldata/2disks-2snap.vbox        |  478 +++++++
>  .../vboxsnapshotxmldata/2disks-3snap-brother.vbox  |  786 +++++++++++
>  tests/vboxsnapshotxmldata/2disks-3snap.vbox        |  636 +++++++++
>  tests/vboxsnapshotxmldata/2disks-nosnap.vbox       |  168 +++
>  tests/vboxsnapshotxmltest.c                        |  161 +++
>  11 files changed, 4163 insertions(+)
>  create mode 100644 src/vbox/vbox_snapshot_conf.c
>  create mode 100644 src/vbox/vbox_snapshot_conf.h
>  create mode 100644 tests/vboxsnapshotxmldata/2disks-1snap.vbox
>  create mode 100644 tests/vboxsnapshotxmldata/2disks-2snap.vbox
>  create mode 100644 tests/vboxsnapshotxmldata/2disks-3snap-brother.vbox
>  create mode 100644 tests/vboxsnapshotxmldata/2disks-3snap.vbox
>  create mode 100644 tests/vboxsnapshotxmldata/2disks-nosnap.vbox
>  create mode 100644 tests/vboxsnapshotxmltest.c

ACK

I made a few changes to this - primarily to add 'const' to all
the 'char *' strings, tweak line breaks, and remove some bogus
use of virStringFreeList on non-NULL terminated arrays

So the change I'm pushing includes this:

diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c
index 9fee760..4909665 100644
--- a/src/vbox/vbox_snapshot_conf.c
+++ b/src/vbox/vbox_snapshot_conf.c
@@ -30,9 +30,10 @@
 #define VIR_FROM_THIS                   VIR_FROM_VBOX
 VIR_LOG_INIT("vbox.vbox_snapshot_conf");
 
-static virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(xmlNodePtr diskNode,
-                                                                   xmlXPathContextPtr xPathContext,
-                                                                   char *machineLocation)
+static virVBoxSnapshotConfHardDiskPtr
+virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(xmlNodePtr diskNode,
+                                                     xmlXPathContextPtr xPathContext,
+                                                     const char *machineLocation)
 {
     virVBoxSnapshotConfHardDiskPtr hardDisk = NULL;
     xmlNodePtr *nodes = NULL;
@@ -114,9 +115,10 @@ static virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfCreateVBoxSnapshotConfH
     return hardDisk;
 }
 
-static virVBoxSnapshotConfMediaRegistryPtr virVBoxSnapshotConfRetrieveMediaRegistry(xmlNodePtr mediaRegistryNode,
-                                                             xmlXPathContextPtr xPathContext,
-                                                             char *machineLocation)
+static virVBoxSnapshotConfMediaRegistryPtr
+virVBoxSnapshotConfRetrieveMediaRegistry(xmlNodePtr mediaRegistryNode,
+                                         xmlXPathContextPtr xPathContext,
+                                         const char *machineLocation)
 {
     virVBoxSnapshotConfMediaRegistryPtr mediaRegistry = NULL;
     xmlNodePtr hardDisksNode = NULL;
@@ -175,8 +177,9 @@ static virVBoxSnapshotConfMediaRegistryPtr virVBoxSnapshotConfRetrieveMediaRegis
     return mediaRegistry;
 }
 
-static virVBoxSnapshotConfSnapshotPtr virVBoxSnapshotConfRetrieveSnapshot(xmlNodePtr snapshotNode,
-                                                   xmlXPathContextPtr xPathContext)
+static virVBoxSnapshotConfSnapshotPtr
+virVBoxSnapshotConfRetrieveSnapshot(xmlNodePtr snapshotNode,
+                                    xmlXPathContextPtr xPathContext)
 {
     virVBoxSnapshotConfSnapshotPtr snapshot = NULL;
     xmlNodePtr hardwareNode = NULL;
@@ -278,8 +281,9 @@ static virVBoxSnapshotConfSnapshotPtr virVBoxSnapshotConfRetrieveSnapshot(xmlNod
     return snapshot;
 }
 
-virVBoxSnapshotConfSnapshotPtr virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot,
-                                          char *snapshotName)
+virVBoxSnapshotConfSnapshotPtr
+virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot,
+                                  const char *snapshotName)
 {
     size_t i = 0;
     virVBoxSnapshotConfSnapshotPtr ret = NULL;
@@ -293,8 +297,9 @@ virVBoxSnapshotConfSnapshotPtr virVBoxSnapshotConfSnapshotByName(virVBoxSnapshot
     return ret;
 }
 
-static virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfHardDiskById(virVBoxSnapshotConfHardDiskPtr disk,
-                                               char *parentHardDiskId)
+static virVBoxSnapshotConfHardDiskPtr
+virVBoxSnapshotConfHardDiskById(virVBoxSnapshotConfHardDiskPtr disk,
+                                const char *parentHardDiskId)
 {
     size_t i = 0;
     virVBoxSnapshotConfHardDiskPtr ret = NULL;
@@ -308,8 +313,9 @@ static virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfHardDiskById(virVBoxSna
     return ret;
 }
 
-static virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfHardDiskByLocation(virVBoxSnapshotConfHardDiskPtr disk,
-                                                     char *parentLocation)
+static virVBoxSnapshotConfHardDiskPtr
+virVBoxSnapshotConfHardDiskByLocation(virVBoxSnapshotConfHardDiskPtr disk,
+                                      const char *parentLocation)
 {
     size_t i = 0;
     virVBoxSnapshotConfHardDiskPtr ret = NULL;
@@ -323,7 +329,8 @@ static virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfHardDiskByLocation(virV
     return ret;
 }
 
-static xmlNodePtr virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk)
+static xmlNodePtr
+virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk)
 {
     int result = -1;
     size_t i = 0;
@@ -357,7 +364,9 @@ static xmlNodePtr virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardD
     return ret;
 }
 
-static int virVBoxSnapshotConfSerializeSnapshot(xmlNodePtr node, virVBoxSnapshotConfSnapshotPtr snapshot)
+static int
+virVBoxSnapshotConfSerializeSnapshot(xmlNodePtr node,
+                                     virVBoxSnapshotConfSnapshotPtr snapshot)
 {
     int result = -1;
     size_t i = 0;
@@ -458,7 +467,9 @@ static int virVBoxSnapshotConfSerializeSnapshot(xmlNodePtr node, virVBoxSnapshot
     return result;
 }
 
-static size_t virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDiskPtr disk, virVBoxSnapshotConfHardDiskPtr **list)
+static size_t
+virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDiskPtr disk,
+                               virVBoxSnapshotConfHardDiskPtr **list)
 {
     size_t returnSize = 0;
     size_t tempSize = 0;
@@ -486,7 +497,8 @@ static size_t virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDiskPtr disk
     return returnSize;
 }
 
-void virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk)
+void
+virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk)
 {
     size_t i = 0;
 
@@ -504,7 +516,8 @@ void virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk)
 }
 
 
-void virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry)
+void
+virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry)
 {
     size_t i = 0;
 
@@ -514,11 +527,14 @@ void virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr me
     for (i = 0; i < mediaRegistry->ndisks; i++)
         virVboxSnapshotConfHardDiskFree(mediaRegistry->disks[i]);
     VIR_FREE(mediaRegistry->disks);
-    virStringFreeList(mediaRegistry->otherMedia);
+    for (i = 0; i < mediaRegistry->notherMedia; i++)
+        VIR_FREE(mediaRegistry->otherMedia[i]);
+    VIR_FREE(mediaRegistry->otherMedia);
     VIR_FREE(mediaRegistry);
 }
 
-void virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot)
+void
+virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot)
 {
     size_t i = 0;
 
@@ -537,7 +553,8 @@ void virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot)
     VIR_FREE(snapshot);
 }
 
-void virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine)
+void
+virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine)
 {
     if (!machine)
         return;
@@ -561,7 +578,9 @@ void virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine)
  *return NULL on failure
  *filePath must not be NULL.
  */
-virVBoxSnapshotConfMachinePtr virVBoxSnapshotConfLoadVboxFile(const char *filePath, char *machineLocation)
+virVBoxSnapshotConfMachinePtr
+virVBoxSnapshotConfLoadVboxFile(const char *filePath,
+                                const char *machineLocation)
 {
     int ret = -1;
     virVBoxSnapshotConfMachinePtr machineDescription = NULL;
@@ -702,6 +721,8 @@ virVBoxSnapshotConfMachinePtr virVBoxSnapshotConfLoadVboxFile(const char *filePa
     cur = virXPathNode("./vbox:Snapshot", xPathContext);
     if (cur != NULL) {
         machineDescription->snapshot = virVBoxSnapshotConfRetrieveSnapshot(cur, xPathContext);
+        if (!machineDescription->snapshot)
+            goto cleanup;
     }
 
     ret = 0;
@@ -727,9 +748,10 @@ virVBoxSnapshotConfMachinePtr virVBoxSnapshotConfLoadVboxFile(const char *filePa
  *return 0 on success
  *return -1 on failure
  */
-int virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr snapshot,
-                            virVBoxSnapshotConfMachinePtr machine,
-                            char *snapshotParentName)
+int
+virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr snapshot,
+                                           virVBoxSnapshotConfMachinePtr machine,
+                                           const char *snapshotParentName)
 {
     int ret = -1;
     virVBoxSnapshotConfSnapshotPtr parentSnapshot = NULL;
@@ -786,9 +808,10 @@ int virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr sn
  *return 0 on success
  *return -1 on failure
  */
-int virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr hardDisk,
-                               virVBoxSnapshotConfMediaRegistryPtr mediaRegistry,
-                               char *parentHardDiskId)
+int
+virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr hardDisk,
+                                              virVBoxSnapshotConfMediaRegistryPtr mediaRegistry,
+                                              const char *parentHardDiskId)
 {
     int ret = -1;
     size_t i = 0;
@@ -834,7 +857,9 @@ int virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr
  *return 0 on success
  *return -1 on failure
  */
-int virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine, char *snapshotName)
+int
+virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine,
+                                  const char *snapshotName)
 {
     int ret = -1;
     size_t i = 0;
@@ -899,7 +924,9 @@ int virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine, cha
  *return 0 on success
  *return -1 on failure
  */
-int virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry, char *uuid)
+int
+virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry,
+                                  const char *uuid)
 {
     int ret = -1;
     size_t i = 0;
@@ -957,7 +984,9 @@ int virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaR
  *return 0 on success
  *return -1 on failure
  */
-int virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine, const char *filePath)
+int
+virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine,
+                                const char *filePath)
 {
     int ret = -1;
     size_t i = 0;
@@ -1212,7 +1241,9 @@ int virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine, const
  *isCurrentSnapshot: Return 1 if 'snapshotName' corresponds to the
  *vboxSnapshotXmlMachinePtr's current snapshot, return 0 otherwise.
  */
-int virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine, char *snapshotName)
+int
+virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine,
+                                     const char *snapshotName)
 {
     virVBoxSnapshotConfSnapshotPtr snapshot = NULL;
     if (machine == NULL) {
@@ -1237,7 +1268,9 @@ int virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine,
  *fills a list of read-write disk paths.
  *return array length on success, -1 on failure.
  */
-int virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(char *filePath, char ***rwDisksPath)
+int
+virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(const char *filePath,
+                                                 char ***rwDisksPath)
 {
     int result = -1;
     size_t i = 0;
@@ -1246,6 +1279,7 @@ int virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(char *filePath, char ***rwD
     xmlXPathContextPtr xPathContext = NULL;
     xmlNodePtr *nodes = NULL;
     int nodeSize = 0;
+    *rwDisksPath = NULL;
     if (filePath == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("filePath is null"));
@@ -1281,10 +1315,13 @@ int virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(char *filePath, char ***rwD
     xmlFreeDoc(xml);
     xmlXPathFreeContext(xPathContext);
     if (result < 0) {
-        virStringFreeList(ret);
+        for (i = 0; i < nodeSize; i++)
+            VIR_FREE(ret[i]);
+        VIR_FREE(ret);
         nodeSize = -1;
+    } else {
+        *rwDisksPath = ret;
     }
-    *rwDisksPath = ret;
     return nodeSize;
 }
 
@@ -1293,7 +1330,9 @@ int virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(char *filePath, char ***rwD
  *a list of read-only disk paths (the parents of the read-write disks).
  *return array length on success, -1 on failure.
  */
-int virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(char *filePath, char ***roDisksPath)
+int
+virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(const char *filePath,
+                                                 char ***roDisksPath)
 {
     int result = -1;
     size_t i = 0;
@@ -1349,7 +1388,9 @@ int virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(char *filePath, char ***roD
  *hardDiskUuidByLocation: Return the uuid of the hard disk whose location is 'location'
  *return a valid uuid, or NULL on failure
  */
-char *virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine, char *location)
+const char *
+virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine,
+                                          const char *location)
 {
     size_t i = 0;
     virVBoxSnapshotConfHardDiskPtr hardDisk = NULL;
@@ -1368,9 +1409,10 @@ char *virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr ma
  *This list begins with the requested disk, and ends with the farthest ancestor.
  *return array length on success, -1 on failure.*/
 
-size_t virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine,
-                      virVBoxSnapshotConfHardDiskPtr **hardDiskToOpen,
-                      char *location)
+size_t
+virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine,
+                                  virVBoxSnapshotConfHardDiskPtr **hardDiskToOpen,
+                                  const char *location)
 {
     size_t i = 0;
     size_t returnSize = 0;
@@ -1404,7 +1446,8 @@ size_t virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine,
  *return 0 on success
  *return -1 on failure
  */
-int virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine)
+int
+virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine)
 {
     int ret = -1;
     size_t i = 0;
@@ -1444,7 +1487,9 @@ int virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine)
  *return 1 if the disk is in the media registry
  *return -1 on failure
  */
-int virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine, char *location)
+int
+virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine,
+                                         const char *location)
 {
     int ret = -1;
     size_t i = 0;
@@ -1477,7 +1522,9 @@ int virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machi
 /*
  *hardDisksPtrByLocation: Return a vboxSnapshotXmlHardDiskPtr whose location is 'location'
  */
-virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachinePtr machine, char *location)
+virVBoxSnapshotConfHardDiskPtr
+virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachinePtr machine,
+                                         const char *location)
 {
     int it = 0;
     virVBoxSnapshotConfHardDiskPtr disk = NULL;
diff --git a/src/vbox/vbox_snapshot_conf.h b/src/vbox/vbox_snapshot_conf.h
index 59353b5..3864b30 100644
--- a/src/vbox/vbox_snapshot_conf.h
+++ b/src/vbox/vbox_snapshot_conf.h
@@ -81,25 +81,61 @@ struct _virVBoxSnapshotConfMachine {
     char *storageController;
 };
 
-void virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk);
-void virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry);
-void virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot);
-void virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine);
+void
+virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk);
+void
+virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry);
+void
+virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot);
+void
+virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine);
 
-virVBoxSnapshotConfMachinePtr virVBoxSnapshotConfLoadVboxFile(const char *filePath, char *machineLocation);
-int virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr snapshot, virVBoxSnapshotConfMachinePtr machine, char *snapshotParentName);
-int virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr hardDisk, virVBoxSnapshotConfMediaRegistryPtr mediaRegistry, char *parentHardDiskId);
-int virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine, char *snapshotName);
-int virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry,char *uuid);
-int virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine, const char *filePath);
-int virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine, char *snapshotName);
-int virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(char *filePath, char ***realReadWriteDisksPath);
-int virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(char *filePath, char ***realReadOnlyDisksPath);
-char *virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine, char *location);
-size_t virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine, virVBoxSnapshotConfHardDiskPtr **hardDiskToOpen, char *location);
-int virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine);
-int virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine, char *location);
-virVBoxSnapshotConfHardDiskPtr virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachinePtr machine, char *location);
-virVBoxSnapshotConfSnapshotPtr virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot, char *snapshotName);
+virVBoxSnapshotConfMachinePtr
+virVBoxSnapshotConfLoadVboxFile(const char *filePath,
+                                const char *machineLocation);
+int
+virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr snapshot,
+                                           virVBoxSnapshotConfMachinePtr machine,
+                                           const char *snapshotParentName);
+int
+virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr hardDisk,
+                                              virVBoxSnapshotConfMediaRegistryPtr mediaRegistry,
+                                              const char *parentHardDiskId);
+int
+virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine,
+                                  const char *snapshotName);
+int
+virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry,
+                                  const char *uuid);
+int
+virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine,
+                                const char *filePath);
+int
+virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine,
+                                     const char *snapshotName);
+int
+virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(const char *filePath,
+                                                 char ***realReadWriteDisksPath);
+int
+virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(const char *filePath,
+                                                 char ***realReadOnlyDisksPath);
+const char *
+virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine,
+                                          const char *location);
+size_t
+virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine,
+                                  virVBoxSnapshotConfHardDiskPtr **hardDiskToOpen,
+                                  const char *location);
+int
+virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine);
+int
+virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine,
+                                         const char *location);
+virVBoxSnapshotConfHardDiskPtr
+virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachinePtr machine,
+                                         const char *location);
+virVBoxSnapshotConfSnapshotPtr
+virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot,
+                                  const char *snapshotName);
 
 #endif /*VBOX_SNAPSHOT_CONF_H*/
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 498e2af..c999061 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -628,7 +628,7 @@ if WITH_VBOX
 vboxsnapshotxmltest_SOURCES = \
 	vboxsnapshotxmltest.c \
 	testutils.c testutils.h
-vbox_LDADDS = ../src/libvirt_driver_vbox.la
+vbox_LDADDS = ../src/libvirt_driver_vbox_impl.la
 vboxsnapshotxmltest_LDADD = $(LDADDS) $(vbox_LDADDS)
 else ! WITH_VBOX
 EXTRA_DIST += vboxsnapshotxmltest.c


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]