Commit Graph

138 Commits

Author SHA1 Message Date
Naveen Saini
08b5de42f9 libvirt: fix host gcc can't recognized option -fmacro-prefix-map
libvirt-python picks host gcc (instead of cross gcc) to build shared
library in absense of LD*SHARED flags.

Instead of inherit distutils3-base.class, taking SHARED flags to create
libvirt-python package.

Ref: https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/distutils-common-base.bbclass

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-11-19 11:05:48 -05:00
Yanfei Xu
58765bd2c9 libvirt: Use /run in replace of /var/run in libvirt
To avoid systemd complains that the libvirt unit files use legacy
directory, we configure the libvirt with '--with-runstatedir=/run'
and do some minor changes.

------------------cut here----------------------
014: systemd[1]: /lib/systemd/system/virtlogd.socket:6: ListenStream=
references a path below legacy directory /var/run/, updating
/var/run/libvirt/virtlogd-sock → /run/libvirt/virtlogd-sock; please
update the unit file accordingly.
014: systemd[1]: /lib/systemd/system/virtlogd-admin.socket:8:
ListenStream= references a path below legacy directory /var/run/,
updating /var/run/libvirt/virtlogd-admin-sock →
/run/libvirt/virtlogd-admin-sock; please update the unit file
accordingly.
014: systemd[1]: /lib/systemd/system/virtlockd.socket:6: ListenStream=
references a path below legacy directory /var/run/, updating
/var/run/libvirt/virtlockd-sock → /run/libvirt/virtlockd-sock; please
update the unit file accordingly.
014: systemd[1]: /lib/systemd/system/virtlockd-admin.socket:8:
ListenStream= references a path below legacy directory /var/run/,
updating /var/run/libvirt/virtlockd-admin-sock →
/run/libvirt/virtlockd-admin-sock; please update the unit file
accordingly.
014: systemd[1]: /lib/systemd/system/libvirtd.socket:9: ListenStream=
references a path below legacy directory /var/run/, updating
/var/run/libvirt/libvirt-sock → /run/libvirt/libvirt-sock; please update
the unit file accordingly.
014: systemd[1]: /lib/systemd/system/libvirtd-ro.socket:11:
ListenStream= references a path below legacy directory /var/run/,
updating /var/run/libvirt/libvirt-sock-ro →
/run/libvirt/libvirt-sock-ro; please update the unit file accordingly.
......

Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-09-21 17:32:39 -04:00
Joe Slater
cbf47a093d libvirt: specify location of dmidecode
We should tell configure where dmidecode is rather than
have it search the host for it.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-08-07 22:21:22 -04:00
Lavocat, Nicolas
ba6143a680 libvirt: fix install error without qemu
An error occurs during the install step of libvirt when the variable
PACKAGECONFIG does not contain qemu.

Indeed, in this case, the operation "chown -R qemu:qemu
${D}/${localstatedir}/lib/libvirt/qemu" fails, since the folder
${D}/${localstatedir}/lib/libvirt/qemu has not been created.

The fix consist in doing this operation only if
the variable “PACKAGECONFIG” contains “qemu”.
remark: issue present since the Warrior release of yocto.

Upstream-Status: Pending

Signed-off-by: Nicolas Lavocat <nicolas.lavocat@harman.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-08-07 22:19:43 -04:00
sakib.sajal@windriver.com
4ba3d8daad libvirt: fix patch fuzz warning
Refreshed patches to fix:
"WARNING: libvirt-6.3.0-r0 do_patch: Fuzz detected"

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-06-01 22:30:39 -04:00
sakib.sajal@windriver.com
7b002ac180 libvirt: uprev v6.1.0 -> v6.3.0
Minor update bringing in new features, improvements
and bug fixes.
Most notable changes:
- vbox: removed support for version 5.0 and 5.1 APIs
- vbox: added support for version 6.0 and 6.1 APIs
- qemu: Various embed driver fixes
- qemu: Add virtiofs support
- qemu: support disabling hotplug/unplug of PCIe devices
- xen: Add support for 'passthrough' hypervisor feature

