From nobody Fri Apr 19 20:52:36 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570551898; cv=none; d=zoho.com; s=zohoarc; b=BqAVMJ/RtokNV6mQou1mMQIFMlMggIHpgMlocWmYQUFlDXOXUu4UxYRk+bSSPv7qVOqgon/cENIxhAFyzh+vcx2K8DnikRotfiV0nAiM7g3FCjfTBz5Gh2cB2H6Y23jqLSm0Awv5HqxjlnHx/RCGVb+alY1i/MUs/HAKHOpWtgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551898; h=Content-Type:Content-Transfer-Encoding:Cc: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=es76ZI2E/BjmvJsH8rYC9oiUmpuJ4nCYU+RoTAsOyQQ=; b=kM4EuIeOcIzCwRYtwtjjL079FN+dQugvYwCQ8aTykuNSQMu+5SG5dQ4ahLAETNM2OY0I5w2jWIRqXtfDpCBvZeLy2C7pbTIm3BYTbcXnovXXWQjfS1hlKwdv0Dus/Xvb17OM2zudlfZKegxCMElSYbtuuL/tBHxSy7kuuICH4fE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570551898202792.317840169197; Tue, 8 Oct 2019 09:24:58 -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 BD2AA4627A; Tue, 8 Oct 2019 16:24:55 +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 62AFB5D9CD; Tue, 8 Oct 2019 16:24:53 +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 D825218089DC; Tue, 8 Oct 2019 16:24:48 +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 x98GLxSM008659 for ; Tue, 8 Oct 2019 12:21:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3CD5D60606; Tue, 8 Oct 2019 16:21:59 +0000 (UTC) Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id C90F760605; Tue, 8 Oct 2019 16:21:58 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:21 -0400 Message-Id: <7c867f70bebe5913f18413154e428231150eaf55.1570551720.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 1/7] conf: Move -virDomainDiskDefForeachPath to virt-aa-helper 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: , 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.29]); Tue, 08 Oct 2019 16:24:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" It is the only user. Rename it to match the local style Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 42 ----------------------------- src/conf/domain_conf.h | 10 ------- src/libvirt_private.syms | 1 - src/security/virt-aa-helper.c | 50 ++++++++++++++++++++++++++++++++++- 4 files changed, 49 insertions(+), 54 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a53cd6a725..5fe03ea866 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29486,48 +29486,6 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, } =20 =20 -/* Call iter(disk, name, depth, opaque) for each element of disk and - * its backing chain in the pre-populated disk->src.backingStore. - * ignoreOpenFailure determines whether to warn about a chain that - * mentions a backing file without also having metadata on that - * file. */ -int -virDomainDiskDefForeachPath(virDomainDiskDefPtr disk, - bool ignoreOpenFailure, - virDomainDiskDefPathIterator iter, - void *opaque) -{ - size_t depth =3D 0; - virStorageSourcePtr tmp; - VIR_AUTOFREE(char *) brokenRaw =3D NULL; - - if (!ignoreOpenFailure) { - if (virStorageFileChainGetBroken(disk->src, &brokenRaw) < 0) - return -1; - - if (brokenRaw) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to visit backing chain file %s"), - brokenRaw); - return -1; - } - } - - for (tmp =3D disk->src; virStorageSourceIsBacking(tmp); tmp =3D tmp->b= ackingStore) { - /* execute the callback only for local storage */ - if (virStorageSourceIsLocalStorage(tmp) && - tmp->path) { - if (iter(disk, tmp->path, depth, opaque) < 0) - return -1; - } - - depth++; - } - - return 0; -} - - /* Copy src into a new definition; with the quality of the copy * depending on the migratable flag (false for transitions between * persistent and active, true for transitions across save files or diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 2884af49d8..653dcaf2bc 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3327,11 +3327,6 @@ int virDomainChrDefForeach(virDomainDefPtr def, virDomainChrDefIterator iter, void *opaque); =20 -typedef int (*virDomainDiskDefPathIterator)(virDomainDiskDefPtr disk, - const char *path, - size_t depth, - void *opaque); - typedef int (*virDomainUSBDeviceDefIterator)(virDomainDeviceInfoPtr info, void *opaque); int virDomainUSBDeviceDefForeach(virDomainDefPtr def, @@ -3339,11 +3334,6 @@ int virDomainUSBDeviceDefForeach(virDomainDefPtr def, void *opaque, bool skipHubs); =20 -int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk, - bool ignoreOpenFailure, - virDomainDiskDefPathIterator iter, - void *opaque); - void virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason) ATTRIBUTE_NONNULL(1); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c818bc807a..5949cba08d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -334,7 +334,6 @@ virDomainDiskCacheTypeFromString; virDomainDiskCacheTypeToString; virDomainDiskDefAssignAddress; virDomainDiskDefCheckDuplicateInfo; -virDomainDiskDefForeachPath; virDomainDiskDefFree; virDomainDiskDefNew; virDomainDiskDefParse; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 5853ad985f..6e358ff5b6 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -934,6 +934,54 @@ add_file_path(virDomainDiskDefPtr disk, return ret; } =20 + +typedef int (*disk_foreach_iterator)(virDomainDiskDefPtr disk, + const char *path, + size_t depth, + void *opaque); + + +/* Call iter(disk, name, depth, opaque) for each element of disk and + * its backing chain in the pre-populated disk->src.backingStore. + * ignoreOpenFailure determines whether to warn about a chain that + * mentions a backing file without also having metadata on that + * file. */ +static int +disk_foreach_path(virDomainDiskDefPtr disk, + bool ignoreOpenFailure, + disk_foreach_iterator iter, + void *opaque) +{ + size_t depth =3D 0; + virStorageSourcePtr tmp; + VIR_AUTOFREE(char *) brokenRaw =3D NULL; + + if (!ignoreOpenFailure) { + if (virStorageFileChainGetBroken(disk->src, &brokenRaw) < 0) + return -1; + + if (brokenRaw) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to visit backing chain file %s"), + brokenRaw); + return -1; + } + } + + for (tmp =3D disk->src; virStorageSourceIsBacking(tmp); tmp =3D tmp->b= ackingStore) { + /* execute the callback only for local storage */ + if (virStorageSourceIsLocalStorage(tmp) && + tmp->path) { + if (iter(disk, tmp->path, depth, opaque) < 0) + return -1; + } + + depth++; + } + + return 0; +} + static int get_files(vahControl * ctl) { @@ -977,7 +1025,7 @@ get_files(vahControl * ctl) * be passing ignoreOpenFailure =3D false and handle open errors m= ore * careful than just ignoring them. */ - if (virDomainDiskDefForeachPath(disk, true, add_file_path, &buf) <= 0) + if (disk_foreach_path(disk, true, add_file_path, &buf) < 0) goto cleanup; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 20:52:36 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570551976; cv=none; d=zoho.com; s=zohoarc; b=MpICmcJRFk7g0cNijyepNxRqnHPYOvpEju127suY75GN7b1ciobtE2T9fEcia1XYHKZyieodFJIOEBiJzTSUgIWaHEk2pREd6gRhfuz2MPgqFUMVyB+NcO96ss1/8SJZgUE6AuHo4lKiWVdOJA6GY9shaoa/zS/vDOM4Oe1PCdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551976; h=Content-Type:Content-Transfer-Encoding:Cc: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=1Z/nsa5csJ3DooEyk4JUjEvhokJNpwmyXMPTKndP6gg=; b=U8Hu6LjwmK6S+kbLthleCRJo2lEV8vuVp89gWiwpmKccS3QmZ3OeEk7fPIAaw3W/XIdngE467Ub8NmoLFOoMO5suFvYyJBmjEEMqtXWvysbfgoMWiMOJRoUAkSLLMoXmjhUoTIUb0RFoxQ5YNqgBZuSPGaxVUENBes9fOBRmljg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570551976137924.7059143970972; Tue, 8 Oct 2019 09:26:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5789A116BB21; Tue, 8 Oct 2019 16:26:14 +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 32F7B5EE1D; Tue, 8 Oct 2019 16:26:14 +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 CFC191803518; Tue, 8 Oct 2019 16:26:12 +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 x98GLxbw008664 for ; Tue, 8 Oct 2019 12:21:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA7CD60606; Tue, 8 Oct 2019 16:21:59 +0000 (UTC) Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6314D60605; Tue, 8 Oct 2019 16:21:59 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:22 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 2/7] security: apparmor: Remove unused ignoreOpenFailure 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: , 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Tue, 08 Oct 2019 16:26:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" true is always passed here, so delete the unused code path and adjust the associated comment Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik --- src/security/virt-aa-helper.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 6e358ff5b6..511443dd3e 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -943,30 +943,14 @@ typedef int (*disk_foreach_iterator)(virDomainDiskDef= Ptr disk, =20 /* Call iter(disk, name, depth, opaque) for each element of disk and * its backing chain in the pre-populated disk->src.backingStore. - * ignoreOpenFailure determines whether to warn about a chain that - * mentions a backing file without also having metadata on that - * file. */ + */ static int disk_foreach_path(virDomainDiskDefPtr disk, - bool ignoreOpenFailure, disk_foreach_iterator iter, void *opaque) { size_t depth =3D 0; virStorageSourcePtr tmp; - VIR_AUTOFREE(char *) brokenRaw =3D NULL; - - if (!ignoreOpenFailure) { - if (virStorageFileChainGetBroken(disk->src, &brokenRaw) < 0) - return -1; - - if (brokenRaw) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to visit backing chain file %s"), - brokenRaw); - return -1; - } - } =20 for (tmp =3D disk->src; virStorageSourceIsBacking(tmp); tmp =3D tmp->b= ackingStore) { /* execute the callback only for local storage */ @@ -1020,12 +1004,9 @@ get_files(vahControl * ctl) if (!virStorageSourceHasBacking(disk->src)) virStorageFileGetMetadata(disk->src, -1, -1, false); =20 - /* XXX passing ignoreOpenFailure =3D true to get back to the behav= ior - * from before using virDomainDiskDefForeachPath. actually we shou= ld - * be passing ignoreOpenFailure =3D false and handle open errors m= ore - * careful than just ignoring them. + /* XXX should handle open errors more careful than just ignoring = them. */ - if (disk_foreach_path(disk, true, add_file_path, &buf) < 0) + if (disk_foreach_path(disk, add_file_path, &buf) < 0) goto cleanup; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 20:52:36 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570551979; cv=none; d=zoho.com; s=zohoarc; b=AweFMaUgb3AWi3dODasYk/Fhe4SFOklI4C5RViQNFUWTlPKdzikGc47Ml+OIsZlO4QReTJ1E+qM33mFHYHGFLe6KDL0Z5neWj6TqERaW1897xV0/9Vpwp591/w+MKNJ7F7PHIjA7NqhMhT9Zb0rlkMf5hZ5OXRlcUM3aiosM+hg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551979; h=Content-Type:Content-Transfer-Encoding:Cc: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=Dd8jK9a0djnug3cCApq9cS+sKMdt1Qm9VvtLBohWghA=; b=RpgnAQBC59DCkjnQRwe3qOGJlJKONg24HGx2D4ZLKH2hnTlXeDw+NZeTKHOUASmQU9a2ZZq1829ilSec28tBIHhS19r/1BJocDsf+216xjR4BsHqEr7/1+G5WxyzSfzFiG/NQnAUdLj4g38/ymYXMGR3z7LBUlr0kpnZPKOL+vY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570551979827633.8347525372876; Tue, 8 Oct 2019 09:26:19 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3A18C300CB26; Tue, 8 Oct 2019 16:26:18 +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 0E7A660605; Tue, 8 Oct 2019 16:26:18 +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 B40AA180B536; Tue, 8 Oct 2019 16:26:17 +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 x98GM0wB008672 for ; Tue, 8 Oct 2019 12:22:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6434360606; Tue, 8 Oct 2019 16:22:00 +0000 (UTC) Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id F026F60605; Tue, 8 Oct 2019 16:21:59 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:23 -0400 Message-Id: <5089cd02580c6438fce7e6c1d731a2ca65d4221b.1570551720.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 3/7] security: apparmor: Drop disk_foreach_iterator 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 08 Oct 2019 16:26:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There's only one caller, so open code the file_add_path behavior Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik --- src/security/virt-aa-helper.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 511443dd3e..7148e3c760 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -914,9 +914,8 @@ static int add_file_path(virDomainDiskDefPtr disk, const char *path, size_t depth, - void *opaque) + virBufferPtr buf) { - virBufferPtr buf =3D opaque; int ret; =20 if (depth =3D=3D 0) { @@ -935,19 +934,9 @@ add_file_path(virDomainDiskDefPtr disk, } =20 =20 -typedef int (*disk_foreach_iterator)(virDomainDiskDefPtr disk, - const char *path, - size_t depth, - void *opaque); - - -/* Call iter(disk, name, depth, opaque) for each element of disk and - * its backing chain in the pre-populated disk->src.backingStore. - */ static int -disk_foreach_path(virDomainDiskDefPtr disk, - disk_foreach_iterator iter, - void *opaque) +disk_add_files(virDomainDiskDefPtr disk, + virBufferPtr buf) { size_t depth =3D 0; virStorageSourcePtr tmp; @@ -956,7 +945,7 @@ disk_foreach_path(virDomainDiskDefPtr disk, /* execute the callback only for local storage */ if (virStorageSourceIsLocalStorage(tmp) && tmp->path) { - if (iter(disk, tmp->path, depth, opaque) < 0) + if (add_file_path(disk, tmp->path, depth, buf) < 0) return -1; } =20 @@ -1006,7 +995,7 @@ get_files(vahControl * ctl) =20 /* XXX should handle open errors more careful than just ignoring = them. */ - if (disk_foreach_path(disk, add_file_path, &buf) < 0) + if (disk_add_files(disk, &buf) < 0) goto cleanup; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 20:52:36 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570551908; cv=none; d=zoho.com; s=zohoarc; b=llQRuCSuhqc8x+4/BE5GmWYTOm09IMFzPU9150ftdvC06i+P0XsMx7IHuDIQ384CNuh5IcQNU+GF5pYpd6zk/BKTWXlBjcFci4yyMJvb/HEYHl/c4aH0JGeqvZUEIsF46S1V8evf9WdTBqydJJn3fw+dyMPqS6LVG8sh7G9QtkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551908; h=Content-Type:Content-Transfer-Encoding:Cc: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=yoPeqN5EdxaZYy7BDk8FhM6ZHpQgRcEE8XUvFqLFzlI=; b=dazfHjI3zJ0uy2XmTOhznETI4RISmXmsrR+4VU8v1hl5ihjCbg3s+auCTgEU9C8LUqGv6Qx12H0xbAl61D1GsxfWq+LslnR/paAxG4FCzcaVZ3NJBP0ZpPJQ3+ARNlHsILePlD54FnyE4d0jG3wqYusxwp/DVQP49WuSBq4gRpw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570551908863366.28339581344676; Tue, 8 Oct 2019 09:25:08 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D05459B286; Tue, 8 Oct 2019 16:25:06 +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 863EF6060D; Tue, 8 Oct 2019 16:25:06 +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 DA4054EE68; Tue, 8 Oct 2019 16:25:04 +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 x98GM1MY008683 for ; Tue, 8 Oct 2019 12:22:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id F34B760606; Tue, 8 Oct 2019 16:22:00 +0000 (UTC) Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AF2460A9F; Tue, 8 Oct 2019 16:22:00 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:24 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 4/7] security: apparmor: Pass virStorageSource to add_file_path 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 08 Oct 2019 16:25:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The virStorageSource must have everything it needs Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik --- src/security/virt-aa-helper.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 7148e3c760..9f39eb2e2b 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -911,20 +911,19 @@ file_iterate_pci_cb(virPCIDevicePtr dev ATTRIBUTE_UNU= SED, } =20 static int -add_file_path(virDomainDiskDefPtr disk, - const char *path, +add_file_path(virStorageSourcePtr src, size_t depth, virBufferPtr buf) { int ret; =20 if (depth =3D=3D 0) { - if (disk->src->readonly) - ret =3D vah_add_file(buf, path, "rk"); + if (src->readonly) + ret =3D vah_add_file(buf, src->path, "rk"); else - ret =3D vah_add_file(buf, path, "rwk"); + ret =3D vah_add_file(buf, src->path, "rwk"); } else { - ret =3D vah_add_file(buf, path, "rk"); + ret =3D vah_add_file(buf, src->path, "rk"); } =20 if (ret !=3D 0) @@ -945,7 +944,7 @@ disk_add_files(virDomainDiskDefPtr disk, /* execute the callback only for local storage */ if (virStorageSourceIsLocalStorage(tmp) && tmp->path) { - if (add_file_path(disk, tmp->path, depth, buf) < 0) + if (add_file_path(tmp, depth, buf) < 0) return -1; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 20:52:36 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570551981; cv=none; d=zoho.com; s=zohoarc; b=nKkH50epTlcLA+ce+VfxME6xHXzpRejJBx9oBadqGS/5glRpS4NLbA/O3SbBVaSGsQHG690CXrIHCS6GOhN1W3jpbcHD+/3xZ16T54rC2JMZ/1LC1kuaM+geyKaQ8EwhJ/iupn0brLe8Iqsb5UTZZ2c30hxxqXElAT9MkYKIz18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551981; h=Content-Type:Content-Transfer-Encoding:Cc: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=YCEIDbDZ9L1RnMvw7Mc08Y1Efd3yfYbSUiyEFsGfnIM=; b=TlLrGEyqkcEE7o28zGaLeHaJfNHm5ywUpBXrAP0qnyo+nB00ehWNSH4sYnBNHjS1//nU0hj98kjb6YFkUMxuqLOIcga599NH205CgKCGnxJeFJU4t9OhObtCTIyyMX4I5Td131aABSMy5wBM43zn37oEh2ox3711fYaR1VPSkI4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570551981927511.2070846204616; Tue, 8 Oct 2019 09:26:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CEEF30941C4; Tue, 8 Oct 2019 16:26:20 +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 E873260166; Tue, 8 Oct 2019 16:26:19 +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 9C68A4EE6D; Tue, 8 Oct 2019 16:26:19 +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 x98GM1bt008690 for ; Tue, 8 Oct 2019 12:22:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C7D160606; Tue, 8 Oct 2019 16:22:01 +0000 (UTC) Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23FAF60A9F; Tue, 8 Oct 2019 16:22:01 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:25 -0400 Message-Id: <8392bd203a3b24d7e07a4544c7ddf122abe6a5ec.1570551720.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 5/7] security: apparmor: Push virStorageSource checks to add_file_path 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: , 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 08 Oct 2019 16:26:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This mirrors the code layout in security_selinux.c. It will also make it easier to share the checks for qcow2 external data_file support eventually Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik --- src/security/virt-aa-helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 9f39eb2e2b..20281c38b7 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -917,6 +917,10 @@ add_file_path(virStorageSourcePtr src, { int ret; =20 + /* execute the callback only for local storage */ + if (!src->path || !virStorageSourceIsLocalStorage(src)) + return 0; + if (depth =3D=3D 0) { if (src->readonly) ret =3D vah_add_file(buf, src->path, "rk"); @@ -941,12 +945,8 @@ disk_add_files(virDomainDiskDefPtr disk, virStorageSourcePtr tmp; =20 for (tmp =3D disk->src; virStorageSourceIsBacking(tmp); tmp =3D tmp->b= ackingStore) { - /* execute the callback only for local storage */ - if (virStorageSourceIsLocalStorage(tmp) && - tmp->path) { - if (add_file_path(tmp, depth, buf) < 0) - return -1; - } + if (add_file_path(tmp, depth, buf) < 0) + return -1; =20 depth++; } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 20:52:36 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570551985; cv=none; d=zoho.com; s=zohoarc; b=Cu16eKOeTzNMOCeU0ODwKvf5Odvd/xQnBXWzejUoncf2IpP/IvOZQEVUG3AnBDRr8UCnSGPZbFGte3+XqDY+1Stj4sF7cNrrJNwnksQrgT9uqLp919B9uhcv7Kpo61i4TzRLxl3e/Z+tOxITg0yGUVi7z9Sj9F1v88bLCFAMDLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551985; h=Content-Type:Content-Transfer-Encoding:Cc: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=SPh5kmuPYrLbhMbCpubN+/KX8K/c5iWg8s9PphmwWQk=; b=OOAd3a9KymB7t0nFhw6B76MaidUs4ZqJJ60A+RYJq5GijecwTpRnxrkaT2VY+34UCtXVsMvx6MmFgU0J184Pp6A2TIJhhxLJ2nZLUVEzB6sEfOMFYdD+PKc9j9LD2lxLgKx6CRJPBVxe8S2aEi167WGqBNZP0elsHfshGCIHz3E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570551985231207.1599508355754; Tue, 8 Oct 2019 09:26:25 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A3A4D30609AF; Tue, 8 Oct 2019 16:26:23 +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 764BD60606; Tue, 8 Oct 2019 16:26:23 +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 324C54EE71; Tue, 8 Oct 2019 16:26:23 +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 x98GM2Mw008696 for ; Tue, 8 Oct 2019 12:22:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 26B0160606; Tue, 8 Oct 2019 16:22:02 +0000 (UTC) Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1B9960605; Tue, 8 Oct 2019 16:22:01 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:26 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 6/7] security: apparmor: Use only virStorageSource for disk paths 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 08 Oct 2019 16:26:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This is closer to what security_selinux.c does, and will help add support for qcow2 external data_files Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik --- src/security/virt-aa-helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 20281c38b7..b675572144 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -938,13 +938,13 @@ add_file_path(virStorageSourcePtr src, =20 =20 static int -disk_add_files(virDomainDiskDefPtr disk, - virBufferPtr buf) +storage_source_add_files(virStorageSourcePtr src, + virBufferPtr buf) { size_t depth =3D 0; virStorageSourcePtr tmp; =20 - for (tmp =3D disk->src; virStorageSourceIsBacking(tmp); tmp =3D tmp->b= ackingStore) { + for (tmp =3D src; virStorageSourceIsBacking(tmp); tmp =3D tmp->backing= Store) { if (add_file_path(tmp, depth, buf) < 0) return -1; =20 @@ -994,7 +994,7 @@ get_files(vahControl * ctl) =20 /* XXX should handle open errors more careful than just ignoring = them. */ - if (disk_add_files(disk, &buf) < 0) + if (storage_source_add_files(disk->src, &buf) < 0) goto cleanup; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 20:52:36 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570551988; cv=none; d=zoho.com; s=zohoarc; b=fPlv7nvv4SSfcVwX3pqXOkKANO76mfWa1O1uvn1Ck3fUMpDrkTiI8HmN2Gslix1SUIfmwFOF7PR5t/87Hmw1rzlKMfMcl+4g8MxZzUxZfp4Sq4XUIp8dK/d3ETarFiHCaKZ9iLimmZTjguQkv0VUwhH9dqhgEwSZjY7A37qogrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551988; h=Content-Type:Content-Transfer-Encoding:Cc: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=Ox08Dh1OcdqceiNjxJAOavhzOAi4laWQDO4EeWKqoMI=; b=UNKpDTIZhB5f3S9tPSNRxAftjg1j1DbSqz8iNg4fMBfa5f/8b+dSnlgAqgzuEyleVvxpowrjRWQpTA7DA0Cx0kf21AzYWiqbZX7O5irymsOs6pq2Jw9v9omto545Hg6aJfNOZRmlcNBE4ZIVjlgu/Ppw6yYozR9a/eCkMQDKF44= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570551988804160.91370343435665; Tue, 8 Oct 2019 09:26:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1802F3082E66; Tue, 8 Oct 2019 16:26:27 +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 E23845B6A5; Tue, 8 Oct 2019 16:26:26 +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 97361180BA9B; Tue, 8 Oct 2019 16:26:26 +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 x98GM26u008709 for ; Tue, 8 Oct 2019 12:22:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id B457760606; Tue, 8 Oct 2019 16:22:02 +0000 (UTC) Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B81560605; Tue, 8 Oct 2019 16:22:02 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:27 -0400 Message-Id: <70ec368459c0bdd748dec360de106c0f9423bd8e.1570551720.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 7/7] security: apparmor: Make storage_source_add_files recursively callable 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: , 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 08 Oct 2019 16:26:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This will simplify adding support for qcow2 external data_file Signed-off-by: Cole Robinson Reviewed-by: Michal Privoznik --- src/security/virt-aa-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index b675572144..d9f6b5638b 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -939,9 +939,9 @@ add_file_path(virStorageSourcePtr src, =20 static int storage_source_add_files(virStorageSourcePtr src, - virBufferPtr buf) + virBufferPtr buf, + size_t depth) { - size_t depth =3D 0; virStorageSourcePtr tmp; =20 for (tmp =3D src; virStorageSourceIsBacking(tmp); tmp =3D tmp->backing= Store) { @@ -994,7 +994,7 @@ get_files(vahControl * ctl) =20 /* XXX should handle open errors more careful than just ignoring = them. */ - if (storage_source_add_files(disk->src, &buf) < 0) + if (storage_source_add_files(disk->src, &buf, 0) < 0) goto cleanup; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list