[PATCH 0/3] qga/win/vss: add VSS backup type options

Kfir Manor posted 3 patches 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230209085004.2745131-1-kfir@daynix.com
Maintainers: Konstantin Kostiuk <kkostiuk@redhat.com>, Michael Roth <michael.roth@amd.com>
qga/installer/qemu-ga.wxs   |  4 ++++
qga/vss-win32/requester.cpp | 41 ++++++++++++++++++++++++++++++++++++-
qga/vss-win32/vss-handles.h |  3 +++
3 files changed, 47 insertions(+), 1 deletion(-)
[PATCH 0/3] qga/win/vss: add VSS backup type options
Posted by Kfir Manor 1 year, 2 months ago
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/775

The problem, VSS backup type VSS-FULL (the only available VSS backup type currently) can break other backups that use VSS-FULL(for example, Bareos-Fullbackup).

Fix, add other backup types.

Implementation, put the desired backup type number inside Regkey value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\QEMU Guest Agent VSS Provider\VssOption, so that the program can query the desired backup type.

VSS backup types:
number   type
1        VSS_BT_FULL
2        VSS_BT_INCREMENTAL
3        VSS_BT_DIFFERENTIAL
4        VSS_BT_LOG
5        VSS_BT_COPY

for more information about the different backup types https://learn.microsoft.com/en-us/windows/win32/vss/vss-backup-state

Additionally, the program would work as before with VSS-FULL in cases where VssOption doesn't exist, or VssOption value isn't a known backup type.

Kfir Manor (3):
  add VssOption to installer
  query VSS backup type
  requester_freeze changes

 qga/installer/qemu-ga.wxs   |  4 ++++
 qga/vss-win32/requester.cpp | 41 ++++++++++++++++++++++++++++++++++++-
 qga/vss-win32/vss-handles.h |  3 +++
 3 files changed, 47 insertions(+), 1 deletion(-)

-- 
2.38.1
Re: [PATCH 0/3] qga/win/vss: add VSS backup type options
Posted by Konstantin Kostiuk 1 year, 2 months ago
Hi Marc-André,

Can you please review this patch set?

Best Regards,
Konstantin Kostiuk.


On Thu, Feb 9, 2023 at 10:50 AM Kfir Manor <kfir@daynix.com> wrote:

> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/775
>
> The problem, VSS backup type VSS-FULL (the only available VSS backup type
> currently) can break other backups that use VSS-FULL(for example,
> Bareos-Fullbackup).
>
> Fix, add other backup types.
>
> Implementation, put the desired backup type number inside Regkey value
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\QEMU Guest Agent VSS
> Provider\VssOption, so that the program can query the desired backup type.
>
> VSS backup types:
> number   type
> 1        VSS_BT_FULL
> 2        VSS_BT_INCREMENTAL
> 3        VSS_BT_DIFFERENTIAL
> 4        VSS_BT_LOG
> 5        VSS_BT_COPY
>
> for more information about the different backup types
> https://learn.microsoft.com/en-us/windows/win32/vss/vss-backup-state
>
> Additionally, the program would work as before with VSS-FULL in cases
> where VssOption doesn't exist, or VssOption value isn't a known backup type.
>
> Kfir Manor (3):
>   add VssOption to installer
>   query VSS backup type
>   requester_freeze changes
>
>  qga/installer/qemu-ga.wxs   |  4 ++++
>  qga/vss-win32/requester.cpp | 41 ++++++++++++++++++++++++++++++++++++-
>  qga/vss-win32/vss-handles.h |  3 +++
>  3 files changed, 47 insertions(+), 1 deletion(-)
>
> --
> 2.38.1
>
>
Re: [PATCH 0/3] qga/win/vss: add VSS backup type options
Posted by Marc-André Lureau 1 year, 2 months ago
Hi

On Mon, Feb 13, 2023 at 8:20 PM Konstantin Kostiuk <kkostiuk@redhat.com>
wrote:

> Hi Marc-André,
>
> Can you please review this patch set?
>
> Best Regards,
> Konstantin Kostiuk.
>
>
> On Thu, Feb 9, 2023 at 10:50 AM Kfir Manor <kfir@daynix.com> wrote:
>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/775
>>
>> The problem, VSS backup type VSS-FULL (the only available VSS backup type
>> currently) can break other backups that use VSS-FULL(for example,
>> Bareos-Fullbackup).
>>
>> Fix, add other backup types.
>>
>> Implementation, put the desired backup type number inside Regkey value
>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\QEMU Guest Agent VSS
>> Provider\VssOption, so that the program can query the desired backup type.
>>
>> VSS backup types:
>> number   type
>> 1        VSS_BT_FULL
>> 2        VSS_BT_INCREMENTAL
>> 3        VSS_BT_DIFFERENTIAL
>> 4        VSS_BT_LOG
>> 5        VSS_BT_COPY
>>
>> for more information about the different backup types
>> https://learn.microsoft.com/en-us/windows/win32/vss/vss-backup-state
>>
>> Additionally, the program would work as before with VSS-FULL in cases
>> where VssOption doesn't exist, or VssOption value isn't a known backup type.
>>
>
The patch series looks ok (just minor stylistic changes could be made), but
I do not fully understand the way qga-vss.dll works in details for
freeze/thaw.

