+#
+
+# NOTE: should ProcFSTools::is_mounted accept an optional cache like this?
+sub path_is_mounted {
+ my ($mountpoint, $mountdata) = @_;
+
+ $mountpoint = Cwd::realpath($mountpoint); # symlinks
+ return 0 if !defined($mountpoint); # path does not exist
+
+ $mountdata = PVE::ProcFSTools::parse_proc_mounts() if !$mountdata;
+ return 1 if grep { $_->[1] eq $mountpoint } @$mountdata;
+ return undef;
+}
+
+sub parse_is_mountpoint {
+ my ($scfg) = @_;
+ my $is_mp = $scfg->{is_mountpoint};
+ return undef if !defined $is_mp;
+ if (defined(my $bool = PVE::JSONSchema::parse_boolean($is_mp))) {
+ return $bool ? $scfg->{path} : undef;
+ }
+ return $is_mp; # contains a path
+}
+
+sub get_volume_notes {
+ my ($class, $scfg, $storeid, $volname, $timeout) = @_;
+
+ my $path = $class->filesystem_path($scfg, $volname);
+ $path .= $class->SUPER::NOTES_EXT;
+
+ return PVE::Tools::file_get_contents($path) if -f $path;
+
+ return '';
+}
+
+sub update_volume_notes {
+ my ($class, $scfg, $storeid, $volname, $notes, $timeout) = @_;
+
+ my ($vtype) = $class->parse_volname($volname);
+ die "only backups can have notes\n" if $vtype ne 'backup';
+
+ my $path = $class->filesystem_path($scfg, $volname);
+ $path .= $class->SUPER::NOTES_EXT;
+
+ if (defined($notes) && $notes ne '') {
+ PVE::Tools::file_set_contents($path, $notes);
+ } else {
+ unlink $path or die "could not delete notes - $!\n";
+ }
+ return;
+}
+
+sub status {
+ my ($class, $storeid, $scfg, $cache) = @_;
+
+ if (defined(my $mp = parse_is_mountpoint($scfg))) {
+ $cache->{mountdata} = PVE::ProcFSTools::parse_proc_mounts()
+ if !$cache->{mountdata};
+
+ return undef if !path_is_mounted($mp, $cache->{mountdata});
+ }
+
+ return $class->SUPER::status($storeid, $scfg, $cache);
+}
+