]> git.proxmox.com Git - qemu-server.git/commitdiff
backup: detect PBS features and use only supported
authorStefan Reiter <s.reiter@proxmox.com>
Wed, 8 Jul 2020 09:57:54 +0000 (11:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 9 Jul 2020 11:44:22 +0000 (13:44 +0200)
If 'query-proxmox-support' is not known to QEMU, assume that no other
features are supported either.

If 'pbs' is not supported at all, error out with a nice message.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/VZDump/QemuServer.pm

index 567088cb2003cfebd24cc0a644293488dd20f902..b8bf44af113e02b76e8385b1b4a8a07af20c4c57 100644 (file)
@@ -443,6 +443,12 @@ sub archive_pbs {
            die "interrupted by signal\n";
        };
 
+       my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") };
+       if (!$qemu_support) {
+           die "PBS backups are not supported by the running QEMU version. Please make "
+             . "sure you've installed the latest version and the VM has been restarted.\n";
+       }
+
        my $fs_frozen = $self->qga_fs_freeze($task, $vmid);
 
        my $params = {
@@ -453,11 +459,12 @@ sub archive_pbs {
            password => $password,
            devlist => $devlist,
            'config-file' => $conffile,
-           'use-dirty-bitmap' => JSON::true,
        };
        $params->{fingerprint} = $fingerprint if defined($fingerprint);
        $params->{'firewall-file'} = $firewall if -e $firewall;
 
+       $params->{'use-dirty-bitmap'} = JSON::true if $qemu_support->{'pbs-dirty-bitmap'};
+
        $params->{timeout} = 60; # give some time to connect to the backup server
 
        my $res = eval { mon_cmd($vmid, "backup", %$params) };