From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBr2V-0005ze-PO for qemu-devel@nongnu.org; Wed, 12 Sep 2012 13:47:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBr2Q-0004gf-UF for qemu-devel@nongnu.org; Wed, 12 Sep 2012 13:47:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBr2Q-0004gW-Ls for qemu-devel@nongnu.org; Wed, 12 Sep 2012 13:47:46 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8CHlixp012417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 12 Sep 2012 13:47:45 -0400 Message-ID: <5050CAB8.6040702@redhat.com> Date: Wed, 12 Sep 2012 11:47:36 -0600 From: Eric Blake MIME-Version: 1.0 References: <1347463350-28760-1-git-send-email-gren@redhat.com> In-Reply-To: <1347463350-28760-1-git-send-email-gren@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig5FF83322FC1BB15D3EA54F10" Subject: Re: [Qemu-devel] [libvirt] [PATCH] snapshot: fix rollback failure in transaction mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Guannan Ren Cc: libvir-list@redhat.com, Jeff Cody , QEMU Developers This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5FF83322FC1BB15D3EA54F10 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 09/12/2012 09:22 AM, Guannan Ren wrote: > After failure of qemu transaction command, the snapshot file still > be there with non-zero in size. In order to unlink the file, the > patch removes the file size checking. Can you give some exact steps to reproduce this, so that I know who is making the file have non-zero size? I'm worried that unlinking a non-empty file is discarding data, so the commit message needs a lot more details about how we are proving that the only way the file can be non-zero size is because qemu happened to put data into a previously empty file prior to the failed 'transaction' attempt. That is, after re-reading context code just now, I'm fairly confident that this code can only be reached when qemu supports the 'transaction' monitor command, and libvirt's --reuse-ext flag was not specified, and therefore libvirt must have just created the file. But I want that in the commit message rather than having to re-read the code every time I visit this commit in future reads of the git log. It may also be that qemu has a bug in that the 'transaction' command is modifying files even when it fails, so even while this works around the bug, I'm cc'ing Jeff to see if qemu also needs a bug fix. > --- > src/qemu/qemu_driver.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index 8e8e00c..1fedfb8 100644 > --- a/src/qemu/qemu_driver.c > +++ b/src/qemu/qemu_driver.c > @@ -10833,7 +10833,7 @@ qemuDomainSnapshotUndoSingleDiskActive(struct q= emud_driver *driver, > if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0) > VIR_WARN("Unable to release lock on %s", disk->src); > if (need_unlink && stat(disk->src, &st) =3D=3D 0 && > - st.st_size =3D=3D 0 && S_ISREG(st.st_mode) && unlink(disk->src= ) < 0) > + S_ISREG(st.st_mode) && unlink(disk->src) < 0) > VIR_WARN("Unable to remove just-created %s", disk->src); > =20 > /* Update vm in place to match changes. */ >=20 --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig5FF83322FC1BB15D3EA54F10 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQUMq5AAoJEKeha0olJ0Nqdh0H/1wR9+zf4qjas9cZ1JSf401z pHk6rsorbsJiC+U6i39IuyzhSKqH76HCgWoG3u6pfjH5l4oJYu2ViK09jNVQMYGP EqPxnHZ7Li+SXwhH+3+hnpzy1i/h+4iUsU2KkRJTVBvjAjmh4yPynax+01V/Fd+z ayYzUCbVHErFRZTP5LoQHuX3nIYjdJaGaxP9erEdtbMPOETSS0+C79Qfs/Pymgkz +Jz+My7sABvGt+d6fc06Wn5cdJqDB6rEAa7AhkqwCbX/nYMzUbRu9tWacdodJsIP jC71wbHWclH5+onRcCS0V567/pPreFV46xJOCxZDv13+YzTawOFN9tIH+6Qsh/8= =ki9V -----END PGP SIGNATURE----- --------------enig5FF83322FC1BB15D3EA54F10--