]> xenbits.xensource.com Git - libvirt.git/commitdiff
meson: Don't require the parted command at build time
authorAndrea Bolognani <abologna@redhat.com>
Tue, 28 Dec 2021 10:47:56 +0000 (11:47 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 3 Jan 2022 10:39:49 +0000 (11:39 +0100)
We need libparted to be available at build time otherwise we
can't link against it; we don't, however, need the parted
command to be present until runtime and, just as is the case
for other commands, we already perform a lookup through the
virCommand API so making sure it's available at build time
is unnecessary.

This doesn't make any difference for platform such as Fedora
and CentOS, where both the library and the command are in the
same package, but others like Debian, Ubuntu and openSUSE
have separate packages for the two components and this change
means that we can install one less package at build time.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
meson.build
src/storage/storage_backend_disk.c
src/storage/storage_util.c

index 57561adf512b4b5f6a3212bb3385a6bd8a71441f..be51af193427a10e601e91551bdd378d03ecbcce 100644 (file)
@@ -1043,14 +1043,6 @@ endif
 
 libparted_version = '1.8.0'
 libparted_dep = dependency('libparted', version: '>=' + libparted_version, required: false)
-if libparted_dep.found()
-  parted_prog = find_program('parted', required: false, dirs: libvirt_sbin_path)
-  if parted_prog.found()
-    conf.set_quoted('PARTED', parted_prog.path())
-  else
-    libparted_dep = dependency('', required: false)
-  endif
-endif
 
 libpcap_version = '1.5.0'
 if not get_option('libpcap').disabled()
index 97554e2576bb947d1ea240aee38d91406545c144..be8a53557084776e453cd30e2d2bd7a32524f419 100644 (file)
@@ -40,6 +40,8 @@ VIR_LOG_INIT("storage.storage_backend_disk");
 
 #define SECTOR_SIZE 512
 
+#define PARTED "parted"
+
 static bool
 virStorageVolPartFindExtended(virStorageVolDef *def,
                               const void *opaque G_GNUC_UNUSED)
index 03874d6ca3666b2a5d317ae2de83f39c89e8fb4f..728710153e7382d29723abb3c63eaac17573bcc9 100644 (file)
@@ -85,6 +85,8 @@ VIR_LOG_INIT("storage.storage_util");
 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
 #endif
 
+#define PARTED "parted"
+
 /* virStorageBackendNamespaceInit:
  * @poolType: virStoragePoolType
  * @xmlns: Storage Pool specific namespace callback methods