mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-03 01:29:13 +00:00
don't default to O_DIRECT on btrfs without nocow
otherwise it'll produce a whole lot of checksum errors and while this would be nice as a storage feature check, it's hard to be 100% accurate there anyway since a directory storage can point anywhere, like for instance a btrfs directory, causing the same issue... Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
07dfe5391e
commit
0fe779a62c
@ -1530,14 +1530,15 @@ sub print_drive_commandline_full {
|
|||||||
my $format = $drive->{format};
|
my $format = $drive->{format};
|
||||||
my $drive_id = get_drive_id($drive);
|
my $drive_id = get_drive_id($drive);
|
||||||
|
|
||||||
|
my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
|
||||||
|
my $scfg = $storeid ? PVE::Storage::storage_config($storecfg, $storeid) : undef;
|
||||||
|
|
||||||
if (drive_is_cdrom($drive)) {
|
if (drive_is_cdrom($drive)) {
|
||||||
$path = get_iso_path($storecfg, $vmid, $volid);
|
$path = get_iso_path($storecfg, $vmid, $volid);
|
||||||
die "$drive_id: cannot back cdrom drive with PBS snapshot\n" if $pbs_name;
|
die "$drive_id: cannot back cdrom drive with PBS snapshot\n" if $pbs_name;
|
||||||
} else {
|
} else {
|
||||||
my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
|
|
||||||
if ($storeid) {
|
if ($storeid) {
|
||||||
$path = PVE::Storage::path($storecfg, $volid);
|
$path = PVE::Storage::path($storecfg, $volid);
|
||||||
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
|
|
||||||
$format //= qemu_img_format($scfg, $volname);
|
$format //= qemu_img_format($scfg, $volname);
|
||||||
} else {
|
} else {
|
||||||
$path = $volid;
|
$path = $volid;
|
||||||
@ -1594,7 +1595,7 @@ sub print_drive_commandline_full {
|
|||||||
|
|
||||||
if (my $cache = $drive->{cache}) {
|
if (my $cache = $drive->{cache}) {
|
||||||
$cache_direct = $cache =~ /^(?:off|none|directsync)$/;
|
$cache_direct = $cache =~ /^(?:off|none|directsync)$/;
|
||||||
} elsif (!drive_is_cdrom($drive)) {
|
} elsif (!drive_is_cdrom($drive) && !($scfg && $scfg->{type} eq 'btrfs' && !$scfg->{nocow})) {
|
||||||
$opts .= ",cache=none";
|
$opts .= ",cache=none";
|
||||||
$cache_direct = 1;
|
$cache_direct = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user