qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
To: Libaiqing <libaiqing@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "mdroth@linux.vnet.ibm.com" <mdroth@linux.vnet.ibm.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"vrozenfe@redhat.com" <vrozenfe@redhat.com>,
	Haofeng <haofeng@huawei.com>,
	"lcapitulino@redhat.com" <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH v2 00/11] qemu-ga: fsfreeze on Windows using VSS
Date: Mon, 29 Apr 2013 17:13:37 +0000	[thread overview]
Message-ID: <CDA41AD4.179B%Tomoki.Sekiyama@hds.com> (raw)
In-Reply-To: <CD9C2A2D.1640%Tomoki.Sekiyama@hds.com>

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

Hi,

On 4/23/13 12:44 , "Tomoki Sekiyama" <tomoki.sekiyama@hds.com> wrote:
>>    2 executing the command "{"execute":"guest-fsfreeze-freeze"}"
>>failed,the output is:
><snip>
>> {"execute":"guest-fsfreeze-freeze"}
>> {"error": {"class": "GenericError", "desc": "Failed to
>>pVssbc->SetContext. (Error: 8004231b) "}}
>> 
>> Could you give me some advise to debug this problem ? I can provide more
>>information if need.
>
>Is there any logs corresponding to the error in Event Viewer?
>
>And this might be caused by unsupported VSS_VOLSNAP_ATTR_* flags in
>SetContext()
>called from qga_vss_fsfreeze_freeze() at qga/vss-win32-requester.cpp,
>but I couldn't find out flags not supported on Windows 7 from VSS
>references.

I'm investigating this issue. Some versions of Windows seem to
ignore VSS_VOLSNAP_ATTR_NO_AUTORECOVERY, and to cause an error with
VSS_VOLSNAP_ATTR_TRANSPORTABLE. In such cases, we cannot disable
Auto-recovery that requires writable snapshots we don't yet support.
Because of this, even if we remove TRANSPORTABLE flag, auto-recovery
would be enabled and cause another error (VSS_E_OBJECT_NOT_FOUND) on thaw.

The patch attached (to be applied after v2 patch) removes TRANSPORTABLE
flag, and ignores the VSS_E_OBJECT_NOT_FOUND error on thaw.
I think this should resolve the issue in Windows 7, and also works in
the other versions of Windows. Could you try this?

If it works, I will merge this into my path set and resend it as v3.

Thanks,
Tomoki Sekiyama


[-- Attachment #2: ignore-notfound.patch --]
[-- Type: application/octet-stream, Size: 1987 bytes --]

diff --git a/qga/vss-win32-requester.cpp b/qga/vss-win32-requester.cpp
index 90ff026..0e02818 100644
--- a/qga/vss-win32-requester.cpp
+++ b/qga/vss-win32-requester.cpp
@@ -259,12 +259,11 @@ void qga_vss_fsfreeze_freeze(int *num_vols, Error **err)
     /*
      * Currently writable snapshots are not supported.
      * To prevent the final commit (which requires to write to snapshots),
-     * VSS_VOLSNAP_ATTR_NO_AUTORECOVERY (for Win2008 SP2 or later) and
-     * VSS_VOLSNAP_ATTR_TRANSPORTABLE (for ealier versions) are specified here.
+     * VSS_VOLSNAP_ATTR_NO_AUTORECOVERY (for Win2008 SP2 or later) 
+     * are specified here.
      */
     chk( pVssbc->SetContext(VSS_CTX_APP_ROLLBACK |
                             VSS_VOLSNAP_ATTR_NO_AUTORECOVERY |
-                            VSS_VOLSNAP_ATTR_TRANSPORTABLE |
                             VSS_VOLSNAP_ATTR_TXF_RECOVERY) );
 
     chk( pVssbc->GatherWriterMetadata(&pAsync) );
@@ -372,7 +371,19 @@ void qga_vss_fsfreeze_thaw(int *num_vols, Error **err)
     assert(pVssbc);
     assert(pAsyncSnapshot);
 
-    _chk( WaitForAsync(pAsyncSnapshot), "DoSnapshotSet", err, out );
+    HRESULT hr = WaitForAsync(pAsyncSnapshot);
+    if (hr == VSS_E_OBJECT_NOT_FOUND) {
+        /*
+         * On Windows earlier than 2008 SP2 which does not support
+         * VSS_VOLSNAP_ATTR_NO_AUTORECOVERY context, final commit is not
+         * skipped and VSS is aborted. In this case, we get here. Still the
+         * snapshot is taken successfully, so we just ignore the error.
+         */
+        pAsyncSnapshot->Release();
+        pAsyncSnapshot = NULL;
+        goto final;
+    }
+    _chk( hr, "DoSnapshotSet", err, out );
     pAsyncSnapshot->Release();
     pAsyncSnapshot = NULL;
 
@@ -380,6 +391,7 @@ void qga_vss_fsfreeze_thaw(int *num_vols, Error **err)
     _chk( WaitForAsync(pAsync), "BackupComplete", err, out );
     pAsync->Release();
 
+final:
     *num_vols = cFrozenVols;
     cFrozenVols = 0;
     goto done;

      reply	other threads:[~2013-04-29 17:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 20:01 [Qemu-devel] [RFC PATCH v2 00/11] qemu-ga: fsfreeze on Windows using VSS Tomoki Sekiyama
2013-04-12 20:01 ` [Qemu-devel] [RFC PATCH v2 01/11] configure: Support configuring c++ compiler Tomoki Sekiyama
2013-04-12 20:01 ` [Qemu-devel] [RFC PATCH v2 02/11] Fix errors and warnings while compiling with c++ compilier Tomoki Sekiyama
2013-04-12 20:01 ` [Qemu-devel] [RFC PATCH v2 03/11] Add a script to extract VSS SDK headers on POSIX system Tomoki Sekiyama
2013-04-12 20:01 ` [Qemu-devel] [RFC PATCH v2 04/11] qemu-ga: Add an configure option to specify path to Windows VSS SDK Tomoki Sekiyama
2013-04-12 20:01 ` [Qemu-devel] [RFC PATCH v2 05/11] qemu-ga: Add Windows VSS provider to quiesce applications on fsfreeze Tomoki Sekiyama
2013-04-12 20:01 ` [Qemu-devel] [RFC PATCH v2 06/11] qemu-ga: Add Windows VSS requester to quisce applications and filesystems Tomoki Sekiyama
2013-04-12 20:02 ` [Qemu-devel] [RFC PATCH v2 07/11] qemu-ga: call Windows VSS requester in fsfreeze command handler Tomoki Sekiyama
2013-04-12 20:02 ` [Qemu-devel] [RFC PATCH v2 08/11] qemu-ga: install Windows VSS provider on `qemu-ga -s install' Tomoki Sekiyama
2013-04-12 20:02 ` [Qemu-devel] [RFC PATCH v2 09/11] qemu-ga: Add VSS provider .tlb file in the repository Tomoki Sekiyama
2013-04-12 20:02 ` [Qemu-devel] [RFC PATCH v2 10/11] QMP/qemu-ga-client: make timeout longer for guest-fsfreeze-freeze command Tomoki Sekiyama
2013-04-12 20:02 ` [Qemu-devel] [RFC PATCH v2 11/11] QMP/qmp.py: set locale for exceptions to display non-ascii messages correctly Tomoki Sekiyama
2013-04-23 11:08 ` [Qemu-devel] [RFC PATCH v2 00/11] qemu-ga: fsfreeze on Windows using VSS Libaiqing
2013-04-23 16:44   ` Tomoki Sekiyama
2013-04-29 17:13     ` Tomoki Sekiyama [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=CDA41AD4.179B%Tomoki.Sekiyama@hds.com \
    --to=tomoki.sekiyama@hds.com \
    --cc=haofeng@huawei.com \
    --cc=lcapitulino@redhat.com \
    --cc=libaiqing@huawei.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vrozenfe@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).