Straightforward uprev, requiring patch refreshes to
remove fuzz.

Build and runtime behaviour is identical to older
version v6.1.0.

ptest summary:
===================================
Testsuite summary for libvirt 6.3.0
===================================
- TOTAL: 129
- PASS:  123
- SKIP:  1
- XFAIL: 0
- FAIL:  5
- XPASS: 0
- ERROR: 0

Failed test:
- virschematest
- domaincapstest
- qemuxml2argvtest
- qemuhotplugtest
- virsh-auth

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-05-19 17:24:41 -04:00
He Zhe
420479e0fc libvirt: Add setuid permission to virt-login-shell
virt-login-shell asks for setuid permission as follow.
"virt-login-shell: must be run as setuid root"

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-04-05 22:17:10 -04:00
hongxu
2bba10be28 libvirt: Workaround mips assembler crash on target
While enabling multilib on qemumips64, lib32 assembler ends up
crashing on target sometimes due to branch out of range,
therefore using -O2 for now

[snip]
|../../libvirt-6.1.0/tests/qemuxml2argvtest.c: In function 'mymain':
|../../libvirt-6.1.0/tests/qemuxml2argvtest.c:608:1: note: variable
tracking size limit exceeded with '-fvar-tracking-assignments', retrying without
|  608 | mymain(void)
|      | ^~~~~~
|/tmp/ccXJSwZR.s: Assembler messages:
|/tmp/ccXJSwZR.s:43943: Error: branch out of range
[snip]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-04-01 22:30:18 -04:00
Bruce Ashfield
7a8ee8e986 libvirt: uprev to v6.1.0
Updating libvirt to the next major release series. With this, brings
some changes to the build:

 - add python3-docutils-native to DEPENDS, since it is needed for doc
   building
 - remove a reference to libgnu.la from the Makefiles, since it is not
   needed or provided in the build dependencies
 - remove obselete packageconfig options: xenapi and phyp
 - add an explicit do_compile rule (versus the autotools bbclass
   variant), so we can create some directories before compilation
   starts
 - add ${B}/src to the PKG_CONFIG_PATH to the libvirt.pc file can be
   found during build, as it is queried by libvirt-python
 - with the ability to find the libvirt.pc file, we can also drop the
   manipulations for libvirt_api_xml_path, as it is returned from
   pkg-config queries.
 - clear PKG_CONFIG_SYSROOT_DIR during libvirt-python builds, since
   the libvirt.pc file already provides cflags/includes that are
   contained to the build/src directory structure.

And finally, existing patches are refreshed to remove fuzz.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-03-08 14:34:03 -04:00
Changqing Li
0adc4c38fc hook_support.py: convert to python3
python2 has been removed from oe-core, convert the scripts
to python3 to avoid runtime error like:
/usr/bin/env: 'python': No such file or directory'

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-02-20 12:43:20 -05:00
Chen Qi
ad580c253d libvirt: inherit perlnative for pod2man
pod2man is now provided by perlnative instead host.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-02-11 16:09:02 -05:00
Jeremy Puhlman
c487e0f511 libvirt: Use python3-native for python install
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-02-03 17:08:30 -05:00
Bruce Ashfield
407b822068 libvirt: make python3 safe
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-01-22 15:53:49 +00:00
Mark Asselstine
8a43b4f1b7 libvirt: fixup multiple shlib providers
Build libvirt results in the follow warning:
ERROR: libvirt-5.5.0-r0 do_package: libvirt-ptest: Multiple shlib providers for libvirt-admin.so.0: libvirt, libvirt-ptest
(used by files: ./tmp/work/aarch64-overc-linux/libvirt/5.5.0-r0/packages-split/libvirt-ptest/usr/lib/libvirt/ptest/tools/virt-admin)
ERROR: libvirt-5.5.0-r0 do_package: libvirt: Multiple shlib providers for libvirt-admin.so.0: libvirt, libvirt-ptest
(used by files: ./tmp/work/aarch64-overc-linux/libvirt/5.5.0-r0/packages-split/libvirt/usr/bin/virt-admin)

