public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Friedrich Weber <f.weber@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager stable-7] pve7to8: content-dirs check: skip paths that cannot be resolved
Date: Thu, 15 Jun 2023 15:22:31 +0200	[thread overview]
Message-ID: <20230615132231.702195-1-f.weber@proxmox.com> (raw)

The current inequality check for content-dirs does not correctly
handle the case in which `abs_path` returns undef. This can result in
confusing warnings:

  storage [...] uses directory  for multiple content types [...]

Fix this by skipping paths for which `abs_path` returns undef. This
matches the behavior of the actual content-dirs check in PVE 8 [0].

[0]: https://git.proxmox.com/?p=pve-storage.git;a=commit;h=09f1f847a

Fixes: ea0a4f1943ffafe94282afc800d5720db45df198
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---
 PVE/CLI/pve7to8.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
index d8624ca7..22a477a5 100644
--- a/PVE/CLI/pve7to8.pm
+++ b/PVE/CLI/pve7to8.pm
@@ -986,6 +986,7 @@ sub check_storage_content_dirs {
 	my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
 	for my $vtype (keys $scfg->{content}->%*) {
 	    my $abs_subdir = Cwd::abs_path($plugin->get_subdir($scfg, $vtype));
+	    next if !defined($abs_subdir);
 	    push $resolved_subdirs->{$abs_subdir}->@*, $vtype;
 	}
 	for my $subdir (keys $resolved_subdirs->%*) {
-- 
2.39.2





             reply	other threads:[~2023-06-15 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 13:22 Friedrich Weber [this message]
2023-06-15 14:47 ` [pve-devel] applied: " Thomas Lamprecht

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=20230615132231.702195-1-f.weber@proxmox.com \
    --to=f.weber@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