From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtiU9-0007HW-7n for qemu-devel@nongnu.org; Mon, 01 Jul 2013 14:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtiDO-0002YN-Qu for qemu-devel@nongnu.org; Mon, 01 Jul 2013 13:48:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtiDO-0002XD-Db for qemu-devel@nongnu.org; Mon, 01 Jul 2013 13:48:38 -0400 Message-ID: <51D1C0E9.3080108@redhat.com> Date: Mon, 01 Jul 2013 11:48:25 -0600 From: Eric Blake MIME-Version: 1.0 References: <20130606150618.10486.60669.stgit@hds.com> <20130606150653.10486.34913.stgit@hds.com> <51D18426.5010909@redhat.com> In-Reply-To: <51D18426.5010909@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2WMXSCAGEDHUBBKFHPWLF" Subject: Re: [Qemu-devel] [PATCH v4 08/10] qemu-ga: call Windows VSS requester in fsfreeze command handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: libaiqing@huawei.com, mdroth@linux.vnet.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, vrozenfe@redhat.com, Tomoki Sekiyama , pbonzini@redhat.com, seiji.aguchi@hds.com, areis@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WMXSCAGEDHUBBKFHPWLF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/01/2013 07:29 AM, Laszlo Ersek wrote: > some comments below >=20 > On 06/06/13 17:06, Tomoki Sekiyama wrote: >> Support guest-fsfreeze-freeze and guest-fsfreeze-thaw commands for Win= dows >> guests. When fsfreeze command is issued, it calls the VSS requester to= >> freeze filesystems and applications. On thaw command, it again tells t= he VSS >> requester to thaw them. >> >> int64_t qmp_guest_fsfreeze_thaw(Error **err) >> { >> + int i; >> + >> + if (!vss_initialized()) { >> + error_set(err, QERR_UNSUPPORTED); >> + return 0; >> + } >> + >> + qga_vss_fsfreeze_thaw(&i, err); >=20 > I wonder how libvirt interprets a failure to thaw -- does it expect > filesystems to remain frozen? (CC'ing Eric.) On failure to thaw, libvirt marks the virDomainSnapshotCreateXML() API call as failed, and logs the failure returned from the guest agent; but beyond that, there really isn't anything further that libvirt can attempt. Guest freeze/thaw is a best-effort attempt, and we don't really have any clean way to recover from a non-cooperative guest (ie. it's no different from a Linux guest managing to kill off the guest agent daemon in the guest at the wrong time). In short, a failed snapshot request has no guarantees on whether the guest is frozen or thawed, and libvirt currently has no additional support to try a thaw in isolation (although there is an intentionally unsupported 'virsh qemu-agent-command' for attempting recovery manually). > ... This patch made me look at ga_command_state_cleanup_all(). > Apparently the POSIX flavor thaws filesystems if qemu-ga exits before a= > thaw command over QMP; see guest_fsfreeze_cleanup() and > ga_command_state_init(). Do you think something similar would be useful= > for the Windows flavor as well? I agree that it is better to try and clean up a thaw on any error case (including the error of qemu-ga exiting without seeing a QMP thaw request), if only to minimize the chance of failure leaving the system wedged with no chance of further recovery attempts. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2WMXSCAGEDHUBBKFHPWLF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR0cDpAAoJEKeha0olJ0NqxIoH/RXwE1W+j76lZul2Sx4yIj6H EfGo/IwwtEs9DmFUCIJhtD9mahCdFJydAcSnHkC/msk1JZ5qQ6BhlZrgRbDPa/A0 ccNb4BQdHen8uIESyGqsOsmVx6RaoeqyqrQC+UVSWqZaibYZ6xdYncynLcBTyuxA aynwTuAZUH6A0OV/QwssBLmPga2kZTJyDoNa5igqSvNFrzhbtvaRHzkqJ5PyzDIM Jr4dZsdEkqjd5ZXcWMgQQcG5jHL0rX26W/BnjY6UuN7V+L3khUCCRDjL3VPv0kri +ADn9R1jOGkvHoTzNufPSMa5f/2N3r4Ett8WINRJgwX9pQmMmgMAicN8yyN8FX0= =ziJZ -----END PGP SIGNATURE----- ------enig2WMXSCAGEDHUBBKFHPWLF--