[libvirt PATCH v3 3/8] meson: drop check for runtime binary dependencies

Pavel Hrdina phrdina at redhat.com
Wed Apr 21 12:37:26 UTC 2021


These binaries are used only during runtime so technically there is no
need to check for them while compiling libvirt.

Usually the location is the same while compiling and running but it may
not be true. In addition they are not strictly required to compile the
code so this way developers don't have to install it or create fake
binaries in order to compile the code.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 meson.build                          | 63 ----------------------------
 src/network/bridge_driver.c          |  2 +
 src/node_device/node_device_driver.c |  2 +
 src/qemu/qemu_conf.c                 |  5 +++
 src/storage/storage_util.c           |  2 +
 src/util/virdnsmasq.c                |  1 +
 src/util/virfirewall.h               |  4 ++
 src/util/virkmod.h                   |  3 ++
 src/util/virnetdevbandwidth.h        |  2 +
 src/util/virnetdevip.c               |  2 +
 src/util/virnetdevmidonet.c          |  2 +
 src/util/virnetdevopenvswitch.c      |  2 +
 src/util/virsysinfo.c                |  1 +
 src/util/virutil.c                   |  2 +
 14 files changed, 30 insertions(+), 63 deletions(-)

diff --git a/meson.build b/meson.build
index 837955de37..fc8fc4f252 100644
--- a/meson.build
+++ b/meson.build
@@ -926,24 +926,9 @@ endforeach
 
 optional_programs = [
   'augparse',
-  'dmidecode',
-  'dnsmasq',
-  'ebtables',
   'flake8',
-  'ip',
-  'ip6tables',
-  'iptables',
   'iscsiadm',
-  'mdevctl',
-  'mm-ctl',
-  'modprobe',
-  'ovs-vsctl',
   'pdwtags',
-  'radvd',
-  'rmmod',
-  'scrub',
-  'tc',
-  'udevadm',
 ]
 
 foreach name : optional_programs
@@ -1706,54 +1691,6 @@ if not get_option('driver_qemu').disabled()
     endif
     conf.set_quoted('QEMU_USER', qemu_user)
     conf.set_quoted('QEMU_GROUP', qemu_group)
-
-    qemu_bridge_prog = find_program(
-      'qemu-bridge-helper',
-      dirs: [ '/usr/libexec', '/usr/lib/qemu', '/usr/lib' ],
-      required: false
-    )
-    if qemu_bridge_prog.found()
-      qemu_bridge_path = qemu_bridge_prog.path()
-    else
-      qemu_bridge_path = '/usr/libexec/qemu-bridge-helper'
-    endif
-    conf.set_quoted('QEMU_BRIDGE_HELPER', qemu_bridge_path)
-
-    qemu_pr_prog = find_program(
-      'qemu-pr-helper',
-      dirs: [ '/usr/bin', '/usr/libexec' ],
-      required: false
-    )
-    if qemu_pr_prog.found()
-      qemu_pr_path = qemu_pr_prog.path()
-    else
-      qemu_pr_path = '/usr/bin/qemu-pr-helper'
-    endif
-    conf.set_quoted('QEMU_PR_HELPER', qemu_pr_path)
-
-    qemu_slirp_prog = find_program(
-      'slirp-helper',
-      dirs: [ '/usr/bin', '/usr/libexec' ],
-      required: false
-    )
-    if qemu_slirp_prog.found()
-      qemu_slirp_path = qemu_slirp_prog.path()
-    else
-      qemu_slirp_path = '/usr/bin/slirp-helper'
-    endif
-    conf.set_quoted('QEMU_SLIRP_HELPER', qemu_slirp_path)
-
-    qemu_dbus_daemon_prog = find_program(
-      'dbus-daemon',
-      dirs: [ '/usr/bin', '/usr/libexec' ],
-      required: false
-    )
-    if qemu_dbus_daemon_prog.found()
-      qemu_dbus_daemon_path = qemu_dbus_daemon_prog.path()
-    else
-      qemu_dbus_daemon_path = '/usr/bin/dbus-daemon'
-    endif
-    conf.set_quoted('QEMU_DBUS_DAEMON', qemu_dbus_daemon_path)
   endif
 endif
 
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index ee3f9dab0a..8e1a42b119 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -74,6 +74,8 @@
 #define VIR_FROM_THIS VIR_FROM_NETWORK
 #define MAX_BRIDGE_ID 256
 
