public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Stefan Reiter <s.reiter@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server 2/2] backup: use dirty-bitmap for PBS only if supported by QEMU
Date: Wed, 8 Jul 2020 11:49:46 +0200	[thread overview]
Message-ID: <9353c2a0-daca-4dc8-eb55-2c84157caf52@proxmox.com> (raw)
In-Reply-To: <14f98570-ca40-9c9a-c7e0-90f53597a91e@proxmox.com>

On 08.07.20 11:22, Stefan Reiter wrote:
> On 7/8/20 11:08 AM, Thomas Lamprecht wrote:
>> On 08.07.20 10:42, Stefan Reiter wrote:
>>> If 'query-proxmox-support' is not known to QEMU, assume that no other
>>> features are supported either.
>>>
>>> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
>>> ---
>>>
>>> Does not require any version bumps, since it handles failure gracefully.
>>>
>>>   PVE/VZDump/QemuServer.pm | 6 +++++-
>>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
>>> index 567088c..3c2a334 100644
>>> --- a/PVE/VZDump/QemuServer.pm
>>> +++ b/PVE/VZDump/QemuServer.pm
>>> @@ -443,6 +443,8 @@ sub archive_pbs {
>>>           die "interrupted by signal\n";
>>>       };
>>>   +    my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") } // {};
>>
>> can we not fall back and instead use undef here to error out with a nice
>> "does not support PBS at all" message?
>>
> 
> If we want that, sure. Though I think it might be cleaner to also have a 'pbs' feature as well, I don't like the approach of implicitly detecting support just because a QMP command exists.

adding an extra command which plainly returns true doesn't changes anything,
at least when done in the initial version of this as then it only can go:

* qmp command exists -> always true
* qmp command doesn'T exists -> always false

so you do not gain anything by that, but I do not care to much..

> 
> I'll send a v2.
> 
>>> +
>>>       my $fs_frozen = $self->qga_fs_freeze($task, $vmid);
>>>         my $params = {
>>> @@ -453,11 +455,13 @@ 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) };
>>>
>>






      reply	other threads:[~2020-07-08  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08  8:42 [pve-devel] [PATCH qemu 1/2] PVE: add query_proxmox_support QMP command Stefan Reiter
2020-07-08  8:42 ` [pve-devel] [PATCH qemu-server 2/2] backup: use dirty-bitmap for PBS only if supported by QEMU Stefan Reiter
2020-07-08  9:08   ` Thomas Lamprecht
2020-07-08  9:22     ` Stefan Reiter
2020-07-08  9:49       ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9353c2a0-daca-4dc8-eb55-2c84157caf52@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.reiter@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal