diff mbox

[3/3] qga: vss-win32: Fix interference with snapshot deletion by other VSS request

Message ID 20140113172539.11163.2952.stgit@helix
State New
Headers show

Commit Message

Tomoki Sekiyama Jan. 13, 2014, 5:25 p.m. UTC
When a VSS requester such as vshadow.exe or diskshadow.exe requests to
delete snapshots, qemu-ga VSS provider's DeleteSnapshots() is also called
and returns E_NOTIMPL, that makes the deletion fail.
To avoid this issue, return S_OK and set values that represent no snapshots
are deleted by qemu-ga VSS provider.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
---
 qga/vss-win32/provider.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Gal Hammer Jan. 14, 2014, 8:34 a.m. UTC | #1
On 13/01/2014 19:25, Tomoki Sekiyama wrote:
> When a VSS requester such as vshadow.exe or diskshadow.exe requests to
> delete snapshots, qemu-ga VSS provider's DeleteSnapshots() is also called
> and returns E_NOTIMPL, that makes the deletion fail.
> To avoid this issue, return S_OK and set values that represent no snapshots
> are deleted by qemu-ga VSS provider.
>
> Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>

Reviewed-by: Gal Hammer <ghammer@redhat.com>

     Gal.
Yan Vugenfirer Jan. 19, 2014, 10:21 a.m. UTC | #2
On Jan 13, 2014, at 7:25 PM, Tomoki Sekiyama <tomoki.sekiyama@hds.com> wrote:

> When a VSS requester such as vshadow.exe or diskshadow.exe requests to
> delete snapshots, qemu-ga VSS provider's DeleteSnapshots() is also called
> and returns E_NOTIMPL, that makes the deletion fail.
> To avoid this issue, return S_OK and set values that represent no snapshots
> are deleted by qemu-ga VSS provider.
> 
> Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
> ---
> qga/vss-win32/provider.cpp |    4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
> index b233646..d5129f8 100644
> --- a/qga/vss-win32/provider.cpp
> +++ b/qga/vss-win32/provider.cpp
> @@ -278,7 +278,9 @@ STDMETHODIMP CQGAVssProvider::DeleteSnapshots(
>     VSS_ID SourceObjectId, VSS_OBJECT_TYPE eSourceObjectType,
>     BOOL bForceDelete, LONG *plDeletedSnapshots, VSS_ID *pNondeletedSnapshotID)
> {
> -    return E_NOTIMPL;
> +    *plDeletedSnapshots = 0;
> +    *pNondeletedSnapshotID = SourceObjectId;
> +    return S_OK;
> }
> 
> STDMETHODIMP CQGAVssProvider::BeginPrepareSnapshot(
> 
> 

Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
diff mbox

Patch

diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
index b233646..d5129f8 100644
--- a/qga/vss-win32/provider.cpp
+++ b/qga/vss-win32/provider.cpp
@@ -278,7 +278,9 @@  STDMETHODIMP CQGAVssProvider::DeleteSnapshots(
     VSS_ID SourceObjectId, VSS_OBJECT_TYPE eSourceObjectType,
     BOOL bForceDelete, LONG *plDeletedSnapshots, VSS_ID *pNondeletedSnapshotID)
 {
-    return E_NOTIMPL;
+    *plDeletedSnapshots = 0;
+    *pNondeletedSnapshotID = SourceObjectId;
+    return S_OK;
 }
 
 STDMETHODIMP CQGAVssProvider::BeginPrepareSnapshot(