My understanding is that FIFREEZE do not exist on win32, so we call VSS to
tell (some) apps to flush/freeze pretending a backup is going on, then we
get notified on completion by our own provider (CommitSnapshots) and wait
there for thaw (1 min while VM is suspended?).

But I don't understand how this interacts with other providers (real backup
solutions), and why they are involved/conflict as described in
https://gitlab.com/qemu-project/qemu/-/issues/775.




>
>> Kfir Manor (3):
>>   add VssOption to installer
>>   query VSS backup type
>>   requester_freeze changes
>>
>>  qga/installer/qemu-ga.wxs   |  4 ++++
>>  qga/vss-win32/requester.cpp | 41 ++++++++++++++++++++++++++++++++++++-
>>  qga/vss-win32/vss-handles.h |  3 +++
>>  3 files changed, 47 insertions(+), 1 deletion(-)
>>
>> --
>> 2.38.1
>>
>>
Re: [PATCH 0/3] qga/win/vss: add VSS backup type options
Posted by Konstantin Kostiuk 1 year, 2 months ago
On Tue, Feb 14, 2023 at 3:20 AM Marc-André Lureau <
marcandre.lureau@redhat.com> wrote:

> Hi
>
> On Mon, Feb 13, 2023 at 8:20 PM Konstantin Kostiuk <kkostiuk@redhat.com>
> wrote:
>
>> Hi Marc-André,
>>
>> Can you please review this patch set?
>>
>> Best Regards,
>> Konstantin Kostiuk.
>>
>>
>> On Thu, Feb 9, 2023 at 10:50 AM Kfir Manor <kfir@daynix.com> wrote:
>>
>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/775
>>>
>>> The problem, VSS backup type VSS-FULL (the only available VSS backup
>>> type currently) can break other backups that use VSS-FULL(for example,
>>> Bareos-Fullbackup).
>>>
>>> Fix, add other backup types.
>>>
>>> Implementation, put the desired backup type number inside Regkey value
>>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\QEMU Guest Agent VSS
>>> Provider\VssOption, so that the program can query the desired backup type.
>>>
>>> VSS backup types:
>>> number   type
>>> 1        VSS_BT_FULL
>>> 2        VSS_BT_INCREMENTAL
>>> 3        VSS_BT_DIFFERENTIAL
>>> 4        VSS_BT_LOG
>>> 5        VSS_BT_COPY
>>>
>>> for more information about the different backup types
>>> https://learn.microsoft.com/en-us/windows/win32/vss/vss-backup-state
>>>
>>> Additionally, the program would work as before with VSS-FULL in cases
>>> where VssOption doesn't exist, or VssOption value isn't a known backup type.
>>>
>>
> The patch series looks ok (just minor stylistic changes could be made),
> but I do not fully understand the way qga-vss.dll works in details for
> freeze/thaw.
>
> My understanding is that FIFREEZE do not exist on win32, so we call VSS to
> tell (some) apps to flush/freeze pretending a backup is going on, then we
> get notified on completion by our own provider (CommitSnapshots) and wait
> there for thaw (1 min while VM is suspended?).
>
> But I don't understand how this interacts with other providers (real
> backup solutions), and why they are involved/conflict as described in
> https://gitlab.com/qemu-project/qemu/-/issues/775.
>

This is a very good question. To understand the reason for the conflict we
should dig deeper into VSS.
For some reason, MS provides different VSS backup types. Currently, we
don't use other types but we got
a request from the community. I think this is ok, to add more freedom of
configuration if someone wants it.
Anyway, the default behavior is not changed.


>
>
>>
>>> Kfir Manor (3):
>>>   add VssOption to installer
>>>   query VSS backup type
>>>   requester_freeze changes
>>>
>>>  qga/installer/qemu-ga.wxs   |  4 ++++
>>>  qga/vss-win32/requester.cpp | 41 ++++++++++++++++++++++++++++++++++++-
>>>  qga/vss-win32/vss-handles.h |  3 +++
>>>  3 files changed, 47 insertions(+), 1 deletion(-)
>>>
>>> --
>>> 2.38.1
>>>
>>>