mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 15:18:29 +00:00
vm_start: check if storages of volumes support correct content-type
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
This commit is contained in:
parent
6d5673c3b6
commit
3f11f0d7e2
@ -3615,6 +3615,7 @@ sub config_to_command {
|
|||||||
my ($ds, $drive) = @_;
|
my ($ds, $drive) = @_;
|
||||||
|
|
||||||
if (PVE::Storage::parse_volume_id($drive->{file}, 1)) {
|
if (PVE::Storage::parse_volume_id($drive->{file}, 1)) {
|
||||||
|
check_volume_storage_type($storecfg, $drive->{file});
|
||||||
push @$vollist, $drive->{file};
|
push @$vollist, $drive->{file};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7744,4 +7745,17 @@ sub vm_is_paused {
|
|||||||
return $qmpstatus && $qmpstatus->{status} eq "paused";
|
return $qmpstatus && $qmpstatus->{status} eq "paused";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub check_volume_storage_type {
|
||||||
|
my ($storecfg, $vol) = @_;
|
||||||
|
|
||||||
|
my ($storeid, $volname) = PVE::Storage::parse_volume_id($vol);
|
||||||
|
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
|
||||||
|
my ($vtype) = PVE::Storage::parse_volname($storecfg, $vol);
|
||||||
|
|
||||||
|
die "storage '$storeid' does not support content-type '$vtype'\n"
|
||||||
|
if !$scfg->{content}->{$vtype};
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user