From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQkxJ-0000CU-AE for qemu-devel@nongnu.org; Mon, 30 Sep 2013 17:24:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQkxE-0000ZD-EG for qemu-devel@nongnu.org; Mon, 30 Sep 2013 17:24:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQkxE-0000Z3-6k for qemu-devel@nongnu.org; Mon, 30 Sep 2013 17:24:32 -0400 Message-ID: <5249EC0B.2040907@redhat.com> Date: Mon, 30 Sep 2013 15:24:27 -0600 From: Eric Blake MIME-Version: 1.0 References: <1378695482-29805-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1378695482-29805-4-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1378695482-29805-4-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C3ceohhUFp9gIqQtpms8VL0rtGsiwqDgH" Subject: Re: [Qemu-devel] [PATCH V3 3/7] qcow2: cancel the modification on fail in qcow2_snapshot_create() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --C3ceohhUFp9gIqQtpms8VL0rtGsiwqDgH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/08/2013 08:57 PM, Wenchao Xia wrote: > Signed-off-by: Wenchao Xia > --- > block/qcow2-snapshot.c | 20 ++++++++++++++++---- > 1 files changed, 16 insertions(+), 4 deletions(-) >=20 > =20 > +restore_refcount: > + if (qcow2_update_snapshot_refcount(bs, s->l1_table_offset, s->l1_s= ize, -1) > + < 0) { > + /* Nothing can be done none now, need image check later */ s/none // > + error_report("qcow2: Error in restoring refcount in snapshot")= ; > + } Do we need to (attempt to) mark image metadata to mark the image corrupted at this point? Is it still wise to try and fall through to freeing the clusters? > + > +dealloc_cluster: > + qcow2_free_clusters(bs, sn->l1_table_offset, > + sn->l1_size * sizeof(uint64_t), > + QCOW2_DISCARD_ALWAYS); > + > fail: > g_free(sn->id_str); > g_free(sn->name); >=20 On the surface, this makes sense, but I'd rather defer the technical review to someone more familiar with qcow2 code. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --C3ceohhUFp9gIqQtpms8VL0rtGsiwqDgH 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.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSSewLAAoJEKeha0olJ0NqdTIH+wVerFDY6Qk/fWnNToA33rfN 1a+U41IpCbDV/0tIQ9/r3GpcfTSFhqyEtrmLptJpDcoE+vq2wuROPka955clL0I0 7CefKIbRDnTJroUlT7qVTGM1TnQzwhXjGt4ts/rba2iPRFklOgKrbWWbg3gQ7FsN V+v2r29J7CgvN8NoSUpL6HmhqhgoVw087NajLG3aAt0MXIyMSX0nAQH1g1aa5vQ7 P+GwE+DDgUXmQQu5ewD9FWS6LxyeIy1MP19iwtBIkn1S/Rw21+FaHAtbqKICOFkX tEXWaqiVvOQpvwauzJQAyd8hZifvNsMzcAK3UYT8l6jZnGbA3fKvqb7+VrLl70w= =Tzud -----END PGP SIGNATURE----- --C3ceohhUFp9gIqQtpms8VL0rtGsiwqDgH--