From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH v1 pve-storage 1/8] pluginbase: introduce PVE::Storage::PluginBase with doc scaffold
Date: Thu, 03 Apr 2025 09:12:38 +0200 [thread overview]
Message-ID: <1743662630.w6yioa59xg.astroid@yuna.none> (raw)
In-Reply-To: <D8WAOTDV6ACB.1SUFA17DNXZP9@proxmox.com>
On April 2, 2025 6:31 pm, Max Carrara wrote:
> On Mon Mar 31, 2025 at 5:13 PM CEST, Fabian Grünbichler wrote:
>> On March 26, 2025 3:20 pm, Max Carrara wrote:
>> > +=head2 HOOKS
>> > +
>> > +=cut
>> > +
>> > +# called during addition of storage (before the new storage config got written)
>>
>> called when adding a storage config entry, before the new config gets written
>>
>> > +# die to abort addition if there are (grave) problems
>> > +# NOTE: runs in a storage config *locked* context
>> > +sub on_add_hook {
>> > + my ($class, $storeid, $scfg, %param) = @_;
>> > + return undef;
>> > +}
>> > +
>> > +# called during storage configuration update (before the updated storage config got written)
>>
>> called when updating a storage config entry, before the updated config
>> gets written
>>
>> > +# die to abort the update if there are (grave) problems
>> > +# NOTE: runs in a storage config *locked* context
>> > +sub on_update_hook {
>> > + my ($class, $storeid, $scfg, %param) = @_;
>> > + return undef;
>> > +}
>> > +
>> > +# called during deletion of storage (before the new storage config got written)
>> > +# and if the activate check on addition fails, to cleanup all storage traces
>> > +# which on_add_hook may have created.
>>
>> called when deleting a storage config entry, before the new storage
>> config gets written.
>>
>> also called as part of error handling when undoing the addition of a new
>> storage config entry.
>
> Regarding your three responses above: The comments here were preserved
> from `::Plugin` for context's sake. But tbh, on second thought, they can
> probably just be removed, as they'll be replaced by POD anyways.
>
yes, but those parts mor or less made it to the POD as well slightly
rephrased, hence I called them out here already :-P
>>
>> > +# die to abort deletion if there are (very grave) problems
>> > +# NOTE: runs in a storage config *locked* context
>> > +sub on_delete_hook {
>> > + my ($class, $storeid, $scfg) = @_;
>> > + return undef;
>> > +}
>> > +
>> > +=head2 IMAGE OPERATIONS
>> > +
>>
>> should this describe what IMAGES are in the context of PVE? else as a
>> newcomer the difference between IMAGE here and VOLUME below might not
>> be clear..
>
> Yeah, that's a good idea. Maximiliano and I were also thinking about
> maybe adding a GLOSSARY section at the bottom of the file where certain
> terms could be explained / defined in more detail in general.
> What do you think?
>
> Alternatively, we could also have the top-level description define the
> most basic of terms, but I don't want to load the docs here with too
> much information up front.
I think it depends - things that are not only interesting for plugin
devs should probably go into docs proper and just be referenced here. I
don't think the distinction between volume and image is very important
outside of development, so that might be explained here?
the POD documentation here is targeted at us and plugin devs, so that
should be the guideline when deciding what goes where - and what goes in
in the first place - I think a focus on "what do I need to know/be aware
of when writing a plugin" (or adapting the interface) should be the
guiding principle for that.
e.g. for that knowing that this parameter is optional doesn't buy me
much. knowing what it means if it is set does (or that I can ignore it
if my storage can't do X, or should die if set in that case)
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-04-03 7:13 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 14:20 [pve-devel] [PATCH v1 pve-storage 0/8] Base Module + Documentation for PVE::Storage::Plugin API Max Carrara
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 1/8] pluginbase: introduce PVE::Storage::PluginBase with doc scaffold Max Carrara
2025-03-31 15:13 ` Fabian Grünbichler
2025-04-02 16:31 ` Max Carrara
2025-04-03 7:12 ` Fabian Grünbichler [this message]
2025-04-03 14:05 ` Max Carrara
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 2/8] pluginbase: add high-level plugin API description Max Carrara
2025-03-31 15:13 ` Fabian Grünbichler
2025-04-02 16:31 ` Max Carrara
2025-04-03 7:12 ` Fabian Grünbichler
2025-04-03 14:05 ` Max Carrara
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 3/8] pluginbase: document SectionConfig methods Max Carrara
2025-03-31 15:13 ` Fabian Grünbichler
2025-04-02 16:31 ` Max Carrara
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 4/8] pluginbase: document general plugin methods Max Carrara
2025-03-28 12:50 ` Maximiliano Sandoval
2025-03-31 15:12 ` Fabian Grünbichler
2025-04-02 16:31 ` Max Carrara
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 5/8] pluginbase: document hooks Max Carrara
2025-03-28 13:07 ` Maximiliano Sandoval
2025-03-31 15:12 ` Fabian Grünbichler
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 6/8] pluginbase: document image operation methods Max Carrara
2025-03-31 15:12 ` Fabian Grünbichler
2025-04-02 16:32 ` Max Carrara
2025-04-03 7:23 ` Fabian Grünbichler
2025-04-03 14:05 ` Max Carrara
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 7/8] pluginbase: document volume operations Max Carrara
2025-03-31 15:12 ` Fabian Grünbichler
2025-04-02 16:32 ` Max Carrara
2025-03-26 14:20 ` [pve-devel] [PATCH v1 pve-storage 8/8] pluginbase: document import and export methods Max Carrara
2025-04-01 8:40 ` Fabian Grünbichler
2025-04-01 9:40 ` Fiona Ebner
2025-04-02 16:32 ` Max Carrara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1743662630.w6yioa59xg.astroid@yuna.none \
--to=f.gruenbichler@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal