public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Philipp Hufnagl <p.hufnagl@proxmox.com>,
	Fiona Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH storage] fix #5008: prevent adding pbs storage with invalid namespace
Date: Wed, 15 Nov 2023 10:52:46 +0100	[thread overview]
Message-ID: <f9ed9a3f-d8d5-441a-bd16-f8a65157e1dd@proxmox.com> (raw)
In-Reply-To: <0c9cd0e3-fecc-453c-9238-8dc249b0a0d0@proxmox.com>

Am 15/11/2023 um 10:37 schrieb Philipp Hufnagl:
> On 11/15/23 09:31, Fiona Ebner wrote:
>> Am 14.11.23 um 15:27 schrieb Philipp Hufnagl:
>>> diff --git a/src/PVE/Storage/PBSPlugin.pm b/src/PVE/Storage/PBSPlugin.pm
>>> index 4320974..aceb2c4 100644
>>> --- a/src/PVE/Storage/PBSPlugin.pm
>>> +++ b/src/PVE/Storage/PBSPlugin.pm
>>> @@ -817,6 +817,17 @@ sub scan_datastores {
>>>      return $response;
>>>  }
>>>  
>>> +sub scan_namespaces {
>>> +    my ($scfg, $datastore, $password) = @_;
>>> +
>>> +    my $conn = pbs_api_connect($scfg, $password);
>>
>> Not super important, but would be nice to have a way to re-use the same
>> connection in scan_datastores() and here, since activate_storage() will
>> call both of them.
> 
> scan_datastores() seem to be called somewhere else as well. I see if I
> can find a way to reuse the connection but not break the code there.


In the long run it maybe could be better to have an explicit check_availability
hook, but IMO it's a bit late in the release cycle for that as this needs a bit
extra care, especially w.r.t. external plugins and our ABI compat.

Anyhow, as workaround we might be able to do this check in the on_add_hook and
on_update_hook methods for now.




  reply	other threads:[~2023-11-15  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 14:27 Philipp Hufnagl
2023-11-15  8:31 ` Fiona Ebner
2023-11-15  9:37   ` Philipp Hufnagl
2023-11-15  9:52     ` Thomas Lamprecht [this message]
2023-11-15 10:05       ` Philipp Hufnagl
2023-11-15 10:09         ` Thomas Lamprecht
2023-11-15 10:40           ` Philipp Hufnagl
2023-11-15 10:01     ` Fiona Ebner

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=f9ed9a3f-d8d5-441a-bd16-f8a65157e1dd@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=p.hufnagl@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