Commit Graph

29395 Commits

Author SHA1 Message Date
John Ferlan
7e134bd377 uml: Add more specific error message on failed FindBy call
Rather than an empty failed to find, let's provide a bit more
knowledge about what we failed to find by using the name string
or the id value.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 14:44:46 -04:00
John Ferlan
ff619e0ee7 uml: Create accessors to virDomainObjListFindByUUID
Rather than repeat code throughout, create and use a couple of
accessors in order to lookup by UUID. This will also generate
a common error message including the failed uuidstr for lookup
rather than just returning nothing in some instances.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 14:44:40 -04:00
John Ferlan
ee3a86d721 uml: Fix umlInotifyEvent dom object handling
The virDomainObjListFindByName will return a locked and reffed
object. If we call virDomainObjListRemove that will unlock the
object upon return, thus we need to relock the object before
making the call to virDomainObjEndAPI.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 14:44:35 -04:00
John Ferlan
a39427be49 uml: Fix umlProcessAutoDestroyDom dom processing
There's no need to check if @dom exists before trying to
call virDomainObjListRemove since it must exist due to
prior checks.

Additionally, if we do remove the @dom, then set it to NULL
so that the virObjectUnlock isn't referencing something that
is deleted.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 14:42:59 -04:00
John Ferlan
6a6a5463af qemu: Fix possible memory leak in migration param processing
If virJSONValueArraySize(caps) <= 0, then we will still need to
virJSONValueFree(caps) because qemuMonitorSetMigrationCapabilities
won't consume it.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-19 14:25:11 -04:00
John Ferlan
6df5d77723 tests: Don't call virNetServerClientClose without valid client
If @client hasn't been opened, then don't call virNetServerClientClose
since that'll cause certain failure.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-19 14:24:32 -04:00
John Ferlan
713342e953 tests: Return failure if log not fopen'd
If @log is not fopen'd then, going to cleanup and calling fclose
will make for an unhappy callee. So just fail immediately instead
since there's nothing to clean up.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-19 14:24:12 -04:00
John Ferlan
4f995eab83 remote: Fix usage of ATTRIBUTE_FALLTHROUGH
Move to within the #if since the #else portion ends with a goto
and that raised concern by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-19 14:23:39 -04:00
John Ferlan
c028c71930 conf: Add error checking to virDomainSnapshotDiskDefFormat
Commit id '43f2ccdc' called virDomainDiskSourceDefFormatInternal
rather than formatting the the disk source inline. However, it
did not handle the case where the helper failed. Over time the
helper has been renamed to virDomainDiskSourceFormat. Similar to
other consumers, if virDomainDiskSourceFormat fails, then the
formatting could be off, so it's better to fail than to continue
on with some possibly bad data. Alter the function and the caller
to check status and jump to error in that case.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-19 14:23:39 -04:00
Michal Privoznik
fb1fae94a1 qemu_capabilities: Separate out device props fetching
The code is generic enough to be reused. Move it into a
separate function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-04-19 18:11:56 +02:00
Michal Privoznik
c2047c5c9f qemu_capabilities: s/ObjectProps/DeviceProps/g
So far all the properties we are trying to fetch are device
properties, i.e. -device $dev on qemu command line. Change
misleading variable names to express what's queried for better.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-04-19 18:11:56 +02:00
Andrea Bolognani
931144858f qemu: Figure out nodeset bitmap size correctly
The current private XML parsing code relies on the assumption
that NUMA node IDs start from 0 and are densely allocated,
neither of which is necessarily the case.

Change it so that the bitmap size is dynamically calculated by
looking at NUMA node IDs instead, which ensures all nodes will
be able to fit and thus the bitmap will be parsed successfully.

Update one of the test cases so that it would fail with the
previous approach, but passes with the new one.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1490158

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-04-19 17:57:54 +02:00
Andrea Bolognani
4fe4ffdbdf tests: Create full host NUMA topology in more cases
vircapstest has code to add a full host NUMA topology, that
is, one that includes all information about nodes and CPUs
including IDs; testQemuCapsInit(), which is used to create a
mock virCapsPtr for QEMU tests, however, just fakes it by
setting nnumaCell_max to some number.

While the latter approach has served us well so far, we're
going to need all the information to be filled in soon. In
order to do that, we can just move the existing code from
vircapstest to testutils and, with some renaming and
trivial tweaking, use it as-is.

Interestingly, the NUMA topology generated by the function
is rigged up so that the NUMA nodes aren't (necessarily)
numbered starting from 0, which is a nice way to spot
mistaken assumptions in our codebase.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-04-19 17:57:52 +02:00
Michal Privoznik
888aa4b6b9 qemuDomainObjPrivateDataClear: Don't leak @migParams
Allocated in qemuMigrationParamsNew() we need to free
priv->job.migParams when no longer needed.

