[meta-virtualization] [PATCH] Check for qemu pkgconfig before qemu.conf modify

Bruce Ashfield bruce.ashfield at gmail.com
Tue Jun 12 22:57:22 PDT 2018


On Tue, Jun 12, 2018 at 6:37 PM, Jeremy Puhlman <jpuhlman at mvista.com> wrote:

> /etc/libvirt/qemu.conf doesn't exist if qemu is disabled causing a
> build failure.
>
> Signed-off-by: Jeremy Puhlman <jpuhlman at mvista.com>
> ---
>  recipes-extended/libvirt/libvirt_4.3.0.bb | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/recipes-extended/libvirt/libvirt_4.3.0.bb
> b/recipes-extended/libvirt/libvirt_4.3.0.bb
> index ef51b9e..5cae02b 100644
> --- a/recipes-extended/libvirt/libvirt_4.3.0.bb
> +++ b/recipes-extended/libvirt/libvirt_4.3.0.bb
> @@ -266,8 +266,10 @@ do_install_append() {
>         fi
>
>         # disable seccomp_sandbox
> -       sed -i '/^#seccomp_sandbox = 1/aseccomp_sandbox = 0' \
> -           ${D}${sysconfdir}/libvirt/qemu.conf
> +        if ${@bb.utils.contains('PACKAGECONFIG', 'qemu', 'true',
> 'false', d)}; then
>

Rather than key off the package config, why not just test for the file's
existence and then only operate on it if it is there ? That is always safe,
simpler and protects us from build failures if the behaviour/output of
libvirt changes with respect to qemu in the future.

We could argue that we could check both, or warn if the package config is
on, but the file isn't present .. but I'd still prefer to just keep it
simple and all basic shell operations.

Cheers,

Bruce


> +          sed -i '/^#seccomp_sandbox = 1/aseccomp_sandbox = 0' \
> +              ${D}${sysconfdir}/libvirt/qemu.conf
> +        fi
>
>         # Add hook support for libvirt
>         mkdir -p ${D}/etc/libvirt/hooks
> --
> 2.6.2
>
> --
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-virtualization/attachments/20180613/30727a5c/attachment.html>


More information about the meta-virtualization mailing list