diff options
| author | Chen Hanxiao <chenhanxiao@gmail.com> | 2017-10-17 14:41:42 +0800 |
|---|---|---|
| committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2017-10-25 17:12:26 -0500 |
| commit | 4d80d20fe12248956c07587376f5b5a741f74aa2 (patch) | |
| tree | bfd488a356100a92e9b1cc77bf0aa0393c8da593 /qga/vss-win32/requester.cpp | |
| parent | ae49fbbcd8e4e9d8bf7131add34773f579e1aff7 (diff) | |
| download | focaccia-qemu-4d80d20fe12248956c07587376f5b5a741f74aa2.tar.gz focaccia-qemu-4d80d20fe12248956c07587376f5b5a741f74aa2.zip | |
qga-win: don't hang if vss hold writes timeout
When VM is in a heavy IO, if the command "guest-fsfreeze-freeze" is executed, VSS may timeout when trying to hold writes. Inside guest, Event ID 12298(VSS_ERROR_HOLD_WRITES_TIMEOUT) is logged in the Event Viewer. At that time, if we call AbortBackup, qga may hang forever. This patch will solve this issue. Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Cc: Tomoki Sekiyama <tomoki.sekiyama@gmail.com> Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/vss-win32/requester.cpp')
| -rw-r--r-- | qga/vss-win32/requester.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp index 301762d8b1..3d9c9716c0 100644 --- a/qga/vss-win32/requester.cpp +++ b/qga/vss-win32/requester.cpp @@ -419,6 +419,16 @@ void requester_freeze(int *num_vols, ErrorSet *errset) break; } } + + if (wait_status == WAIT_TIMEOUT) { + err_set(errset, E_FAIL, + "timeout when try to receive Frozen event from VSS provider"); + /* If we are here, VSS had timeout. + * Don't call AbortBackup, just return directly. + */ + goto out1; + } + if (wait_status != WAIT_OBJECT_0) { err_set(errset, E_FAIL, "couldn't receive Frozen event from VSS provider"); @@ -432,6 +442,8 @@ out: if (vss_ctx.pVssbc) { vss_ctx.pVssbc->AbortBackup(); } + +out1: requester_cleanup(); CoUninitialize(); } |