From nobody Sun Feb 8 14:07:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1618852511; cv=none; d=zohomail.com; s=zohoarc; b=WfPfNdTUl49sjrPsS4/Y5CVMuvCcn0A3JdXDAJMtxBG40VRBQ12gbYVDIcPPDuk6KsfoO1t1PGqyVbAsNX8TTzbRBWN/mveRMhxIfsBtIohQPjjeZxvlRQGGD6GLQYqJFibK2MQEHX1KSxGPfkciyMFQFDf6rtW4bySN3VuFcxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618852511; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e/OoVwWHaGtv25LNCO929thdz35ryOLnkpug8uO8eWc=; b=HkpeEiuTvD7/Z79ltR9Lf7pR9BMMcMboUy7+QkI+27wu37f2RY43iapYCzqPIdDraLkWYfLYmFzJY+QlbvFhy8ZbRCXOZxiVpZeyd7WCX+wAhhEpqTWawEelJ4V2YuuC9V1KfDIZ42jpXDnkVenTyQcy3E7Fr5l7LXfhLIRkl6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1618852511754251.67624377120228; Mon, 19 Apr 2021 10:15:11 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-574-CyNX8p0ZNCmUpJT4bU9aAw-1; Mon, 19 Apr 2021 13:15:07 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D4BC6D58B; Mon, 19 Apr 2021 17:15:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E13C7614FD; Mon, 19 Apr 2021 17:15:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A42011806D2B; Mon, 19 Apr 2021 17:15:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13JHEtFO022016 for ; Mon, 19 Apr 2021 13:14:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id BF3375D742; Mon, 19 Apr 2021 17:14:55 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EFE85D743 for ; Mon, 19 Apr 2021 17:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618852510; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=e/OoVwWHaGtv25LNCO929thdz35ryOLnkpug8uO8eWc=; b=fG4j1S8YQXqDmsx4kKc0kbKDY8XZB5iziXTPHxbol9og7YfSoG0WeZfONvlInaak1gGJgd ysFY8RxClPf905WWOihI3aOUc1ZQl3pVLBs8DAzsp2qAcYAVkmDsP/IOH7TxcS1ppTiUNa 3SwYZ7YLW90En6Ce8o/097wvcPWWoxI= X-MC-Unique: CyNX8p0ZNCmUpJT4bU9aAw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 18/21] meson: stop setting runtime binaries defines during compilation Date: Mon, 19 Apr 2021 19:14:21 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Technically the location of these binaries may be different when compiling libvirt or running it. This will allow users to change $PATH to use different binaries as well. Signed-off-by: Pavel Hrdina --- meson.build | 41 ++++---------------------- src/bhyve/bhyve_command.c | 4 +++ src/locking/lock_driver_lockd.c | 12 ++------ src/storage/storage_backend_logical.c | 13 ++++++++ src/storage/storage_backend_sheepdog.c | 2 ++ src/storage/storage_backend_zfs.c | 3 ++ src/storage/storage_util.h | 6 ++++ src/util/virnuma.c | 1 + 8 files changed, 36 insertions(+), 46 deletions(-) diff --git a/meson.build b/meson.build index 8c71e803bf..5d8eb7f95c 100644 --- a/meson.build +++ b/meson.build @@ -1074,9 +1074,7 @@ libparted_version =3D '1.8.0' libparted_dep =3D dependency('libparted', version: '>=3D' + libparted_vers= ion, required: false) if libparted_dep.found() parted_prog =3D find_program('parted', required: false, dirs: libvirt_sb= in_path) - if parted_prog.found() - conf.set_quoted('PARTED', parted_prog.path()) - else + if not parted_prog.found() libparted_dep =3D dependency('', required: false) endif endif @@ -1488,9 +1486,6 @@ if not get_option('driver_bhyve').disabled() and host= _machine.system() =3D=3D 'freeb =20 if bhyve_prog.found() and bhyvectl_prog.found() and bhyveload_prog.found= () conf.set('WITH_BHYVE', 1) - conf.set_quoted('BHYVE', bhyve_prog.path()) - conf.set_quoted('BHYVECTL', bhyvectl_prog.path()) - conf.set_quoted('BHYVELOAD', bhyveload_prog.path()) endif elif get_option('driver_bhyve').enabled() error('The bhyve driver cannot be enabled') @@ -1779,18 +1774,7 @@ if conf.has('WITH_LIBVIRTD') =20 if fs_enable use_storage =3D true - conf.set('WITH_STORAGE_FS', 1) - conf.set_quoted('MOUNT', mount_prog.path()) - conf.set_quoted('UMOUNT', umount_prog.path()) - conf.set_quoted('MKFS', mkfs_prog.path()) - - showmount_prog =3D find_program('showmount', required: false, dirs: = libvirt_sbin_path) - showmount_path =3D '' - if showmount_prog.found() - showmount_path =3D showmount_prog.path() - endif - conf.set_quoted('SHOWMOUNT', showmount_path) endif endif =20 @@ -1835,11 +1819,8 @@ if conf.has('WITH_LIBVIRTD') 'pvs', 'vgs', 'lvs', ] foreach name : lvm_progs - set_variable( - '@0@_prog'.format(name), - find_program(name, required: get_option('storage_lvm'), dirs: libv= irt_sbin_path) - ) - if not get_variable('@0@_prog'.format(name)).found() + lvm_prog =3D find_program(name, required: get_option('storage_lvm'),= dirs: libvirt_sbin_path) + if not lvm_prog.found() lvm_enable =3D false endif endforeach @@ -1847,10 +1828,6 @@ if conf.has('WITH_LIBVIRTD') if lvm_enable use_storage =3D true conf.set('WITH_STORAGE_LVM', 1) - - foreach name : lvm_progs - conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(na= me)).path()) - endforeach endif endif =20 @@ -1879,7 +1856,6 @@ if conf.has('WITH_LIBVIRTD') if sheepdogcli_prog.found() use_storage =3D true conf.set('WITH_STORAGE_SHEEPDOG', 1) - conf.set_quoted('SHEEPDOGCLI', sheepdogcli_prog.path()) endif endif =20 @@ -1902,11 +1878,8 @@ if conf.has('WITH_LIBVIRTD') if not get_option('storage_zfs').disabled() zfs_enable =3D true foreach name : ['zfs', 'zpool'] - set_variable( - '@0@_prog'.format(name), - find_program(name, required: get_option('storage_zfs'), dirs: libv= irt_sbin_path) - ) - if not get_variable('@0@_prog'.format(name)).found() + zfs_prog =3D find_program(name, required: get_option('storage_zfs'),= dirs: libvirt_sbin_path) + if not zfs_prog.found() zfs_enable =3D false endif endforeach @@ -1914,9 +1887,6 @@ if conf.has('WITH_LIBVIRTD') if zfs_enable use_storage =3D true conf.set('WITH_STORAGE_ZFS', 1) - foreach name : ['zfs', 'zpool'] - conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(na= me)).path()) - endforeach endif endif endif @@ -2030,7 +2000,6 @@ if not get_option('numad').disabled() and numactl_dep= .found() numad_prog =3D find_program('numad', required: get_option('numad'), dirs= : libvirt_sbin_path) if numad_prog.found() conf.set('WITH_NUMAD', 1) - conf.set_quoted('NUMAD', numad_prog.path()) endif elif get_option('numad').enabled() error('You must have numactl enabled for numad support.') diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index f8e0ce5123..061138c8ec 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -37,6 +37,10 @@ =20 #define VIR_FROM_THIS VIR_FROM_BHYVE =20 +#define BHYVE "bhyve" +#define BHYVECTL "bhyvectl" +#define BHYVELOAD "bhyveload" + VIR_LOG_INIT("bhyve.bhyve_command"); =20 static int diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index 823b918db3..ea787bf87d 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -454,7 +454,8 @@ static int virLockManagerLockDaemonNew(virLockManager *= lock, } =20 =20 -#ifdef LVS +#define LVS "lvs" + static int virLockManagerGetLVMKey(const char *path, char **key) @@ -508,15 +509,6 @@ virLockManagerGetLVMKey(const char *path, =20 return ret; } -#else -static int -virLockManagerGetLVMKey(const char *path, - char **key G_GNUC_UNUSED) -{ - virReportSystemError(ENOSYS, _("Unable to get LVM key for %s"), path); - return -1; -} -#endif =20 =20 static int virLockManagerLockDaemonAddResource(virLockManager *lock, diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_ba= ckend_logical.c index ed8e47d880..4bbb585d07 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -40,6 +40,19 @@ =20 VIR_LOG_INIT("storage.storage_backend_logical"); =20 +#define PVCREATE "pvcreate" +#define PVREMOVE "pvremove" +#define PVS "pvs" +#define VGCREATE "vgcreate" +#define VGREMOVE "vgremove" +#define VGCHANGE "vgchange" +#define VGSCAN "vgscan" +#define VGS "vgs" +#define LVCREATE "lvcreate" +#define LVREMOVE "lvremove" +#define LVCHANGE "lvchange" +#define LVS "lvs" + =20 static int virStorageBackendLogicalSetActive(virStoragePoolObj *pool, diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_b= ackend_sheepdog.c index 6490dfae52..beb6445e1e 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -35,6 +35,8 @@ =20 #define VIR_FROM_THIS VIR_FROM_STORAGE =20 +#define SHEEPDOGCLI "dog" + static int virStorageBackendSheepdogRefreshVol(virStoragePoolObj *pool, virStorageVolDef *vol); =20 diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backen= d_zfs.c index 6fabeade11..2a5d74357d 100644 --- a/src/storage/storage_backend_zfs.c +++ b/src/storage/storage_backend_zfs.c @@ -33,6 +33,9 @@ =20 VIR_LOG_INIT("storage.storage_backend_zfs"); =20 +#define ZFS "zfs" +#define ZPOOL "zpool" + /* * Some common flags of zfs and zpool commands we use: * -H -- don't print headers and separate fields by tab diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index aa3c25e9fc..487345ff22 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -25,6 +25,12 @@ #include "storage_driver.h" #include "storage_backend.h" =20 +#define PARTED "parted" +#define MOUNT "mount" +#define UMOUNT "umount" +#define MKFS "mkfs" +#define SHOWMOUNT "showmount" + /* Storage Pool Namespace options to share w/ storage_backend_fs.c and * the virStorageBackendFileSystemMountCmd method */ typedef struct _virStoragePoolFSMountOptionsDef virStoragePoolFSMountOptio= nsDef; diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 31f65d8902..d3cdc3ba53 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -52,6 +52,7 @@ =20 VIR_LOG_INIT("util.numa"); =20 +#define NUMAD "numad" =20 #if WITH_NUMAD char * --=20 2.30.2