From patchwork Tue Oct 8 16:22:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 175520 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5921929ill; Tue, 8 Oct 2019 09:26:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCBL2uQSEcLwUkkl/zSLLuerXYVSCkbZLDXpmxhn0scMe+mnEj6tn9dr4QcVqSpD+8lu5O X-Received: by 2002:a5d:9587:: with SMTP id a7mr27348933ioo.305.1570551975644; Tue, 08 Oct 2019 09:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570551975; cv=none; d=google.com; s=arc-20160816; b=d/hT2QUuj0uZ713InWNlK7X9vyH4RQBj4+o4LHtW2ReLCzjz8uQiUHgH9J5sCNzYCc iY3UZJfAEpxZYkzZARdkBKzI6++jLoOdLgk1Q3naHI62zZDSIYCaSlF5PHZaRTwbTRXg AkX0Ye93Gsw+Oenn6vz7n7mlRZt7UJCeENCKX+6h7fQQHNXVnkkbTkYFEO27mQakJMJ1 1raen05HKrkHm+9PgygLI2LfG4P/rRoEwLQmBL4f0vhZ8bOcP7UhXrmSO3wzyIH0MEJM Ji/W1gMMjucbXMUyefewm9+Y8MyUg6mJS57xtMvRkx7nir4f3uwMbwsN+qT9EUshoEgN ip0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=1Z/nsa5csJ3DooEyk4JUjEvhokJNpwmyXMPTKndP6gg=; b=nOClH3Sl5JS99wiUUqJ/00jM2a5RGmQQF+5PS7wKBZslwRSqkXNDPx9KM/0yenkeq2 YH51vIFaFlD2RxLPTcO3eCF8i62zjvCG3yj2HhHM/44yfDfuOngUBa6TL5Axqy06XuNT cFr3u+EEqsIhNUrU9/LSJEtOR+NWoX8dm7Y9++3bhm7Sw/dZzWUJYGsh8vrt+cxa+0mE 57r5IdloOsSNzrtxNiJzkoHT0E7yEiSiIPnq/a3+K5WxV8KNEN0WwBXyreP/tsIoqk7f gvX53FuK7gYSD61/vjrzUOQ6pnCpwmDaYTGDPa5BfWIiJqJSKI7IHsnacmfsEUumfPs8 aJ5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id s2si20826649iot.1.2019.10.08.09.26.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 09:26:15 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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) Delivered-To: libvirt-list@redhat.com 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: , 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) true is always passed here, so delete the unused code path and adjust the associated comment Signed-off-by: Cole Robinson --- src/security/virt-aa-helper.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) -- 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list 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)(virDomainDiskDefPtr disk, /* 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 = 0; virStorageSourcePtr tmp; - VIR_AUTOFREE(char *) brokenRaw = 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 = disk->src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) { /* 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); - /* XXX passing ignoreOpenFailure = true to get back to the behavior - * from before using virDomainDiskDefForeachPath. actually we should - * be passing ignoreOpenFailure = false and handle open errors more - * 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; }