+#define RADVD "radvd"
+
 static virMutex bridgeNameValidateMutex = VIR_MUTEX_INITIALIZER;
 
 /**
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index b0cc63ed42..bf70083f2a 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -48,6 +48,8 @@
 
 VIR_LOG_INIT("node_device.node_device_driver");
 
+#define MDEVCTL "mdevctl"
+
 virNodeDeviceDriverState *driver;
 
 
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 437b3ce2be..d228504d8c 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -55,6 +55,11 @@
 
 VIR_LOG_INIT("qemu.qemu_conf");
 
+#define QEMU_BRIDGE_HELPER "qemu-bridge-helper"
+#define QEMU_PR_HELPER "qemu-pr-helper"
+#define QEMU_SLIRP_HELPER "slirp-helper"
+#define QEMU_DBUS_DAEMON "dbus-daemon"
+
 /* These are only defaults, they can be changed now in qemu.conf and
  * explicitly specified port is checked against these two (makes
  * sense to limit the values).
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 7efadc2197..c225f2ab6b 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -84,6 +84,8 @@ VIR_LOG_INIT("storage.storage_util");
 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
 #endif
 
+#define SCRUB "scrub"
+
 /* virStorageBackendNamespaceInit:
  * @poolType: virStoragePoolType
  * @xmlns: Storage Pool specific namespace callback methods
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index f2f606913f..b666c2f9d3 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -48,6 +48,7 @@ VIR_LOG_INIT("util.dnsmasq");
 
 #define DNSMASQ_HOSTSFILE_SUFFIX "hostsfile"
 #define DNSMASQ_ADDNHOSTSFILE_SUFFIX "addnhosts"
+#define DNSMASQ "dnsmasq"
 
 static void
 dhcphostFreeContent(dnsmasqDhcpHost *host)
diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h
index 169d99fe2b..a3954c5ed0 100644
--- a/src/util/virfirewall.h
+++ b/src/util/virfirewall.h
@@ -22,6 +22,10 @@
 
 #include "internal.h"
 
+#define EBTABLES_PATH "ebtables"
+#define IPTABLES_PATH "iptables"
+#define IP6TABLES_PATH "ip6tables"
+
 typedef struct _virFirewall virFirewall;
 
 typedef struct _virFirewallRule virFirewallRule;
diff --git a/src/util/virkmod.h b/src/util/virkmod.h
index bb043d4876..58311909eb 100644
--- a/src/util/virkmod.h
+++ b/src/util/virkmod.h
@@ -23,6 +23,9 @@
 
 #include "internal.h"
 
+#define MODPROBE "modprobe"
+#define RMMOD "rmmod"
+
 char *virKModLoad(const char *)
     ATTRIBUTE_NONNULL(1);
 char *virKModUnload(const char *)
diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h
index 3d520721f6..6c91bd0f33 100644
--- a/src/util/virnetdevbandwidth.h
+++ b/src/util/virnetdevbandwidth.h
@@ -21,6 +21,8 @@
 #include "internal.h"
 #include "virmacaddr.h"
 
+#define TC "tc"
+
 typedef struct _virNetDevBandwidthRate virNetDevBandwidthRate;
 struct _virNetDevBandwidthRate {
     unsigned long long average;  /* kbytes/s */
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index 0ce8f5b536..f4cf6ac39f 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -50,6 +50,8 @@
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
+#define IP_PATH "ip"
+
 VIR_LOG_INIT("util.netdevip");
 
 #if defined(WITH_LIBNL)
diff --git a/src/util/virnetdevmidonet.c b/src/util/virnetdevmidonet.c
index 9061f1516f..735607e5df 100644
--- a/src/util/virnetdevmidonet.c
+++ b/src/util/virnetdevmidonet.c
@@ -26,6 +26,8 @@
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
+#define MM_CTL "mm-ctl"
+
 /**
  * virNetDevMidonetBindPort:
  * @ifname: the network interface name
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 21ee4bdd42..a05128dbca 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -35,6 +35,8 @@
 
 VIR_LOG_INIT("util.netdevopenvswitch");
 
+#define OVS_VSCTL "ovs-vsctl"
+
 /*
  * Set openvswitch default timeout
  */
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index af9e03c5ac..8bbda9ea69 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -53,6 +53,7 @@ static const char *sysinfoCpuinfo = "/proc/cpuinfo";
 #define SYSINFO sysinfoSysinfo
 #define CPUINFO sysinfoCpuinfo
 #define CPUINFO_FILE_LEN (1024*1024)    /* 1MB limit for /proc/cpuinfo file */
+#define DMIDECODE "dmidecode"
 
 
 void
diff --git a/src/util/virutil.c b/src/util/virutil.c
index 3f49a469e5..b7a9808f6a 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -57,6 +57,8 @@
 #include "virutil.h"
 #include "virsocket.h"
 
+#define UDEVADM "udevadm"
+
 G_STATIC_ASSERT(sizeof(gid_t) <= sizeof(unsigned int) &&
        sizeof(uid_t) <= sizeof(unsigned int));
 
-- 
2.30.2




More information about the libvir-list mailing list