zfs pool plugin: implement method to get qemu blockdevice options
ZFS does not have a filesystem_path() method, so the default implementation for qemu_blockdev_options() cannot be re-used. This is most likely, because snapshots are currently not directly accessible via a filesystem path in the Proxmox VE storage layer. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Fabian Grünbichler
parent
02931346c6
commit
b8acc0286b
@ -162,6 +162,20 @@ sub path {
|
|||||||
return ($path, $vmid, $vtype);
|
return ($path, $vmid, $vtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub qemu_blockdev_options {
|
||||||
|
my ($class, $scfg, $storeid, $volname) = @_;
|
||||||
|
|
||||||
|
my $format = ($class->parse_volname($volname))[6];
|
||||||
|
|
||||||
|
die "volume '$volname' not usable as VM image\n" if $format ne 'raw';
|
||||||
|
|
||||||
|
my ($path) = $class->path($scfg, $volname, $storeid);
|
||||||
|
|
||||||
|
my $blockdev = { driver => 'host_device', filename => $path };
|
||||||
|
|
||||||
|
return $blockdev;
|
||||||
|
}
|
||||||
|
|
||||||
sub zfs_request {
|
sub zfs_request {
|
||||||
my ($class, $scfg, $timeout, $method, @params) = @_;
|
my ($class, $scfg, $timeout, $method, @params) = @_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user