Commit Graph

30533 Commits

Author SHA1 Message Date
Cole Robinson
ff2bec49ec spec: Use %make_install
It's on RHEL7, saves a bit of typing, and lets us drop the comment

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-08-08 09:04:24 -04:00
Simon Kobyda
9ff956b26a conf: virDomainDefValidateInternal prohibit some characters in shmem name
Validate that the provided XML shmem name is not directory specific to "."  or
".." as well as ensure that there is no path separator '/' in the name.

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

Signed-off-by: Simon Kobyda <skobyda@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2018-08-08 13:44:44 +02:00
Erik Skultety
e63aa3c664 Fix the build on non-linux platforms after VIR_AUTOPTR related changes
Commits 7b706f33ac and 4acb7887e4 introduced some compound type *Free
wrappers in order to use them with VIR_DEFINE_AUTOPTR_FUNC. However,
since those were not used in the code right away, Clang complained about
unused functions (static ones that are defined by the macro above).
This patch puts the defined functions in use.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-08-08 10:07:10 +02:00
Erik Skultety
cc4d44ab31 util: virnetdevopenvswitch: Drop an unused variable @ovs_timeout
Technically, it was never used ever since commit @f4d06ca8fd9 introduced
it, but the fact that we called VIR_FREE on it was enough for Clang to
never complain about it.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-08-08 10:07:09 +02:00
Daniel P. Berrangé
26cfb1a3cd qemu: ensure default machine types don't change if QEMU changes
It is increasingly likely that some distro is going to change the
default "x86" machine type in QEMU from "pc" to "q35". This will
certainly break existing applications which write their XML on the
assumption that it is using a "pc" machine by default. For example they'll
lack a IDE CDROM and get PCIe instead of PCI which changes the topology
radically.

Libvirt promises to isolate applications from hypervisor changes that
may cause incompatibilities, so we must ensure that we always use the
"pc" machine type if it is available. Only use QEMU's own reported
default machine type if "pc" does not exist.

This issue is not x86-only, other arches are liable to change their
default machine, while some arches don't report any default at all
causing libvirt to pick the first machine in the list. Thus to
guarantee stability to applications, declare a preferred default
machine for all architectures we currently support with QEMU.

Note this change assumes there will always be a "pc" alias as long as a
versioned "pc-XXX" machine type exists. If QEMU were to ship a "pc-XXX"
machine type but not provide the "pc" alias, it is too hard to decide
which to default so. Versioned machine types are supposed to be
considered opaque strings, so we can't apply any sensible ordering
ourselves and QEMU isn't reporting the list of machines in any sensible
ordering itself.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-07 15:44:09 +01:00
Sukrit Bhatnagar
9d399be949 util: qemu: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
4fe2eea3aa util: qemu: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
c3a2e274c7 util: process: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
ce814ed392 util: process: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
d00fc4178c util: pidfile: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
05a8dd36c0 util: perf: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
b99b66f846 util: perf: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

When a variable of type virPerfPtr is declared using VIR_AUTOPTR,
the function virPerfFree will be run automatically on it when it
goes out of scope.

This commit also adds an intermediate typedef for virPerf
type for use with the cleanup macros.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
d18a5f716a util: numa: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:56 +02:00
Sukrit Bhatnagar
4a840ff681 util: numa: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
4acb7887e4 util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

When a variable of type virNetlinkHandle * is declared using
VIR_AUTOPTR, the function virNetlinkFree will be run automatically
on it when it goes out of scope.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
fa95b014fd util: netdevveth: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
8758a44957 util: netdevveth: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
f84b0f1499 util: netdevtap: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
2d9be4d8b4 util: netdevopenvswitch: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Erik Skultety
bad48ac042 util: Drop unused cleanup label in virNetDevOpenvswitchInterfaceGetMaster
This was doing a plain "return".

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
fdf14d4698 util: netdevmacvlan: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
b7ef069ec7 util: netdevmacvlan: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
8214abd60e util: netdevip: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
a7a8b74928 util: netdevip: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

When variables of type virNetDevIPAddrPtr and virNetDevIPRoutePtr
are declared using VIR_AUTOPTR, the functions virNetDevIPAddrFree
and virNetDevIPRouteFree, respectively, will be run
automatically on them when they go out of scope.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
66a19eaa41 util: netdevip: Introduce virNetDevIPAddrFree helper
This will not only help us in the future when adding more and more
VIR_AUTOPTR instances, we're also consistent in that a compound type
gets its own function which can easily be extended in the future if
necessary.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
b0a8cd876c util: socketaddr: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
0b25749709 util: socketaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

When a variable of type virSocketAddrPtr is declared using
VIR_AUTOPTR, the function virSocketAddrFree will be run
automatically on it when it goes out of scope.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
d090c814ab util: socketaddr: Introduce virSocketAddrFree helper
This will not only help us in the future when adding more and more
VIR_AUTOPTR instances, we're also consistent in that a compound type
gets its own function which can easily be extended in the future if
necessary.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
7b706f33ac util: netdev: Define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

When variables of type virNetDevRxFilterPtr and virNetDevMcastEntryPtr
are declared using VIR_AUTOPTR, the functions virNetDevRxFilterFree
and virNetDevMcastEntryFree, respectively, will be run
automatically on them when they go out of scope.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
d439eeb405 util: macaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

