From nobody Tue Apr 30 12:00:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1594711599; cv=none; d=zohomail.com; s=zohoarc; b=aKeehucPiiKKdAHdBWf3enIlOhdsQNCgeP/ZXCXfrWv5nGoUyBfjfkpR7Egd8yOrpDBwq5O6zTBZoDyk0f4CtDU2IaJ1Peechzz9VG1JkHfQL0C8SM9WIOriCV/djfLX1uDM51xv8zIzhNCbuNLJjeVQbCuToFDHOUxe7RxC/kg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594711599; h=Content-Type:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=QkBZkE3c+ImB3aBUu63NlHPwCPTdlTWvlIrrRZnX++s=; b=kPPBqYR5bL7OW06f5fQCBol17j/dUgqW/vkwraRwi1m7nJnhnotCr4pBsqY9YPJax35eoAomIVnneGrgG8daKmLeYyqIezQKt4OBCZg+hNzHZw3p/XV7GLHvQgMBYmxKkTRpEOegY24iLU/Xde5vvJ1EqhkWdBbQvG4uwZTUdrs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594711599517295.867970289044; Tue, 14 Jul 2020 00:26:39 -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-127-4SPR9Lk3NO--D4B57IEr6Q-1; Tue, 14 Jul 2020 03:26:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2633C800EB6; Tue, 14 Jul 2020 07:26:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5974B7880F; Tue, 14 Jul 2020 07:26:27 +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 30D3E94F03; Tue, 14 Jul 2020 07:26:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06E7QNwd011292 for ; Tue, 14 Jul 2020 03:26:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0833A110F0BE; Tue, 14 Jul 2020 07:26:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03E35112C267 for ; Tue, 14 Jul 2020 07:26:20 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88981100E7C6 for ; Tue, 14 Jul 2020 07:26:20 +0000 (UTC) Received: from relay3.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-UFuZt1eBNlm0WH7tzM6a-g-1; Tue, 14 Jul 2020 03:26:18 -0400 Received: from [172.16.50.220] (helo=vz7.localdomain) by relay3.sw.ru with esmtp (Exim 4.93) (envelope-from ) id 1jvFKH-00031D-HW for libvir-list@redhat.com; Tue, 14 Jul 2020 10:26:05 +0300 X-MC-Unique: 4SPR9Lk3NO--D4B57IEr6Q-1 X-MC-Unique: UFuZt1eBNlm0WH7tzM6a-g-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH] storage: find vstorage-mount binary in runtime Date: Tue, 14 Jul 2020 10:26:00 +0300 Message-Id: <1594711560-479037-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.14 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This allows us to use CI for vstorage driver without installing Virtuozzo Storage packages. This way we can leave aside license considerations. By the way we need to change configure defaults from 'check' to 'no' otherw= ise vstorage driver will be build on any system with umount binary which is not expected I guess. Signed-off-by: Nikolay Shirokovskiy --- m4/virt-storage-vstorage.m4 | 17 +---------------- src/storage/storage_backend_vstorage.c | 9 ++++++++- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/m4/virt-storage-vstorage.m4 b/m4/virt-storage-vstorage.m4 index e3b3bb4..cf0a543 100644 --- a/m4/virt-storage-vstorage.m4 +++ b/m4/virt-storage-vstorage.m4 @@ -21,30 +21,19 @@ dnl AC_DEFUN([LIBVIRT_STORAGE_ARG_VSTORAGE], [ LIBVIRT_ARG_WITH_FEATURE([STORAGE_VSTORAGE], [Virtuozzo Storage backend for the storage driv= er], - [check]) + [no]) ]) =20 AC_DEFUN([LIBVIRT_STORAGE_CHECK_VSTORAGE], [ if test "$with_storage_vstorage" =3D "yes" || test "$with_storage_vstorage" =3D "check"; then - AC_PATH_PROG([VSTORAGE], [vstorage], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VSTORAGE_MOUNT], [vstorage-mount], [], [$LIBVIRT_SBIN_PA= TH]) AC_PATH_PROG([UMOUNT], [umount], [], [$LIBVIRT_SBIN_PATH]) =20 if test "$with_storage_vstorage" =3D "yes"; then - if test -z "$VSTORAGE" || test -z "$VSTORAGE_MOUNT"; then - AC_MSG_ERROR([We need vstorage and vstorage-mount tool for Vstorag= e storage driver]); - fi if test -z "$UMOUNT" ; then AC_MSG_ERROR([We need umount for Vstorage storage driver]); fi else - if test -z "$VSTORAGE" ; then - with_storage_vstorage=3Dno - fi - if test -z "$VSTORAGE_MOUNT" ; then - with_storage_vstorage=3Dno - fi if test -z "$UMOUNT" ; then with_storage_vstorage=3Dno fi @@ -57,10 +46,6 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_VSTORAGE], [ if test "$with_storage_vstorage" =3D "yes" ; then AC_DEFINE_UNQUOTED([WITH_STORAGE_VSTORAGE], 1, [whether Vstorage backend for storage driver is e= nabled]) - AC_DEFINE_UNQUOTED([VSTORAGE], ["$VSTORAGE"], - [Location or name of the vstorage client tool]) - AC_DEFINE_UNQUOTED([VSTORAGE_MOUNT], ["$VSTORAGE_MOUNT"], - [Location or name of the vstorage mount tool]) AC_DEFINE_UNQUOTED([UMOUNT], ["$UMOUNT"], [Location or name of the umount programm]) fi diff --git a/src/storage/storage_backend_vstorage.c b/src/storage/storage_b= ackend_vstorage.c index 6cff9f1..ea3bfaa 100644 --- a/src/storage/storage_backend_vstorage.c +++ b/src/storage/storage_backend_vstorage.c @@ -44,9 +44,16 @@ virStorageBackendVzPoolStart(virStoragePoolObjPtr pool) g_autofree char *grp_name =3D NULL; g_autofree char *usr_name =3D NULL; g_autofree char *mode =3D NULL; + g_autofree char *mount_bin =3D NULL; g_autoptr(virCommand) cmd =3D NULL; int ret; =20 + if (!(mount_bin =3D virFindFileInPath("vstorage-mount"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("unable to find vstorage-mount")); + return -1; + } + /* Check the permissions */ if (def->target.perms.mode =3D=3D (mode_t)-1) def->target.perms.mode =3D VIR_STORAGE_DEFAULT_POOL_PERM_MODE; @@ -65,7 +72,7 @@ virStorageBackendVzPoolStart(virStoragePoolObjPtr pool) =20 mode =3D g_strdup_printf("%o", def->target.perms.mode); =20 - cmd =3D virCommandNewArgList(VSTORAGE_MOUNT, + cmd =3D virCommandNewArgList(mount_bin, "-c", def->source.name, def->target.path, "-m", mode, --=20 1.8.3.1