All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guangmu Zhu" <guangmuzhu@gmail.com>
To: mdroth <mdroth@linux.vnet.ibm.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] No FreeWriterMetadata() after GatherWriterMetadata() in requester.cpp
Date: Tue, 29 Sep 2015 09:17:40 +0800	[thread overview]
Message-ID: <tencent_02DB08BA2CF281995468CAF8@qq.com> (raw)
In-Reply-To: <tencent_331676013901DCB96C690237@qq.com>

[-- Attachment #1: Type: text/plain, Size: 2126 bytes --]

I sent the patch some days ago and received no response. I have no idea if this means the patch is not Ok or just no one had interest in it...


Sincerely.
Guangmu Zhu


--------------------------------------


FreeWriterMetadata() should be called if GatherWriterMetadata() succeeded.


Signed-off-by: Guangmu Zhu <guangmuzhu@gmail.com>
---
 qga/vss-win32/requester.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)


diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 9b3e310..337f722 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -47,6 +47,7 @@ static struct QGAVSSContext {
     HANDLE hEventFrozen;           /* notify fs/writer freeze from provider */
     HANDLE hEventThaw;             /* request provider to thaw */
     HANDLE hEventTimeout;          /* notify timeout in provider */
+    BOOL bWriterMetadataGathered;  /* TRUE if GatherWriterMetadata succeed */
     int cFrozenVols;               /* number of frozen volumes */
 } vss_ctx;
 
@@ -92,6 +93,8 @@ STDAPI requester_init(void)
 
 static void requester_cleanup(void)
 {
+    HRESULT hr = S_OK;
+
     if (vss_ctx.hEventFrozen) {
         CloseHandle(vss_ctx.hEventFrozen);
         vss_ctx.hEventFrozen = NULL;
@@ -108,6 +111,12 @@ static void requester_cleanup(void)
         vss_ctx.pAsyncSnapshot->Release();
         vss_ctx.pAsyncSnapshot = NULL;
     }
+    if (vss_ctx.bWriterMetadataGathered) {
+        hr = vss_ctx.pVssbc->FreeWriterMetadata();
+        if (FAILED(hr)) {
+            err_set(errset, hr, "failed to free writer metadata");
+        }
+    }
     if (vss_ctx.pVssbc) {
         vss_ctx.pVssbc->Release();
         vss_ctx.pVssbc = NULL;
@@ -323,8 +332,10 @@ void requester_freeze(int *num_vols, ErrorSet *errset)
     }
     if (FAILED(hr)) {
         err_set(errset, hr, "failed to gather writer metadata");
+        vss_ctx.bWriterMetadataGathered = FALSE;
         goto out;
     }
+    vss_ctx.bWriterMetadataGathered = TRUE;
 
     AddComponents(errset);
     if (err_is_set(errset)) {
-- 
2.1.4

[-- Attachment #2: Type: text/html, Size: 3439 bytes --]

      reply	other threads:[~2015-09-29  1:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-26  0:46 [Qemu-devel] [PATCH] No FreeWriterMetadata() after GatherWriterMetadata() in requester.cpp Guangmu Zhu
2015-09-26  1:56 ` Guangmu Zhu
2015-09-29  1:17   ` Guangmu Zhu [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=tencent_02DB08BA2CF281995468CAF8@qq.com \
    --to=guangmuzhu@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.