==8061== 234 (192 direct, 42 indirect) bytes in 1 blocks are definitely lost in loss record 112 of 123
==8061==    at 0x4C2CF26: calloc (vg_replace_malloc.c:711)
==8061==    by 0x5325D05: virAlloc (viralloc.c:144)
==8061==    by 0x1984F9: qemuMigrationParamsNew (qemu_migration_params.c:218)
==8061==    by 0x19A352: qemuMigrationParamsParse (qemu_migration_params.c:1185)
==8061==    by 0x1604D8: qemuDomainObjPrivateXMLParseJob (qemu_domain.c:2390)
==8061==    by 0x160AE9: qemuDomainObjPrivateXMLParse (qemu_domain.c:2517)
==8061==    by 0x5419EAE: virDomainObjParseXML (domain_conf.c:20442)
==8061==    by 0x541A25E: virDomainObjParseNode (domain_conf.c:20555)
==8061==    by 0x541A2FC: virDomainObjParseFile (domain_conf.c:20574)
==8061==    by 0x13607D: testCompareStatusXMLToXMLFiles (qemuxml2xmltest.c:75)
==8061==    by 0x14F3E8: virTestRun (testutils.c:180)
==8061==    by 0x14DCD0: mymain (qemuxml2xmltest.c:1200)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-04-19 17:09:52 +02:00
Daniel P. Berrangé
655df05500 po: attempt to fix srcdir != builddir builds
The .pot, .po and .gmo files are slightly unusual in that we generate
them in the srcdir when building form git. This is because they'll be
bundled in the tar archive, so a build-from-tar will see them in srcdir.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 14:52:51 +01:00
Daniel P. Berrangé
2b6ea81717 po: minimize language zu
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:20:00 +01:00
Daniel P. Berrangé
69ab5ce502 po: minimize language zh_TW
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:51 +01:00
Daniel P. Berrangé
c88abc93ad po: minimize language zh_HK
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:48 +01:00
Daniel P. Berrangé
7a8a84ecd1 po: minimize language zh_CN
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:37 +01:00
Daniel P. Berrangé
6e9b2d3982 po: minimize language yo
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:34 +01:00
Daniel P. Berrangé
dfe326b239 po: minimize language wba
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:31 +01:00
Daniel P. Berrangé
1d60d9d5ad po: minimize language vi
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:29 +01:00
Daniel P. Berrangé
70235923e9 po: minimize language ur
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:26 +01:00
Daniel P. Berrangé
da441e30b3 po: minimize language uk
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:24 +01:00
Daniel P. Berrangé
e2133c66c2 po: minimize language tw
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:21 +01:00
Daniel P. Berrangé
5f5f354cab po: minimize language tr
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:19 +01:00
Daniel P. Berrangé
35c9ddd2c4 po: minimize language th
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:16 +01:00
Daniel P. Berrangé
d0f61dce3d po: minimize language tg
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:14 +01:00
Daniel P. Berrangé
04261e683b po: minimize language te
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:12 +01:00
Daniel P. Berrangé
3ae2d1afdf po: minimize language ta
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:09 +01:00
Daniel P. Berrangé
e4863d547d po: minimize language sv
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:06 +01:00
Daniel P. Berrangé
5fce08ce18 po: minimize language sr
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:04 +01:00
Daniel P. Berrangé
0819df40d0 po: minimize language sr@latin
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:19:01 +01:00
Daniel P. Berrangé
6ff59ecd42 po: minimize language sq
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:59 +01:00
Daniel P. Berrangé
32bfe14efd po: minimize language sl
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:56 +01:00
Daniel P. Berrangé
6b6078fb59 po: minimize language sk
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:54 +01:00
Daniel P. Berrangé
9e31e2c523 po: minimize language si
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:51 +01:00
Daniel P. Berrangé
e37bb513bb po: minimize language ru
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:47 +01:00
Daniel P. Berrangé
395d8779a2 po: minimize language ro
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:45 +01:00
Daniel P. Berrangé
e30b355a28 po: minimize language pt
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:42 +01:00
Daniel P. Berrangé
b8213f9667 po: minimize language pt_BR
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:39 +01:00
Daniel P. Berrangé
14578e7913 po: minimize language pl
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:36 +01:00
Daniel P. Berrangé
0c9c5dc259 po: minimize language pa
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:33 +01:00
Daniel P. Berrangé
5fea85aacc po: minimize language or
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:30 +01:00
Daniel P. Berrangé
827a75d022 po: minimize language nso
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:27 +01:00
Daniel P. Berrangé
393c4dbe9d po: minimize language nn
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:24 +01:00
Daniel P. Berrangé
ffca88e48c po: minimize language nl
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:21 +01:00
Daniel P. Berrangé
2dc3ff5269 po: minimize language ne
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:19 +01:00
Daniel P. Berrangé
f25cf4bbaa po: minimize language nds
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:16 +01:00
Daniel P. Berrangé
277daec3f9 po: minimize language nb
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 11:18:14 +01:00