When a variable of type virMacAddrPtr is declared using VIR_AUTOPTR,
the function virMacAddrFree will be run automatically on it when it
goes out of scope.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
8b67906e8d util: macaddr: Introduce a new virMacAddrFree helper
This will not only help us in the future when adding more and more
VIR_AUTOPTR instances, we're also consistent in that a compound type
gets its own function which can easily be extended in the future if
necessary.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
7ec89811a6 util: iscsi: use VIR_AUTOPTR for aggregate types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Sukrit Bhatnagar
ec3e8789f1 util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types
By making use of GNU C's cleanup attribute handled by the
VIR_AUTOFREE macro for declaring scalar variables, majority
of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-07 16:29:55 +02:00
Boris Fiuczynski
7c7f6f0a10 news: Update for vhost-vsock-ccw support
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2018-08-07 15:02:59 +02:00
Boris Fiuczynski
927ef9f2a6 qemu: Add ccw support for vhost-vsock
Add support and tests for vhost-vsock-ccw.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2018-08-07 15:02:59 +02:00
Bjoern Walk
bc4c83838d tests: qemuxml2argv: add CAPS_ARCH_LATEST macro
Testing with the latest capabilities is possible with the x86_64 centric
implemented macro CAPS_LATEST. The new macro CAPS_ARCH_LATEST provides
the user the ability to specify the desired architecture when testing with
the latest capabilities.

Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2018-08-07 15:02:59 +02:00
Ján Tomko
087de2f5a3 docs: formatdomain: fix spacing before parentheses
Multiple cputune elements specified microseconds as the unit
without putting a space before the parenthesis.

There were also other occurrences.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-08-06 15:22:17 +02:00
Andrea Bolognani
65952b249f tests: Unify data structure for vircaps2xmltest
If all we achieve is reducing the depth by one for a single
test case, the additional complexity (not to mention breaking
the principle of least surprise) is not worth it: let's use
simpler, more predictable code instead.

This basically reverts fec6e4c48c (with a few adjustments).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2018-08-06 13:44:59 +02:00
Michal Privoznik
0a5a6f0d01 virrandom: Avoid undefined behaviour in virRandomBits
If nbits is 64 (or greater) then shifting 1ULL left is undefined.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-06 12:42:28 +02:00
Clementine Hayat
1c701c47d5 news: add storage pool iscsi-direct
Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:24:59 +02:00
Clementine Hayat
01dd26811a storage: add findPoolSources to iscsi_direct pool backend
Change the SetContext function to be able to take the session type in
argument.
Took the function findPoolSources of iscsi backend and wired it to my
function since the formatting is essentially the same.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:24:18 +02:00
Clementine Hayat
91a3d88a61 storage: Implement iscsi_direct pool backend
We need here libiscsi for the storgae pool backend.
For the iscsi-direct storage pool, only checkPool and refreshPool should
be necessary for basic support.
The pool is state-less and just need the informations within the volume
to work.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:23:55 +02:00
Clementine Hayat
f0bf1be3e7 storage: Introduce iscsi_direct pool type
Introducing the pool as a noop. Integration inside the build
system. Implementation will be in the following commits.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:23:55 +02:00
Clementine Hayat
8aa85e0bb7 configure: Introduce libiscsi in build system
The minimal required version is 1.18.0 because the synchrounous function
needed were introduced here.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
2018-08-06 12:23:55 +02:00
Michal Privoznik
08e3863f0f Post-release version bump to 4.7.0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:23:15 +02:00
Martin Kletzander
df09767773 Fix include for xattr.h
The proper file that should be included is `sys/xattr.h` as that comes from
`glibc` and not `attr/xattr.h` which ships with the `attr` utility.

We're most probably not the only ones because `attr/xattr.h` added a #warning to
their include resulting in the following compilation errors:

In file included from securityselinuxlabeltest.c:31:0:
/usr/include/attr/xattr.h:5:2: error: #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>" [-Werror=cpp]
 #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>"
  ^~~~~~~

In file included from securityselinuxhelper.c:37:0:
/usr/include/attr/xattr.h:5:2: error: #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>" [-Werror=cpp]
 #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>"
  ^~~~~~~

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-06 11:50:53 +02:00
Daniel Veillard
1f8be8ec80 Release of libvirt-4.6.0
* docs/news.xml: updated for release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
2018-08-06 11:38:57 +02:00
Matthias Bolte
3ad77f8532 esx: Fix double-free and freeing static strings in esxDomainSetAutostart
Since commit ae83e02f3dd7fe99fed5d8159a35b666fafeafd5#l3393 the
newPowerInfo pointer itself is used to track the ownership of the
AutoStartPowerInfo object to make Coverity understand the code better.
This broke the code that unset some members of the AutoStartPowerInfo
object that should not be freed the normal way.

Instead, transfer ownership of the AutoStartPowerInfo object to the
HostAutoStartManagerConfig object before filling in the values that
need special handling. This allows to free the AutoStartPowerInfo
directly without having to deal with the special values, or to let
the old (now restored) logic handle the special values again.

Signed-off-by: Matthias Bolte <matthias.bolte@googlemail.com>
Tested-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-08-02 21:06:19 +02:00
Daniel P. Berrangé
3e8703368b tests: mock virRandomBits to make it endian stable
virRandomBits is implemented in terms of virRandomBytes. Although we
mock virRandomBytes to give a stable value, this is not sufficient to
make virRandomBits give a stable value. The result of virRandomBits will
vary depending on endianness. Thus we mock virRandomBits to return a
stable value directly.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Tested-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-08-02 14:24:40 +01:00
Julio Faracco
8e09f9afc7 tests: libxl: Fix a segfault when libxl configuration setup fails
This commit fixes a segmentation fault caused by missing conditional to
check if libxl configuration was properly created by the test. If the
configuration was not properly created, libxlDriverConfigNew() function
will return NULL and cause a segfault at cfg->caps = NULL during the
cleanup.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-08-02 10:35:35 +02:00