]> git.proxmox.com Git - pve-storage.git/blob - PVE/Storage/ZFSPoolPlugin.pm
ZFS: refactor waiting for zvol symlinks
[pve-storage.git] / PVE / Storage / ZFSPoolPlugin.pm
1 package PVE::Storage::ZFSPoolPlugin;
2
3 use strict;
4 use warnings;
5 use IO::File;
6 use POSIX;
7 use PVE::Tools qw(run_command);
8 use PVE::Storage::Plugin;
9 use PVE::RPCEnvironment;
10 use Net::IP;
11
12 use base qw(PVE::Storage::Plugin);
13
14 sub type {
15 return 'zfspool';
16 }
17
18 sub plugindata {
19 return {
20 content => [ {images => 1, rootdir => 1}, {images => 1 , rootdir => 1}],
21 format => [ { raw => 1, subvol => 1 } , 'raw' ],
22 };
23 }
24
25 sub properties {
26 return {
27 blocksize => {
28 description => "block size",
29 type => 'string',
30 },
31 sparse => {
32 description => "use sparse volumes",
33 type => 'boolean',
34 },
35 };
36 }
37
38 sub options {
39 return {
40 pool => { fixed => 1 },
41 blocksize => { optional => 1 },
42 sparse => { optional => 1 },
43 nodes => { optional => 1 },
44 disable => { optional => 1 },
45 content => { optional => 1 },
46 bwlimit => { optional => 1 },
47 };
48 }
49
50 # static zfs helper methods
51
52 sub zfs_parse_size {
53 my ($text) = @_;
54
55 return 0 if !$text;
56
57 if ($text =~ m/^(\d+(\.\d+)?)([TGMK])?$/) {
58
59 my ($size, $reminder, $unit) = ($1, $2, $3);
60
61 if ($unit) {
62 if ($unit eq 'K') {
63 $size *= 1024;
64 } elsif ($unit eq 'M') {
65 $size *= 1024*1024;
66 } elsif ($unit eq 'G') {
67 $size *= 1024*1024*1024;
68 } elsif ($unit eq 'T') {
69 $size *= 1024*1024*1024*1024;
70 } else {
71 die "got unknown zfs size unit '$unit'\n";
72 }
73 }
74
75 if ($reminder) {
76 $size = ceil($size);
77 }
78
79 return $size;
80
81 }
82
83 warn "unable to parse zfs size '$text'\n";
84
85 return 0;
86 }
87
88 sub zfs_parse_zvol_list {
89 my ($text) = @_;
90
91 my $list = ();
92
93 return $list if !$text;
94
95 my @lines = split /\n/, $text;
96 foreach my $line (@lines) {
97 my ($dataset, $size, $origin, $type, $refquota) = split(/\s+/, $line);
98 next if !($type eq 'volume' || $type eq 'filesystem');
99
100 my $zvol = {};
101 my @parts = split /\//, $dataset;
102 next if scalar(@parts) < 2; # we need pool/name
103 my $name = pop @parts;
104 my $pool = join('/', @parts);
105
106 next unless $name =~ m!^(vm|base|subvol|basevol)-(\d+)-(\S+)$!;
107 $zvol->{owner} = $2;
108
109 $zvol->{pool} = $pool;
110 $zvol->{name} = $name;
111 if ($type eq 'filesystem') {
112 if ($refquota eq 'none') {
113 $zvol->{size} = 0;
114 } else {
115 $zvol->{size} = zfs_parse_size($refquota);
116 }
117 $zvol->{format} = 'subvol';
118 } else {
119 $zvol->{size} = zfs_parse_size($size);
120 $zvol->{format} = 'raw';
121 }
122 if ($origin !~ /^-$/) {
123 $zvol->{origin} = $origin;
124 }
125 push @$list, $zvol;
126 }
127
128 return $list;
129 }
130
131 sub parse_volname {
132 my ($class, $volname) = @_;
133
134 if ($volname =~ m/^(((base|basevol)-(\d+)-\S+)\/)?((base|basevol|vm|subvol)-(\d+)-\S+)$/) {
135 my $format = ($6 eq 'subvol' || $6 eq 'basevol') ? 'subvol' : 'raw';
136 my $isBase = ($6 eq 'base' || $6 eq 'basevol');
137 return ('images', $5, $7, $2, $4, $isBase, $format);
138 }
139
140 die "unable to parse zfs volume name '$volname'\n";
141 }
142
143 # virtual zfs methods (subclass can overwrite them)
144
145 sub path {
146 my ($class, $scfg, $volname, $storeid, $snapname) = @_;
147
148 my ($vtype, $name, $vmid) = $class->parse_volname($volname);
149
150 my $path = '';
151
152 if ($vtype eq "images") {
153 if ($name =~ m/^subvol-/ || $name =~ m/^basevol-/) {
154 # fixme: we currently assume standard mount point?!
155 $path = "/$scfg->{pool}/$name";
156 } else {
157 $path = "/dev/zvol/$scfg->{pool}/$name";
158 }
159 $path .= "\@$snapname" if defined($snapname);
160 } else {
161 die "$vtype is not allowed in ZFSPool!";
162 }
163
164 return ($path, $vmid, $vtype);
165 }
166
167 sub zfs_request {
168 my ($class, $scfg, $timeout, $method, @params) = @_;
169
170 my $cmd = [];
171
172 if ($method eq 'zpool_list') {
173 push @$cmd, 'zpool', 'list';
174 } elsif ($method eq 'zpool_import') {
175 push @$cmd, 'zpool', 'import';
176 $timeout = 15 if !$timeout || $timeout < 15;
177 } else {
178 push @$cmd, 'zfs', $method;
179 }
180 push @$cmd, @params;
181
182 my $msg = '';
183 my $output = sub { $msg .= "$_[0]\n" };
184
185 $timeout = PVE::RPCEnvironment->is_worker() ? 60*60 : 5 if !$timeout;
186
187 run_command($cmd, errmsg => "zfs error", outfunc => $output, timeout => $timeout);
188
189 return $msg;
190 }
191
192 sub zfs_wait_for_zvol_link {
193 my ($class, $scfg, $volname, $timeout) = @_;
194
195 my $default_timeout = PVE::RPCEnvironment->is_worker() ? 60*5 : 10;
196 $timeout = $default_timeout if !defined($timeout);
197
198 my ($devname, undef, undef) = $class->path($scfg, $volname);
199
200 for (my $i = 1; $i <= $timeout; $i++) {
201 last if -b $devname;
202 die "timeout: no zvol device link for '$volname' found after $timeout sec found.\n"
203 if $i == $timeout;
204
205 sleep(1);
206 }
207 }
208
209 sub alloc_image {
210 my ($class, $storeid, $scfg, $vmid, $fmt, $name, $size) = @_;
211
212 my $volname = $name;
213
214 if ($fmt eq 'raw') {
215
216 die "illegal name '$volname' - should be 'vm-$vmid-*'\n"
217 if $volname && $volname !~ m/^vm-$vmid-/;
218 $volname = $class->zfs_find_free_diskname($storeid, $scfg, $vmid, $fmt)
219 if !$volname;
220
221 $class->zfs_create_zvol($scfg, $volname, $size);
222 $class->zfs_wait_for_zvol_link($scfg, $volname);
223
224 } elsif ( $fmt eq 'subvol') {
225
226 die "illegal name '$volname' - should be 'subvol-$vmid-*'\n"
227 if $volname && $volname !~ m/^subvol-$vmid-/;
228 $volname = $class->zfs_find_free_diskname($storeid, $scfg, $vmid, $fmt)
229 if !$volname;
230
231 die "illegal name '$volname' - should be 'subvol-$vmid-*'\n"
232 if $volname !~ m/^subvol-$vmid-/;
233
234 $class->zfs_create_subvol($scfg, $volname, $size);
235
236 } else {
237 die "unsupported format '$fmt'";
238 }
239
240 return $volname;
241 }
242
243 sub free_image {
244 my ($class, $storeid, $scfg, $volname, $isBase) = @_;
245
246 my (undef, $name, undef) = $class->parse_volname($volname);
247
248 $class->zfs_delete_zvol($scfg, $name);
249
250 return undef;
251 }
252
253 sub list_images {
254 my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_;
255
256 $cache->{zfs} = $class->zfs_list_zvol($scfg) if !$cache->{zfs};
257 my $zfspool = $scfg->{pool};
258 my $res = [];
259
260 if (my $dat = $cache->{zfs}->{$zfspool}) {
261
262 foreach my $image (keys %$dat) {
263
264 my $info = $dat->{$image};
265
266 my $volname = $info->{name};
267 my $parent = $info->{parent};
268 my $owner = $info->{vmid};
269
270 if ($parent && $parent =~ m/^(\S+)\@__base__$/) {
271 my ($basename) = ($1);
272 $info->{volid} = "$storeid:$basename/$volname";
273 } else {
274 $info->{volid} = "$storeid:$volname";
275 }
276
277 if ($vollist) {
278 my $found = grep { $_ eq $info->{volid} } @$vollist;
279 next if !$found;
280 } else {
281 next if defined ($vmid) && ($owner ne $vmid);
282 }
283
284 push @$res, $info;
285 }
286 }
287 return $res;
288 }
289
290 sub zfs_get_pool_stats {
291 my ($class, $scfg) = @_;
292
293 my $available = 0;
294 my $used = 0;
295
296 my $text = $class->zfs_request($scfg, undef, 'get', '-o', 'value', '-Hp',
297 'available,used', $scfg->{pool});
298
299 my @lines = split /\n/, $text;
300
301 if($lines[0] =~ /^(\d+)$/) {
302 $available = $1;
303 }
304
305 if($lines[1] =~ /^(\d+)$/) {
306 $used = $1;
307 }
308
309 return ($available, $used);
310 }
311
312 sub zfs_create_zvol {
313 my ($class, $scfg, $zvol, $size) = @_;
314
315 # always align size to 1M as workaround until
316 # https://github.com/zfsonlinux/zfs/issues/8541 is solved
317 my $padding = (1024 - $size % 1024) % 1024;
318 $size = $size + $padding;
319
320 my $cmd = ['create'];
321
322 push @$cmd, '-s' if $scfg->{sparse};
323
324 push @$cmd, '-b', $scfg->{blocksize} if $scfg->{blocksize};
325
326 push @$cmd, '-V', "${size}k", "$scfg->{pool}/$zvol";
327
328 $class->zfs_request($scfg, undef, @$cmd);
329 }
330
331 sub zfs_create_subvol {
332 my ($class, $scfg, $volname, $size) = @_;
333
334 my $dataset = "$scfg->{pool}/$volname";
335
336 my $cmd = ['create', '-o', 'acltype=posixacl', '-o', 'xattr=sa',
337 '-o', "refquota=${size}k", $dataset];
338
339 $class->zfs_request($scfg, undef, @$cmd);
340 }
341
342 sub zfs_delete_zvol {
343 my ($class, $scfg, $zvol) = @_;
344
345 my $err;
346
347 for (my $i = 0; $i < 6; $i++) {
348
349 eval { $class->zfs_request($scfg, undef, 'destroy', '-r', "$scfg->{pool}/$zvol"); };
350 if ($err = $@) {
351 if ($err =~ m/^zfs error:(.*): dataset is busy.*/) {
352 sleep(1);
353 } elsif ($err =~ m/^zfs error:.*: dataset does not exist.*$/) {
354 $err = undef;
355 last;
356 } else {
357 die $err;
358 }
359 } else {
360 last;
361 }
362 }
363
364 die $err if $err;
365 }
366
367 sub zfs_list_zvol {
368 my ($class, $scfg) = @_;
369
370 my $text = $class->zfs_request($scfg, 10, 'list', '-o', 'name,volsize,origin,type,refquota', '-t', 'volume,filesystem', '-Hr');
371 my $zvols = zfs_parse_zvol_list($text);
372 return undef if !$zvols;
373
374 my $list = ();
375 foreach my $zvol (@$zvols) {
376 my $pool = $zvol->{pool};
377 my $name = $zvol->{name};
378 my $parent = $zvol->{origin};
379 if($zvol->{origin} && $zvol->{origin} =~ m/^$scfg->{pool}\/(\S+)$/){
380 $parent = $1;
381 }
382
383 $list->{$pool}->{$name} = {
384 name => $name,
385 size => $zvol->{size},
386 parent => $parent,
387 format => $zvol->{format},
388 vmid => $zvol->{owner},
389 };
390 }
391
392 return $list;
393 }
394
395 sub zfs_find_free_diskname {
396 my ($class, $storeid, $scfg, $vmid, $format) = @_;
397
398 my $volumes = $class->zfs_list_zvol($scfg);
399 my $dat = $volumes->{$scfg->{pool}};
400
401 my $disk_list = [ keys %$dat ];
402 return PVE::Storage::Plugin::get_next_vm_diskname($disk_list, $storeid, $vmid, $format, $scfg);
403 }
404
405 sub zfs_get_latest_snapshot {
406 my ($class, $scfg, $volname) = @_;
407
408 my $vname = ($class->parse_volname($volname))[1];
409
410 # abort rollback if snapshot is not the latest
411 my @params = ('-t', 'snapshot', '-o', 'name', '-s', 'creation');
412 my $text = $class->zfs_request($scfg, undef, 'list', @params);
413 my @snapshots = split(/\n/, $text);
414
415 my $recentsnap;
416 foreach (@snapshots) {
417 if (/$scfg->{pool}\/$vname/) {
418 s/^.*@//;
419 $recentsnap = $_;
420 }
421 }
422
423 return $recentsnap;
424 }
425
426 sub status {
427 my ($class, $storeid, $scfg, $cache) = @_;
428
429 my $total = 0;
430 my $free = 0;
431 my $used = 0;
432 my $active = 0;
433
434 eval {
435 ($free, $used) = $class->zfs_get_pool_stats($scfg);
436 $active = 1;
437 $total = $free + $used;
438 };
439 warn $@ if $@;
440
441 return ($total, $free, $used, $active);
442 }
443
444 sub volume_size_info {
445 my ($class, $scfg, $storeid, $volname, $timeout) = @_;
446
447 my (undef, $vname, undef, undef, undef, undef, $format) =
448 $class->parse_volname($volname);
449
450 my $attr = $format eq 'subvol' ? 'refquota' : 'volsize';
451 my $text = $class->zfs_request($scfg, undef, 'get', '-Hp', $attr, "$scfg->{pool}/$vname");
452 if ($text =~ /\s$attr\s(\d+)\s/) {
453 return $1;
454 }
455
456 die "Could not get zfs volume size\n";
457 }
458
459 sub volume_snapshot {
460 my ($class, $scfg, $storeid, $volname, $snap) = @_;
461
462 my $vname = ($class->parse_volname($volname))[1];
463
464 $class->zfs_request($scfg, undef, 'snapshot', "$scfg->{pool}/$vname\@$snap");
465 }
466
467 sub volume_snapshot_delete {
468 my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
469
470 my $vname = ($class->parse_volname($volname))[1];
471
472 $class->deactivate_volume($storeid, $scfg, $vname, $snap, {});
473 $class->zfs_request($scfg, undef, 'destroy', "$scfg->{pool}/$vname\@$snap");
474 }
475
476 sub volume_snapshot_rollback {
477 my ($class, $scfg, $storeid, $volname, $snap) = @_;
478
479 my $vname = ($class->parse_volname($volname))[1];
480
481 $class->zfs_request($scfg, undef, 'rollback', "$scfg->{pool}/$vname\@$snap");
482 }
483
484 sub volume_rollback_is_possible {
485 my ($class, $scfg, $storeid, $volname, $snap) = @_;
486
487 my $recentsnap = $class->zfs_get_latest_snapshot($scfg, $volname);
488 if ($snap ne $recentsnap) {
489 die "can't rollback, more recent snapshots exist\n";
490 }
491
492 return 1;
493 }
494
495 sub volume_snapshot_list {
496 my ($class, $scfg, $storeid, $volname) = @_;
497
498 my ($vtype, $name, $vmid) = $class->parse_volname($volname);
499
500 my $zpath = "$scfg->{pool}/$name";
501
502 my $snaps = [];
503
504 my $cmd = ['zfs', 'list', '-r', '-H', '-S', 'name', '-t', 'snap', '-o',
505 'name', $zpath];
506
507 my $outfunc = sub {
508 my $line = shift;
509
510 if ($line =~ m/^\Q$zpath\E@(.*)$/) {
511 push @$snaps, $1;
512 }
513 };
514
515 eval { run_command( [$cmd], outfunc => $outfunc , errfunc => sub{}); };
516
517 # return an empty array if dataset does not exist.
518 return $snaps;
519 }
520
521 sub activate_storage {
522 my ($class, $storeid, $scfg, $cache) = @_;
523
524 # Note: $scfg->{pool} can include dataset <pool>/<dataset>
525 my $pool = $scfg->{pool};
526 $pool =~ s!/.*$!!;
527
528 my $pool_imported = sub {
529 my @param = ('-o', 'name', '-H', "$pool");
530 my $res = eval { $class->zfs_request($scfg, undef, 'zpool_list', @param) };
531 if ($@) {
532 warn "$@\n";
533 return undef;
534 }
535 return defined($res) && $res =~ m/$pool/;
536 };
537
538 if (!$pool_imported->()) {
539 # import can only be done if not yet imported!
540 my @param = ('-d', '/dev/disk/by-id/', '-o', 'cachefile=none', "$pool");
541 eval { $class->zfs_request($scfg, undef, 'zpool_import', @param) };
542 if (my $err = $@) {
543 # just could've raced with another import, so recheck if it is imported
544 die "could not activate storage '$storeid', $@\n" if !$pool_imported->();
545 }
546 }
547 return 1;
548 }
549
550 sub deactivate_storage {
551 my ($class, $storeid, $scfg, $cache) = @_;
552 return 1;
553 }
554
555 sub activate_volume {
556 my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
557
558 return 1 if defined($snapname);
559
560 my (undef, undef, undef, undef, undef, undef, $format) = $class->parse_volname($volname);
561
562 return 1 if $format ne 'raw';
563
564 $class->zfs_wait_for_zvol_link($scfg, $volname);
565
566 return 1;
567 }
568
569 sub deactivate_volume {
570 my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
571 return 1;
572 }
573
574 sub clone_image {
575 my ($class, $scfg, $storeid, $volname, $vmid, $snap) = @_;
576
577 $snap ||= '__base__';
578
579 my ($vtype, $basename, $basevmid, undef, undef, $isBase, $format) =
580 $class->parse_volname($volname);
581
582 die "clone_image only works on base images\n" if !$isBase;
583
584 my $name = $class->zfs_find_free_diskname($storeid, $scfg, $vmid, $format);
585
586 if ($format eq 'subvol') {
587 my $size = $class->zfs_request($scfg, undef, 'list', '-H', '-o', 'refquota', "$scfg->{pool}/$basename");
588 chomp($size);
589 $class->zfs_request($scfg, undef, 'clone', "$scfg->{pool}/$basename\@$snap", "$scfg->{pool}/$name", '-o', "refquota=$size");
590 } else {
591 $class->zfs_request($scfg, undef, 'clone', "$scfg->{pool}/$basename\@$snap", "$scfg->{pool}/$name");
592 }
593
594 return "$basename/$name";
595 }
596
597 sub create_base {
598 my ($class, $storeid, $scfg, $volname) = @_;
599
600 my $snap = '__base__';
601
602 my ($vtype, $name, $vmid, $basename, $basevmid, $isBase, $format) =
603 $class->parse_volname($volname);
604
605 die "create_base not possible with base image\n" if $isBase;
606
607 my $newname = $name;
608 if ( $format eq 'subvol' ) {
609 $newname =~ s/^subvol-/basevol-/;
610 } else {
611 $newname =~ s/^vm-/base-/;
612 }
613 my $newvolname = $basename ? "$basename/$newname" : "$newname";
614
615 $class->zfs_request($scfg, undef, 'rename', "$scfg->{pool}/$name", "$scfg->{pool}/$newname");
616
617 my $running = undef; #fixme : is create_base always offline ?
618
619 $class->volume_snapshot($scfg, $storeid, $newname, $snap, $running);
620
621 return $newvolname;
622 }
623
624 sub volume_resize {
625 my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
626
627 my $new_size = int($size/1024);
628
629 my (undef, $vname, undef, undef, undef, undef, $format) =
630 $class->parse_volname($volname);
631
632 my $attr = $format eq 'subvol' ? 'refquota' : 'volsize';
633
634 $class->zfs_request($scfg, undef, 'set', "$attr=${new_size}k", "$scfg->{pool}/$vname");
635
636 return $new_size;
637 }
638
639 sub storage_can_replicate {
640 my ($class, $scfg, $storeid, $format) = @_;
641
642 return 1 if $format eq 'raw' || $format eq 'subvol';
643
644 return 0;
645 }
646
647 sub volume_has_feature {
648 my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
649
650 my $features = {
651 snapshot => { current => 1, snap => 1},
652 clone => { base => 1},
653 template => { current => 1},
654 copy => { base => 1, current => 1},
655 sparseinit => { base => 1, current => 1},
656 replicate => { base => 1, current => 1},
657 };
658
659 my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
660 $class->parse_volname($volname);
661
662 my $key = undef;
663
664 if ($snapname) {
665 $key = 'snap';
666 } else {
667 $key = $isBase ? 'base' : 'current';
668 }
669
670 return 1 if $features->{$feature}->{$key};
671
672 return undef;
673 }
674
675 sub volume_export {
676 my ($class, $scfg, $storeid, $fh, $volname, $format, $snapshot, $base_snapshot, $with_snapshots) = @_;
677
678 die "unsupported export stream format for $class: $format\n"
679 if $format ne 'zfs';
680
681 die "$class storage can only export snapshots\n"
682 if !defined($snapshot);
683
684 my $dataset = ($class->parse_volname($volname))[1];
685
686 my $fd = fileno($fh);
687 die "internal error: invalid file handle for volume_export\n"
688 if !defined($fd);
689 $fd = ">&$fd";
690
691 # For zfs we always create a replication stream (-R) which means the remote
692 # side will always delete non-existing source snapshots. This should work
693 # for all our use cases.
694 my $cmd = ['zfs', 'send', '-Rpv'];
695 if (defined($base_snapshot)) {
696 my $arg = $with_snapshots ? '-I' : '-i';
697 push @$cmd, $arg, $base_snapshot;
698 }
699 push @$cmd, '--', "$scfg->{pool}/$dataset\@$snapshot";
700
701 run_command($cmd, output => $fd);
702
703 return;
704 }
705
706 sub volume_export_formats {
707 my ($class, $scfg, $storeid, $volname, $snapshot, $base_snapshot, $with_snapshots) = @_;
708
709 my @formats = ('zfs');
710 # TODOs:
711 # push @formats, 'fies' if $volname !~ /^(?:basevol|subvol)-/;
712 # push @formats, 'raw' if !$base_snapshot && !$with_snapshots;
713 return @formats;
714 }
715
716 sub volume_import {
717 my ($class, $scfg, $storeid, $fh, $volname, $format, $base_snapshot, $with_snapshots) = @_;
718
719 die "unsupported import stream format for $class: $format\n"
720 if $format ne 'zfs';
721
722 my $fd = fileno($fh);
723 die "internal error: invalid file handle for volume_import\n"
724 if !defined($fd);
725
726 my $dataset = ($class->parse_volname($volname))[1];
727 my $zfspath = "$scfg->{pool}/$dataset";
728 my $suffix = defined($base_snapshot) ? "\@$base_snapshot" : '';
729 my $exists = 0 == run_command(['zfs', 'get', '-H', 'name', $zfspath.$suffix],
730 noerr => 1, errfunc => sub {});
731 if (defined($base_snapshot)) {
732 die "base snapshot '$zfspath\@$base_snapshot' doesn't exist\n" if !$exists;
733 } else {
734 die "volume '$zfspath' already exists\n" if $exists;
735 }
736
737 eval { run_command(['zfs', 'recv', '-F', '--', $zfspath], input => "<&$fd") };
738 if (my $err = $@) {
739 if (defined($base_snapshot)) {
740 eval { run_command(['zfs', 'rollback', '-r', '--', "$zfspath\@$base_snapshot"]) };
741 } else {
742 eval { run_command(['zfs', 'destroy', '-r', '--', $zfspath]) };
743 }
744 die $err;
745 }
746
747 return;
748 }
749
750 sub volume_import_formats {
751 my ($class, $scfg, $storeid, $volname, $base_snapshot, $with_snapshots) = @_;
752
753 return $class->volume_export_formats($scfg, $storeid, $volname, undef, $base_snapshot, $with_snapshots);
754 }
755
756 1;