This is caused by the introduction of a shlib provider check added to
openembedded-core (commit 61c413690034 [package: Multiple
shlib_providers for the same file should error]). You can see the
issue and solution discussed more here
https://bugzilla.yoctoproject.org/show_bug.cgi?id=4628

Since the ptest version of the shared library will only be used by the
ptest package so we can use PRIVATE_LIBS to have the shlib providers
list.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-10-02 14:12:39 -04:00
He Zhe
fc129dccd3 libvirt: Remove numactl from PACKAGECONFIG for arm
b5b5def ("libvirt: add hook support") introduces a wrong check against KARCH
which is not defined.

This patch use TARGET_ARCH overrides to remove numactl from PACKAGECONFIG for
32-bit arm arches.

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-07-31 22:15:23 -04:00
He Zhe
1bd526d9fe libvirt: Do not change /var/lib/libvirt/qemu for mips and mips64 in do_install
qemu does not support mips and mips64 and thus /var/lib/libvirt/qemu is not
generated. Do not change it.

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-07-25 14:25:59 -04:00
He Zhe
37a554a249 libvirt: libvirtd: Facilitate using tls connection mode
tls is the default network connection mode of libvirtd upstream, though we use
tcp mode as default.

tls requires necessary keys and certificates of certificate authority, server
and client to be properly generated and deployed. Otherwise servers and clients
cannot be connected.

This patch,
 - integrates sample keys and certificats of certificate authority, server and
   client for users to be able to use tls mode out of box.
 - sets default server IP address to 127.0.0.1 for users to use local client out
   of box.
 - integrates certtool and provides gnutls-help.py for users to generate keys
   and certificates on targets in their own ways.
 - adds a PACKAGECONFIG option "gnutls" to control all of the above integration
   but disables it to keep the same default behavior as before.

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-07-16 19:41:05 +00:00
Mingli Yu
990d6d8d2b libvirt: Only add polkit to PACKAGECONFIG if polkit is in DISTRO_FEATURES
At first, the polkit support is always enabled in
PACKAGECONFIG and since Feb 27 2014, use x11
DISTRO_FEATURES to control the polkit support
with below commit.
=========================================================
commit ce991a62d5
Author: Jonas Eriksson <jonas.eriksson@enea.com>
Date:   Thu Feb 27 17:10:09 2014 +0100

    libvirt: Disable polkit driver when there is no x11

    To avoid having the default build of libvirt depend on virtual/x11
    through polkit and consolekit, check for x11 in DISTRO_FEATURES before
    enabling the polkit support in the default PKG_CONFIG.

    Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com>
    Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>
    Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>

 diff --git a/recipes-extended/libvirt/libvirt_1.2.1.bb b/recipes-extended/libvirt/libvirt_1.2.1.bb
 index 5365b8d..4c9cf36 100644
 --- a/recipes-extended/libvirt/libvirt_1.2.1.bb
 +++ b/recipes-extended/libvirt/libvirt_1.2.1.bb
 @@ -109,10 +109,11 @@ INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
  #PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd"

  # full config
 -PACKAGECONFIG ??= "qemu yajl uml openvz vmware vbox esx iproute2 polkit lxc test \
 +PACKAGECONFIG ??= "qemu yajl uml openvz vmware vbox esx iproute2 lxc test \
                    remote macvtap libvirtd netcf udev python ebtables \
                    ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
                    ${@base_contains('DISTRO_FEATURES', 'xen', 'xen libxl xen-inotify', '', d)} \
 +                   ${@base_contains('DISTRO_FEATURES', 'x11', 'polkit', '', d)} \
                   "
=========================================================

After below commits to add polkit as a required distro feature
in meta-oe, we should unify altogether to enable polkit if
polkit distro feature is set.
97a1a55 polkit: add polkit as a required distro
feature c049e02 polkit: inherit distro_features_check

Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-07-16 19:40:49 +00:00
Bruce Ashfield
cd3767f0b0 libvirt: uprev to 5.5.x
Upgrading to 5.5.x for libvirt.

