5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-25 06:03:52 +03:00

backup: is IOThread comaptible: only check running VMs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-10-23 11:28:47 +02:00
parent 48343b3f1d
commit 317c55c2d1
2 changed files with 2 additions and 2 deletions

View File

@ -7206,7 +7206,7 @@ sub version_cmp {
sub runs_at_least_qemu_version {
my ($vmid, $major, $minor, $extra) = @_;
my $v = PVE::QemuServer::vm_qmp_command($vmid, { execute => 'query-version' });
my $v = eval { 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;

View File

@ -76,7 +76,7 @@ sub prepare {
if (defined($drive->{backup}) && !$drive->{backup}) {
$self->loginfo("exclude disk '$ds' '$volid' (backup=no)");
return;
} elsif ($drive->{iothread}) {
} elsif ($self->{vm_was_running} && $drive->{iothread}) {
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";