From nobody Fri May 16 05:34:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501099943540822.0222622017052; Wed, 26 Jul 2017 13:12:23 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8449BEB2FC; Wed, 26 Jul 2017 20:12:20 +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 57A2D5D96D; Wed, 26 Jul 2017 20:12:20 +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 0C87D180597B; Wed, 26 Jul 2017 20:12:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QKCGA8016769 for ; Wed, 26 Jul 2017 16:12:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9ADEB6FDDC; Wed, 26 Jul 2017 20:12:16 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE30A60C14; Wed, 26 Jul 2017 20:12:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8449BEB2FC Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 22:12:14 +0200 Message-Id: <8b0b294cdc89d331265d925cf776fb29a60887fd.1501099726.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/2] security: apparmor: load the storage driver dynamically 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 26 Jul 2017 20:12:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In commit 5e515b542d I've attempted to fix the inability to access storage from the apparmor helper program by linking with the storage driver. By linking with the .so the linker complains that it's not portable. Fix this by loading the module dynamically as we are supposed to do. Reviewed-by: Daniel P. Berrange --- Notes: This patch is possible even with the previous patch, but it would be sl= ightly more complex, since it would need the logic to determine whether to loa= d the module or just initialize it. src/Makefile.am | 2 +- src/security/virt-aa-helper.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 471be40d1..b8e875482 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3124,7 +3124,7 @@ virt_aa_helper_LDADD =3D \ libvirt.la \ libvirt_conf.la \ libvirt_util.la \ - libvirt_driver_storage.la \ + libvirt_driver_storage_impl.la \ ../gnulib/lib/libgnu.la if WITH_DTRACE_PROBES virt_aa_helper_LDADD +=3D libvirt_probes.lo diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index a751d6deb..35dcb35bc 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -41,6 +41,7 @@ #include "viralloc.h" #include "vircommand.h" #include "virlog.h" +#include "driver.h" #include "security_driver.h" #include "security_apparmor.h" @@ -56,7 +57,6 @@ #include "virgettext.h" #include "storage/storage_source.h" -#include "storage/storage_backend.h" #define VIR_FROM_THIS VIR_FROM_SECURITY @@ -927,10 +927,10 @@ get_files(vahControl * ctl) goto cleanup; } - if (virStorageBackendDriversRegister(false) < 0) { - vah_error(ctl, 0, _("failed to register storage driver backend")); - goto cleanup; - } + /* load the storage driver so that backing store can be accessed */ +#ifdef WITH_STORAGE + virDriverLoadModule("storage", "storageRegister"); +#endif for (i =3D 0; i < ctl->def->ndisks; i++) { virDomainDiskDefPtr disk =3D ctl->def->disks[i]; --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list