One pach refresh is required, but otherwise, build and runtime behaviour
is identical to 5.3.x.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-07-12 14:50:34 +00:00
Dengke Du
8e634ac487 libvirt: upgrade to 5.3.0
1. remove the uml configure option because new version libvirt drop it
2. rebase three patches for new source codes

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-05-10 16:42:06 -04:00
Dengke Du
a1528f85a6 libvirt: place the qemu configure option to PACKAGECONFIG
If we build libvirt with mips64 arch will fail that was not compatible with,
so place the qemu configure options to PACKAGECONFIG, let the PACKAGECONFIG
control the build options.

qemu is in the default PACKAGECONFIG, so we are not changing the build
for non-mips architectures.

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-03-20 14:42:42 -04:00
Dengke Du
b5b5defc78 libvirt: add hook support
1. Add a hook support script for libvirt
   Add daemon, qemu, lxc and network script when the correspond to
   libvirt daemon, qemu guest, lxc guest and network started or stoped,
   based on:
   https://libvirt.org/hooks.html

2. Add a qemu user and a qemu group and a kvm group

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-03-01 11:37:46 -05:00
Chris Patterson
fe63f43470 libvirt: fix dependency for libxl
"libxl" package does not exist, use Xen.

Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-02-06 20:51:09 +00:00
Mark Asselstine
9ad042c295 libvirt: uprev from 4.7.0 to 4.9.0
Minor update bringing in new features such as better support for
cgroup v2, vfio AP support, support for XEN suspend/wakeup.

