From nobody Wed Apr 24 10:45:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1589557500; cv=none; d=zohomail.com; s=zohoarc; b=aYuz06G5YIURu/gJnWxWrgYYyC3VmDzvVGl5Jrg9lEuLJ6XwLw7Tlie3KyHJmXklUnwGPbyl0Oo8M93BoMtMX1Iu681+xJGU+AobOJwmfgFnydA7OSH5TDuM0HednD69/JevTkV1iA0dz4fai+p1JiB4lpnZs0ehdsPv0ImDsyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589557500; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=MscEHKRTGQbSv+pQTy9oKOGhKfkLmFG5ZDfMtCCE9ak=; b=WXXMYxyyIILX5i3Uu+EO2yc9hvm2KQkryl2jRrOlIbnamoljqAOyulXovYtchJETcCJTgaadFrisjRcpMQDioxy9V4BvIr58Vgo6J4v6Wvz9m7DhxRW6xF8M1nXYDjSZvCSSaLCkKU0ZJdTsFshmY0+03H8hMTJe5i7lVk7FBSE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1589557500885758.7214702514307; Fri, 15 May 2020 08:45:00 -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-77-myCZ1d0FOPKbU30kIpXRVg-1; Fri, 15 May 2020 11:44:57 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AA35835B41; Fri, 15 May 2020 15:44:51 +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 BE6AA5D714; Fri, 15 May 2020 15:44:49 +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 558DC4E9E5; Fri, 15 May 2020 15:44:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04FFihNZ014023 for ; Fri, 15 May 2020 11:44:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 53B3A272A3; Fri, 15 May 2020 15:44:43 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id C60A346 for ; Fri, 15 May 2020 15:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589557499; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MscEHKRTGQbSv+pQTy9oKOGhKfkLmFG5ZDfMtCCE9ak=; b=Xcb0pMTyK2NI7on0ZLHOe7j3orQ89M1+3iZmrH2Gt5bjzFBE1kLo0l3mMcYzh4/O7v6YWq O/TP6XcF66tWzFUMVa2zze39PoGpQSNE9gK/G9d4djdjQ/m81J0GEmV9/4+WugcdnRuYee 2msLadUOqzRCN1AnFDkay6lK5PSB4y8= X-MC-Unique: myCZ1d0FOPKbU30kIpXRVg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] Don't require secdrivers to implement .domainMoveImageMetadata Date: Fri, 15 May 2020 17:44:38 +0200 Message-Id: <51de9763454e44a1e99eba2337a6f2baaa6a30ad.1589557454.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The AppArmor secdriver does not use labels to grant access to resources. Therefore, it doesn't use XATTRs and hence it lacks implementation of .domainMoveImageMetadata callback. This leads to a harmless but needless error message appearing in the logs: virSecurityManagerMoveImageMetadata:476 : this function is not supported by the connection driver: virSecurityManagerMoveImageMetadata Closes: https://gitlab.com/libvirt/libvirt/-/issues/25 Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/security/security_manager.c | 3 +-- src/security/security_nop.c | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/security/security_manager.c b/src/security/security_manage= r.c index 2dea294784..b1237d63b6 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -473,8 +473,7 @@ virSecurityManagerMoveImageMetadata(virSecurityManagerP= tr mgr, return ret; } =20 - virReportUnsupportedError(); - return -1; + return 0; } =20 =20 diff --git a/src/security/security_nop.c b/src/security/security_nop.c index c1856eb421..d5f715b916 100644 --- a/src/security/security_nop.c +++ b/src/security/security_nop.c @@ -225,15 +225,6 @@ virSecurityDomainSetImageLabelNop(virSecurityManagerPt= r mgr G_GNUC_UNUSED, return 0; } =20 -static int -virSecurityDomainMoveImageMetadataNop(virSecurityManagerPtr mgr G_GNUC_UNU= SED, - pid_t pid G_GNUC_UNUSED, - virStorageSourcePtr src G_GNUC_UNUSE= D, - virStorageSourcePtr dst G_GNUC_UNUSE= D) -{ - return 0; -} - static int virSecurityDomainSetMemoryLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, virDomainDefPtr def G_GNUC_UNUSED, @@ -290,7 +281,6 @@ virSecurityDriver virSecurityDriverNop =3D { =20 .domainSetSecurityImageLabel =3D virSecurityDomainSetImageLabel= Nop, .domainRestoreSecurityImageLabel =3D virSecurityDomainRestoreImageL= abelNop, - .domainMoveImageMetadata =3D virSecurityDomainMoveImageMeta= dataNop, =20 .domainSetSecurityMemoryLabel =3D virSecurityDomainSetMemoryLabe= lNop, .domainRestoreSecurityMemoryLabel =3D virSecurityDomainRestoreMemory= LabelNop, --=20 2.26.2