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: [Qemu-devel] [PATCH] No FreeWriterMetadata() after GatherWriterMetadata() in requester.cpp
Date: Sat, 26 Sep 2015 08:46:25 +0800 [thread overview]
Message-ID: <tencent_6FED308C0CDDDEED0AE8FBC9@qq.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]
FreeWriterMetadata() should be called if GatherWriterMetadata() succeeded.
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)) {
[-- Attachment #2: Type: text/html, Size: 2888 bytes --]
next reply other threads:[~2015-09-26 0:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-26 0:46 Guangmu Zhu [this message]
2015-09-26 1:56 ` [Qemu-devel] [PATCH] No FreeWriterMetadata() after GatherWriterMetadata() in requester.cpp Guangmu Zhu
2015-09-29 1:17 ` Guangmu Zhu
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_6FED308C0CDDDEED0AE8FBC9@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.