From nobody Tue Sep 9 09:44:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1745925330; cv=none; d=zohomail.com; s=zohoarc; b=aGEi0eimEANuU04MDCqQaJHSRsEbMqP2aOKC6zON5U5Qnqa+ecweQAXxHvDuHiSMEndFmJ+Mv040nXWRN72r4GexM1xWeagQybOU9rI4Nxc7biMhNm+fvzPZ+xYZMVlv8uF9vf0fepei0Y8zzkPPePNcjwszQ/H0YiAc0rDfVLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745925330; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=GOK2U1kQmtFme43Y6v3/GMROqaxc2DEoUJoE+2yUx3o=; b=b7In3k/TaawTjGxW+1SMfyWuC1gUWsuHZgw94pwtNuC62SgbXtvGb/EusXa5t0L2dzybAjMwR823qtMANYIvy2d3PAcFpuwwUiTBP2fuUScd9V8NViXCrwkhT9FCYKxgplwQDngnzl8aTGb4gW+xXeDknzW+w9W7BnBXkWL66I4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1745925330646192.9745119489471; Tue, 29 Apr 2025 04:15:30 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9B0821452; Tue, 29 Apr 2025 07:15:29 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 9C0C41274; Tue, 29 Apr 2025 07:14:31 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0855D121D; Tue, 29 Apr 2025 07:14:28 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 866BF11F1 for ; Tue, 29 Apr 2025 07:14:27 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-277-qKUlpNI9MF6_Eej4RelswQ-1; Tue, 29 Apr 2025 07:14:25 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A78761800446 for ; Tue, 29 Apr 2025 11:14:23 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.98]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D244F195608D; Tue, 29 Apr 2025 11:14:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1745925267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GdPuW7Wjrw9V9E3pxh7gUXiyZyN/jwSpwMXPcDVgxCM=; b=B7T4dxKYFmEjjvctgXOjA0QPpj43zSzaEzYpdODRuufkeWpYehMRbMYUQw/LVqFWTVlMS5 FgC33zm9eaGWuAdkXO23OD5tPYc/APRsjEorGjiOwQs4DjbCqNCZr7lP7QvL+WIy2CJ6jI xUTCmgJWL1CiqztuXRHF36npExZSNsk= X-MC-Unique: qKUlpNI9MF6_Eej4RelswQ-1 X-Mimecast-MFC-AGG-ID: qKUlpNI9MF6_Eej4RelswQ_1745925263 To: devel@lists.libvirt.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 01/20] storage: stop hardcoding paths for mkfs, mount, umount Date: Tue, 29 Apr 2025 12:14:01 +0100 Message-ID: <20250429111420.1748521-2-berrange@redhat.com> In-Reply-To: <20250429111420.1748521-1-berrange@redhat.com> References: <20250429111420.1748521-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: MM3eXxV_9AgSEAIZcbrvAUny_ZLKGloAG-a8oEHSDo4_1745925263 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HLNG6CMWXVTT744K6VYDZP2RHYWE25XZ X-Message-ID-Hash: HLNG6CMWXVTT744K6VYDZP2RHYWE25XZ X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1745925333582019100 Content-Type: text/plain; charset="utf-8" From: Daniel P. Berrang=C3=A9 This was always undesirable but now causes problems on Fedora 42 where at build time we detect a /sbin path but at runtime this will only exist on upgraded machines, not fresh installs. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- meson.build | 13 ------------- src/storage/storage_backend_fs.c | 17 +++-------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/meson.build b/meson.build index 37b1caa566..14c98b49a1 100644 --- a/meson.build +++ b/meson.build @@ -1827,23 +1827,10 @@ if conf.has('WITH_LIBVIRTD') endif endif =20 - if fs_enable - mount_prog =3D find_program('mount', required: get_option('storage_f= s'), dirs: libvirt_sbin_path) - umount_prog =3D find_program('umount', required: get_option('storage= _fs'), dirs: libvirt_sbin_path) - mkfs_prog =3D find_program('mkfs', required: get_option('storage_fs'= ), dirs: libvirt_sbin_path) - - if not mount_prog.found() or not umount_prog.found() or not mkfs_pro= g.found() - fs_enable =3D false - endif - endif - if fs_enable use_storage =3D true =20 conf.set('WITH_STORAGE_FS', 1) - conf.set_quoted('MOUNT', mount_prog.full_path()) - conf.set_quoted('UMOUNT', umount_prog.full_path()) - conf.set_quoted('MKFS', mkfs_prog.full_path()) endif endif =20 diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index fce395d60f..6ec359625a 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -304,7 +304,7 @@ virStorageBackendFileSystemMount(virStoragePoolObj *poo= l) if (!(src =3D virStorageBackendFileSystemGetPoolSource(pool))) return -1; =20 - cmd =3D virStorageBackendFileSystemMountCmd(MOUNT, def, src); + cmd =3D virStorageBackendFileSystemMountCmd("mount", def, src); =20 /* Mounting a shared FS might take a long time. Don't hold * the pool locked meanwhile. */ @@ -362,7 +362,7 @@ virStorageBackendFileSystemStop(virStoragePoolObj *pool) if ((rc =3D virStorageBackendFileSystemIsMounted(pool)) !=3D 1) return rc; =20 - cmd =3D virCommandNewArgList(UMOUNT, def->target.path, NULL); + cmd =3D virCommandNewArgList("umount", def->target.path, NULL); return virCommandRun(cmd, NULL); } #endif /* WITH_STORAGE_FS */ @@ -402,18 +402,7 @@ virStorageBackendExecuteMKFS(const char *device, g_autoptr(virCommand) cmd =3D NULL; g_autofree char *mkfs =3D NULL; =20 -#if WITH_STORAGE_FS - mkfs =3D virFindFileInPath(MKFS); -#endif /* WITH_STORAGE_FS */ - - if (!mkfs) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("mkfs is not available on this platform: Failed t= o make filesystem of type '%1$s' on device '%2$s'"), - format, device); - return -1; - } - - cmd =3D virCommandNewArgList(mkfs, "-t", format, NULL); + cmd =3D virCommandNewArgList("mkfs", "-t", format, NULL); =20 /* use the force, otherwise mkfs.xfs won't overwrite existing fs. * Similarly mkfs.ext2, mkfs.ext3, and mkfs.ext4 require supplying -F --=20 2.49.0