From e0aa2070f61c953f326f9205fd107f9d6ed12718 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Thu, 30 Sep 2021 13:42:05 +0200 Subject: [PATCH] dir plugin: get notes: return undef if notes are not supported This avoids showing empty notes in the result of the content/{volid} API call for volumes that do not even support notes. It's also in preparation for the proposed get_volume_attribute generalization, which expects undef to be returned when an attribute is not supported. Signed-off-by: Fabian Ebner --- PVE/Storage/DirPlugin.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PVE/Storage/DirPlugin.pm b/PVE/Storage/DirPlugin.pm index 1fcb8ce..2aacb35 100644 --- a/PVE/Storage/DirPlugin.pm +++ b/PVE/Storage/DirPlugin.pm @@ -94,6 +94,9 @@ sub parse_is_mountpoint { sub get_volume_notes { my ($class, $scfg, $storeid, $volname, $timeout) = @_; + my ($vtype) = $class->parse_volname($volname); + return if $vtype ne 'backup'; + my $path = $class->filesystem_path($scfg, $volname); $path .= $class->SUPER::NOTES_EXT; -- 2.39.2