mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-15 08:20:53 +00:00
add runs_at_least_qemu_version to check if we can backup IOThread disks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
19e9b30895
commit
48343b3f1d
@ -7203,6 +7203,15 @@ sub version_cmp {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub runs_at_least_qemu_version {
|
||||||
|
my ($vmid, $major, $minor, $extra) = @_;
|
||||||
|
|
||||||
|
my $v = PVE::QemuServer::vm_qmp_command($vmid, { execute => 'query-version' });
|
||||||
|
$v = $v->{qemu};
|
||||||
|
|
||||||
|
return version_cmp($v->{major}, $major, $v->{minor}, $minor, $v->{micro}, $extra) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
sub qemu_machine_pxe {
|
sub qemu_machine_pxe {
|
||||||
my ($vmid, $conf) = @_;
|
my ($vmid, $conf) = @_;
|
||||||
|
|
||||||
|
@ -77,7 +77,10 @@ sub prepare {
|
|||||||
$self->loginfo("exclude disk '$ds' '$volid' (backup=no)");
|
$self->loginfo("exclude disk '$ds' '$volid' (backup=no)");
|
||||||
return;
|
return;
|
||||||
} elsif ($drive->{iothread}) {
|
} elsif ($drive->{iothread}) {
|
||||||
die "disk '$ds' '$volid' (iothread=on) can't use backup feature currently. Please set backup=no for this drive";
|
if (!PVE::QemuServer::runs_at_least_qemu_version($vmid, 4, 0, 1)) {
|
||||||
|
die "disk '$ds' '$volid' (iothread=on) can't use backup feature with running QEMU " .
|
||||||
|
"version < 4.0.1! Either set backup=no for this drive or upgrade QEMU and restart VM\n";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
my $log = "include disk '$ds' '$volid'";
|
my $log = "include disk '$ds' '$volid'";
|
||||||
if (defined $drive->{size}) {
|
if (defined $drive->{size}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user