[libvirt] [PATCHv3 12/13] build: switch --with-qemu default from yes to check

Ján Tomko posted 13 patches 7 years ago
[libvirt] [PATCHv3 12/13] build: switch --with-qemu default from yes to check
Posted by Ján Tomko 7 years ago
Unless explicitly requested, enable the QEMU driver
only if the Jansson library is present.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 m4/virt-driver-qemu.m4 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
index 80e1d3ad46..ddb2834705 100644
--- a/m4/virt-driver-qemu.m4
+++ b/m4/virt-driver-qemu.m4
@@ -18,7 +18,7 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
-  LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [yes])
+  LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [check])
   LIBVIRT_ARG_WITH([QEMU_USER], [username to run QEMU system instance as],
                    ['platform dependent'])
   LIBVIRT_ARG_WITH([QEMU_GROUP], [groupname to run QEMU system instance as],
@@ -26,6 +26,10 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
 ])
 
 AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [
+  AC_REQUIRE([LIBVIRT_CHECK_JANSSON])
+  if test "$with_qemu" = "check"; then
+    with_qemu=$with_jansson
+  fi
   if test "$with_qemu" = "yes" ; then
     AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled])
   fi
-- 
2.16.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv3 12/13] build: switch --with-qemu default from yes to check
Posted by Peter Krempa 6 years, 12 months ago
On Fri, May 11, 2018 at 14:59:13 +0200, Ján Tomko wrote:
> Unless explicitly requested, enable the QEMU driver
> only if the Jansson library is present.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  m4/virt-driver-qemu.m4 | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
> index 80e1d3ad46..ddb2834705 100644
> --- a/m4/virt-driver-qemu.m4
> +++ b/m4/virt-driver-qemu.m4
> @@ -18,7 +18,7 @@ dnl <http://www.gnu.org/licenses/>.
>  dnl
>  
>  AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
> -  LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [yes])

Well if we've required it until now, I'd be inclined to continue doing
so.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv3 12/13] build: switch --with-qemu default from yes to check
Posted by Ján Tomko 6 years, 12 months ago
On Tue, May 15, 2018 at 03:14:33PM +0200, Peter Krempa wrote:
>On Fri, May 11, 2018 at 14:59:13 +0200, Ján Tomko wrote:
>> Unless explicitly requested, enable the QEMU driver
>> only if the Jansson library is present.
>>
>> Signed-off-by: Ján Tomko <jtomko@redhat.com>
>> ---
>>  m4/virt-driver-qemu.m4 | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
>> index 80e1d3ad46..ddb2834705 100644
>> --- a/m4/virt-driver-qemu.m4
>> +++ b/m4/virt-driver-qemu.m4
>> @@ -18,7 +18,7 @@ dnl <http://www.gnu.org/licenses/>.
>>  dnl
>>
>>  AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
>> -  LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [yes])
>
>Well if we've required it until now, I'd be inclined to continue doing
>so.

The idea was to not introduce another dependency for default
'./autogen.sh', while still producing an error for someone requesting
--with-qemu without having a JSON library installed.

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv3 12/13] build: switch --with-qemu default from yes to check
Posted by Andrea Bolognani 6 years, 12 months ago
On Tue, 2018-05-15 at 16:00 +0200, Ján Tomko wrote:
> On Tue, May 15, 2018 at 03:14:33PM +0200, Peter Krempa wrote:
> > >  AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
> > > -  LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [yes])
> > 
> > Well if we've required it until now, I'd be inclined to continue doing
> > so.
> 
> The idea was to not introduce another dependency for default
> './autogen.sh', while still producing an error for someone requesting
> --with-qemu without having a JSON library installed.

I agree with your reasoning, so ACK on my part.

We should do the same for the VirtualBox and ESX drivers, too.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list