Basic usecases pass and the ptest return similar results we have been
achieving with the last few uprevs:

    ====================================
    Testsuite summary for libvirt 4.9.0
    ====================================
    # TOTAL: 120
    # PASS:  117
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  3
    # XPASS: 0
    # ERROR: 0

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
2018-11-29 12:05:18 -05:00
Kai Kang
7403b5a691 libvirt: remove qemu from PACKAGECONFIG for mips n32 and n64
PACKAGECONFIG 'qemu' causes libvirt depends on package qemu. But qemu
is not compatible with mips n32 and n64. So remove 'qemu' from
PACKAGECONFIG for mips n32 and n64.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-10-18 11:37:55 -04:00
Chen Qi
915c43874d libvirt: do not defer postinstall to first boot when not necessary
The postinstall invokes `/etc/init.d/populate-volatile.sh update'.
This is only useful for an on-target package upgrade. For now,
this postinstall in libvirt has already got a check against $D to
tell whether it's running on target or not, we do not need to use
pkg_postinstall_ontarget. Otherwise, we get unnecessary postinstall
deferred to first boot, which is not what we want.

Note that the postinstall was originally written as 'pkg_postinstall_${PN}',
but was incorrectly modified to be 'pkg_postinstall_ontarget_${PN}' by the
following commit.

  """
  commit 1e67a44db7
  Author: He Zhe <zhe.he@windriver.com>
  Date:   Tue Jul 24 05:50:01 2018 -0700

      libvirt: Remove unsupported configure options and fix warning

  [snip]
  """

I think the warning about deferred postinstall was caused by some bbappend
file instead of the main recipe in this layer.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-10-16 10:25:36 -04:00
Mark Asselstine
6e3fb05e2a libvirt: backport LXC AB / BA deadlock fix
This fix will most likely be part of libvirt 4.8.0 but since we took
the time to investigate and fix this issue we are including it now to
prevent others from hitting this issue.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-09-30 21:31:14 -04:00
Mark Asselstine
b3619dec91 libvirt: uprev to v4.7.0
A straight-forward uprev to the latest stable release. As usual basic
runtime sanity tests have been run along with the ptests. The
following is the results of the ptests:

  ====================================
  Testsuite summary for libvirt 4.7.0
  ====================================
  # TOTAL: 120
  # PASS:  117
  # SKIP:  0
  # XFAIL: 0
  # FAIL:  3
  # XPASS: 0
  # ERROR: 0

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-09-30 21:31:14 -04:00
Mark Asselstine
2c8e62d5b4 libvirt: uprev to v4.5.0
Although v4.6.0 was just recently released we do not want to jump to
it due to:

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

Unfortunately the mess around the above defect basically renders that
release useless. We will need to keep an eye for either a v4.7.0 or
grab updates off of the 'v4.5-maint' over the coming weeks.

As usual I have tested using qemu and lxc usecases (define, boot and
'virsh console' onto a guest). The ptests results match those of
v4.3.0:

  ======================================
  Testsuite summary for libvirt 4.5.0
  ======================================
  # TOTAL: 119
  # PASS:  114
  # SKIP:  0
  # XFAIL: 0
  # FAIL:  5
  # XPASS: 0
  # ERROR: 0

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-08-20 11:35:48 -04:00
Mark Asselstine
cdd4241dd7 libvirt: fixup ptest to prevent attempts to build tests on the target
Oddly something seems to have changed since I did the uprev of libvirt
to v4.3.0. Previously using the 'run-ptests' script would only run the
tests and not attempt to build them first. In preparation for the
uprev to v4.5.0 I attempted to run the tests and found that they would
fail to run and instead the tests were attempting to be built. I
suspect this change is caused by an uprev of autotools and the
handling of the 'TESTS' built-in.

To prevent this we are explicitly using the '--with-test-suite'
configure option and this return the previously observed behavior,
where the tests are simply run and not built.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-08-20 11:35:48 -04:00
Joe Slater
02d2c7daeb libvirt: use relative path to local .m4 files
If our project is in a directory with a pathname of longer than
about 125 characters, configuration will fail with an "Argument
list too long" error.  This patch uses the technique that was applied
to the coreutils recipe.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-08-02 22:57:14 -04:00
He Zhe
1e67a44db7 libvirt: Remove unsupported configure options and fix warning
xen and xen-inotify have been removed from upstream. We change
PACKAGECONFIG accordingly.

pkg_postinst has been deprecated, use pkg_postinst_ontarget instead.

WARNING: do_rootfs: Intentionally failing postinstall scriptlets of
['libvirt'] to defer them to first boot is deprecated. Please place
them into pkg_postinst_ontarget_${PN} ().

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-07-26 10:42:06 -04:00
Jeremy Puhlman
8af86bc72d libvirt: Check for qemu.conf before modifying
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-06-14 04:32:53 -04:00
Mark Asselstine
9afe74cd35 libvirt: fix build error caused by host 'xmllint'
There is host contamination in that we force XMLLINT to be
'/usr/bin/xmllint' via ac_cv_path_XMLLINT. This results in the error:

    /bin/bash: /usr/bin/xmllint: No such file or directory

We only use XMLLINT during the build, it is present in two Makefiles
included with ptest package but they are unused. So we drop the
setting of ac_cv_path_XMLLINT to ensure we are using xmllint in the
recipe sysroot instead of the host's. Should the ptest package ever
evolve to make use of the Makefiles we need to update not only the
XMLLINT path but that for XSLTPROC and others too. (I would suggest
that the Makefiles may have been used on the target as part of ptest
at one point, but are no longer and should be removed, though I
haven't investigated further).

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-06-06 23:03:49 -04:00
Mark Asselstine
343b40ba0d libvirt: uprev to the latest release, v4.3.0
We have been using the 1.3.x release series for a long time now which
has been great for stability but is slowly becoming harder and harder
to track and port bug and CVE fixes. This is a big jump to the latest
upstream release which gives us access to a myriad of fixes as well as
puts us in a better position to contribute to the upstream project
when issues are found.

Several patches have been dropped as they are either no longer valid
against this release or have equivalent updates already applied to the
upstream project. Some patches were consolidated which should ease
future uprevs of this recipe. The majority of the updates were related
to ptest patches, which is not a huge surprise given this code has no
upstream equivalent.

The overall runtime behavior remains much the same from v1.3.5 with
the only notable configuration change being for 'seccomp_sandbox'
which has been disabled here but should possibly be revisited in the
near future.

As usual the normal runtime usecases for qemu/kvm and lxc have been
run successfully along with ptest results which are by and large OK:

    ====================================
    Testsuite summary for libvirt 4.3.0
    ====================================
    # TOTAL: 119
    # PASS:  115
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  4
    # XPASS: 0
    # ERROR: 0

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-06-05 12:01:01 -04:00
Mark Asselstine
2e8e063633 libvirt: fixups for glibc 2.27 - with Sun RPC Interfaces removed
With Sun RPC Interfaces removed from libc we need to use an external
provider for rpc. Polling other distros there seems to be consensus to
use libtirpc so we follow this trend.

Unfortunately this should only require the DEPENDS addition to the
recipe but the upstream project has a few flaws in their Makefiles and
configure which we need to work around so we add 2 new patches to
address these to allow for the use of a sysroot and to use the
$XDR_CFLAGS in a few more places.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2018-05-10 16:43:28 -04:00
Mark Asselstine
00a801aee1 dnsmasq: add dnsmasq.d entries for lxc and libvirt
A while ago changes were merged to meta-openembedded to make
/etc/dnsmasq.d (and specifically the files it contains) referenced
when the main instance of dnsmasq is run (see dnsmasq.service and
commit ba665493a0dd [dnsmasq: allow for dnsmasq instances to reuse
default dnsmasq.conf]).

We, however, continued to modify the global configuration
(/etc/dnsmasq.conf) to keep the main instance of dnsmasq from
attaching to virbr0 and lxcbr0, by using 'bind-dynamic'. This approach
is problematic, since it is common that other instances of dnsmasq
will make use of the global configuration file and may have
incompatible options. We see this for example when attempting to start
lxc-net which will attempt to use 'bind-interface' which is
incompatible with 'bind-dynamic' that we were adding to the global
configuration.

Here we remove our change to the global configuration (leaving it
mostly empty as it should be) and instead have lxc and libvirt
packages instruct the global instance not to bind to virbr0 and lxcbr0
by adding configuration files to /etc/dnsmasq.d (setting
except-interface).

The added benefit to this approach is that if lxc or libvirt are not
part of an image the global configuration will not be modified in such
a way as to expect that they are present.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-12-28 11:12:26 -05:00
Chunrong Guo
99013658ea libvirt: fix build failure, failing QA check
The build is failing due to a failing QA check:

   ERROR: libvirt-1.3.5-r0 do_package_qa: QA Issue: /usr/lib/libvirt/ptest/tests/tests/check-file-access.pl
   contained in package libvirt-ptest requires /usr/bin/perl,
   but no providers found in RDEPENDS_libvirt-ptest? [file-rdeps]

Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-08-29 08:43:11 -04:00
Mark Asselstine
b69f147839 libvirt: add DEPENDS for libdevmapper
Commit 8709d4504c35817ef1d7181b47ba96c3ca0c949e [lvm2: separate
libdevmapper to avoid circular dependency] in meta-oe meant that our
build would fail with

  checking for libdevmapper.h... no
  configure: error: You must install device-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt

Add the required DEPENDS for libdevmapper to get the build working as
it did prior to this meta-oe change.

NOTE: our previous dependency on lvm2 was not only to get libdevmapper
functionality, so lvm2 remains a valid DEPENDS, so is left in place.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-04-27 16:37:59 -04:00
Rob Woolley
67c86c4962 libvirt: Fix conditional dependencies on polkit
The DIRFILES variable was a temporary workaround to resolve a do_rootfs
RPM package conflict between libvirt and polkit.

This happened because of the different permissions and ownership that the
packages placed on ${datadir}/usr/share/polkit-1/rules.d.

The behaviour is now conditional based on how PACKAGECONFIG is set.  The
polkit rules will be removed from the package if polkit is not enabled.
If polkit is enabled the permissions and ownership are set to match those
set by the polkit recipe.

This uses the useradd enhancements for RSS.  It requires that shadow-native
be included as a DEPENDS to provide the useradd command in the native
sysroot.

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-04-24 22:51:26 -04:00
Bruce Ashfield
b199517966 libvirt: fix polkit file conflict
The switch to RPM4 and dnf results in this error during rootfs construction:

  Error: Transaction check error:
    file /usr/share/polkit-1/rules.d conflicts between attempted installs of libvirt-1.3.5-r0.13.core2_64 and polkit-0.113-r0.9.core2_64

We can temporarily work around it by instructing RPM to not package/process
the dirfiles.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-03-20 23:57:39 -04:00
Zhenbo Gao
f26d43b773 libvirt: fix QA warning caused by missing acl build dep
The patch fix the following QA warning:
--
WARNING: QA Issue: libvirt rdepends on libacl, but it isn't a build dependency? [build-deps]

Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-03-14 10:12:11 -04:00
Amarnath Valluri
ee0b5e316a libvirt: Place systemd units at appropriate location.
Systemd untis should be placed as per ${systemd_system_unitdir}.

Patched the source code to support configure variable to set the systemd units
directory.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-02-09 09:13:57 -05:00
Paul Barker
e64f378b93 Remove True option to getVar calls
getVar() now defaults to expanding by default.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-01-03 10:28:33 -05:00
Mark Asselstine
66997c4dcf libvirt: add 'wireshark' packageconfig
libvirt by default has '--with-wireshark-dissector' set to
'check'. Therefor if wireshark is built before vs after libvirt this
will result in a potentially unexpected difference in how libvirt is
configured. Additionally the build of libvirt with wireshark
capabilities enabled is currently broken and thus if attempted will
result in the error:

fatal error: ws_symbol_export.h: No such file or directory

To prevent the random configuration of libvirt with respect to
wireshark we add a new packageconfig for wireshark.

NOTE that the wireshark recipe is currently incomplete so this new
packageconfig will result in a build failure if used, until wireshark
is updated to build libwsutil.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
2016-11-17 13:02:23 -05:00
Kai Kang
b25af25747 libvirt: remove .o files for ptest
When do split_and_strip_files, it may calls debugedit to deal elf files.
For ptest sub-package, it fails to run debugedit with .o files. So remove
the .o files which are redundant to run ptest cases.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2016-09-22 10:05:18 -04:00
He Zhe
548c88a90a libvirt: Add missing test helpers and remove windows 1252
Add missing test helpers
We don't support windows encoding so remove that case

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2016-09-06 09:35:45 -04:00
Mark Asselstine
3907b09619 libvirt: update list of licenses
Apparently if a license is listed for a package it must be included in
the overall LICENSE variable otherwise you will get WARNINGS such as:

    WARNING: LICENSE_libvirt-ptest includes licenses (LGPLv2.1 GPLv2+)
    that are not listed in LICENSE

We ensure that the license string is consistent between the LICENSE
variable and the subpackage license string to remove this
warning. Since '2+' is a superset of '2', ie. "version 2 or later",
and actually is more reflective of the text found on the file headers
and such we use GPLv2+ and LGPLv2.1+.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2016-08-31 11:03:26 -04:00
Kai Kang
42af8a171b libvirt: fix CVE-2016-5008
Backport patch to fix CVE-2016-5008 from:

https://libvirt.org/git/?p=libvirt.git;a=commit;h=f32441c

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2016-08-16 11:17:49 -04:00
Kai Kang
bdcf476c10 libvirt: fix build error for arm
When build for architecture that don't use gcc atomic ops but pthread,
it fails to build for arm:

| ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virClassNew':
| /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:153: undefined reference to `virAtomicLock'
| ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virObjectNew':
| /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:205: undefined reference to `virAtomicLock'
| ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virObjectUnref':
| /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:277: undefined reference to `virAtomicLock'
| ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virObjectRef':
| /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:298: undefined reference to `virAtomicLock'
| collect2: error: ld returned 1 exit status

It is similar with:

http://libvirt.org/git/?p=libvirt.git;a=commit;h=12dc729

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2016-08-08 10:21:24 -04:00