From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id F240460A45 for ; Thu, 3 Sep 2020 11:20:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E2BFF1744B for ; Thu, 3 Sep 2020 11:19:49 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 425D117441 for ; Thu, 3 Sep 2020 11:19:49 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 08228449A5 for ; Thu, 3 Sep 2020 11:19:49 +0200 (CEST) Date: Thu, 03 Sep 2020 11:19:41 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20200901124421.25901-1-a.lauterer@proxmox.com> <20200901124421.25901-5-a.lauterer@proxmox.com> <1599119807.ye2lhdunc6.astroid@nora.none> <85f08049-a3f1-1be6-4a28-3018c6497b56@proxmox.com> <20dddf18-84e8-61ce-0afa-81d0c78d0771@proxmox.com> In-Reply-To: <20dddf18-84e8-61ce-0afa-81d0c78d0771@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1599124436.8s2lnoj9u8.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [cifsplugin.pm, plugin.pm, nfsplugin.pm, basedirplugin.pm, dirplugin.pm] Subject: Re: [pve-devel] [PATCH v2 storage 4/5] disk reassign: add not implemented yet message to storages X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2020 09:20:20 -0000 On September 3, 2020 11:06 am, Aaron Lauterer wrote: > sent to early without finishing the last sentence... >=20 > On 9/3/20 11:01 AM, Aaron Lauterer wrote: >>=20 >>=20 >> On 9/3/20 9:58 AM, Fabian Gr=C3=BCnbichler wrote: >>> wouldn't it make more sense to implement it in Dir/NFS/CIFSPlugin, and >>> add this 'implement me' into Plugin itself? otherwise this breaks >>> external plugins. also, would it make sense to add a feature for this s= o >>> that we can check in the calling code with a meaningful error message >>> before attempting and die-ing? >>=20 >> The storage plugins are a bit of a mess hierarchically. The base plugin = (Plugin.pm) implements quite a few methods for the dir based plugins (dir, = nfs, cifs) like `find_free_diskname` for example. >> The other plugins overwrite these methods. I know. most of that predates external plugins though ;) for new stuff,=20 we should not pile on top of the mess. >>=20 >> If we want to do it properly and to avoid code duplication, we should pr= obably add another class in between to which me move the common file based = operations which are used by all the dir based plugins. >>=20 >> Plugin.pm >> =C2=A0=C2=A0=C2=A0 BaseDirPlugin.pm >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DirPlugin.pm >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NFSPlugin.pm >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CIFSPlugin.pm >>=20 might a be a good idea, but would be a breaking change as you indicate=20 below (so maybe 7.0 material?) >>=20 >> Having the reassigning as additional feature sounds good. I will try tha= t. But this will need > But this will need the intermediate dir base class so that we can add the= feature just for them and not all plugins, especially third party ones whi= ch we cannot update. you could also just refactor volume_has_feature (e.g., by splitting out=20 the $features hash so that plugins can override it without fully=20 overriding volume_has_feature), or override it with just that feature=20 check and fallback to the base one otherwise. > Then again, what if a third party plugin is using the dir based methods i= n the plugin.pm already? > should I just add new things to the intermediate BaseDirPlugin in order t= o stay compatible? that would be a possibility, and then move all the existing non-generic stu= ff at=20 some later point when we need/want to break API anyhway. =