Commit Graph

10 Commits

Author SHA1 Message Date
Michal Privoznik
c2a5a4e7ea virstring: Unify string list function names
We have couple of functions that operate over NULL terminated
lits of strings. However, our naming sucks:

virStringJoin
virStringFreeList
virStringFreeListCount
virStringArrayHasString
virStringGetFirstWithPrefix

We can do better:

virStringListJoin
virStringListFree
virStringListFreeCount
virStringListHasString
virStringListGetFirstWithPrefix

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-11-25 13:54:05 +01:00
Ján Tomko
ca773b2fe2 vbox: reformat multi-line error reports
Put the comma on the first line.
2016-06-15 15:07:47 +02:00
Ján Tomko
4d569245f0 vbox: remove more extra spaces 2016-02-11 07:32:50 +01:00
Martin Kletzander
677ddc828a Remove unnecessary curly brackets in src/vbox/
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-11-14 17:13:35 +01:00
Pavel Hrdina
97af511b1a vbox_snapshot_conf: fix wrong use of 'xmlSaveFormatFileEnc'
The function 'xmlSaveFormatFileEnc' has a last option to set
if you want to format dumped xml with whitespaces or not.

Older libxml2, the one used in RHEL6, take this option as it is
but newer libxml2 check this option if it's true or not. This
small difference somehow makes things messy on RHEL6 and generated
xml had extra new line and extra whitespaces.

We should pass 1 instead if -1 because the -1 confuses the libxml2.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2014-06-18 15:19:18 +02:00
Peter Krempa
28427e6b2a vbox: snapshot: Avoid memleaks in functions dealing with disk arrays
In virVBoxSnapshotConfRemoveFakeDisks and
virVBoxSnapshotConfDiskIsInMediaRegistry the disk array constructed from
all the disks would be leaked at the end of the function and on
allocation errors. Also the temporary disk list would be leaked.

Add a cleanup section and free the memory properly.

Found by coverity.
2014-06-17 13:28:44 +02:00
Peter Krempa
ca9a94a0a9 vbox: snapshot: Avoid memleak in virVBoxSnapshotConfAllChildren
On re-allocation failure the function would leak already allocated
memory.
2014-06-17 13:28:39 +02:00
John Ferlan
fdfdbc0d12 vbox_snapshot_conf: Resolve Coverity warnings
Clean up some Coverity warnings from commit id '4dc5d8f1'
2014-06-12 05:44:47 -04:00
Roman Bogorodskiy
0568db02a5 vbox: fix compilation error
clang complains about possibly uninitialized variable:

vbox/vbox_snapshot_conf.c:1355:9: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if (!(xPathContext = xmlXPathNewContext(xml))) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So init 'ret' with NULL.
2014-06-10 21:30:44 +04:00
Yohan BELLEGUIC
4dc5d8f100 Add vbox_snapshot_conf struct
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.
2014-06-10 15:07:36 +01:00