From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKRPi-00059q-1A for qemu-devel@nongnu.org; Thu, 21 Aug 2014 08:24:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKRPd-0007cc-3w for qemu-devel@nongnu.org; Thu, 21 Aug 2014 08:24:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKRPc-0007cW-Ry for qemu-devel@nongnu.org; Thu, 21 Aug 2014 08:24:17 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7LCOG39030703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 21 Aug 2014 08:24:16 -0400 Message-ID: <53F5E4EF.30607@redhat.com> Date: Thu, 21 Aug 2014 06:24:15 -0600 From: Eric Blake MIME-Version: 1.0 References: <1408223814-23999-1-git-send-email-mreitz@redhat.com> <1408223814-23999-5-git-send-email-mreitz@redhat.com> <20140820105121.GE6122@noname.redhat.com> <53F4F663.3060707@redhat.com> <20140821081432.GB4452@noname.redhat.com> In-Reply-To: <20140821081432.GB4452@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UJAU7uQvRaVONa1blGsspohhrpNfoCSLb" Subject: Re: [Qemu-devel] [PATCH 4/4] qcow2: Check L1/L2/reftable entries for alignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Max Reitz Cc: qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UJAU7uQvRaVONa1blGsspohhrpNfoCSLb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/21/2014 02:14 AM, Kevin Wolf wrote: >>>> + if (offset_into_cluster(s, l2_entry & L2E_OFFSET_MASK))= { >>>> + fprintf(stderr, "qcow2: Cannot free unaligned clust= er %#llx\n", >>>> + l2_entry & L2E_OFFSET_MASK); >>>> + } else { >>>> + qcow2_free_clusters(bs, l2_entry & L2E_OFFSET_MASK,= >>>> + nb_clusters << s->cluster_bits,= type); >>>> + } >>> Hm... Why isn't this a corruption like any other? Unconditional >>> fprintf() is something I don't like a lot. >> >> We already do it in qcow2_free_clusters(). >> >> I decided not to make it a corruption because we don't lose >> anything. The entry is corrupted, but we don't need it anymore >> anyway; it's overwritten with 0 and wherever the cluster might have >> been meant to be located, it doesn't matter anymore. >=20 > I can see your point. This is a tough one: On the one hand, it is > undoubtedly corruption, and usually there is not just one corrupted > entry, so you want the user to check the image. On the other hand, yes,= > this is merely a cluster leak and breaking the VM for that might be a > bit too much. >=20 > Still just printing a line on stderr and continuing otherwise doesn't > feel quite right, the user will usually miss the message because it end= s > up in the log of a seemingly well working guest and if printed > unconditionally, it may still flood the logs. >=20 > Eric, would management be able to make something useful out of this if > we sent a QMP event? Libvirt could certainly expose a QMP event to upper layers (oVirt, VDSM, OpenStack, ...) for them to be made aware that "your image had a non-fatal corruption, you may want to check if there are other problems going on". I don't think libvirt would do anything in particular with this knowledge beyond passthrough, but it does sound like a reasonable event to add. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --UJAU7uQvRaVONa1blGsspohhrpNfoCSLb 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT9eTvAAoJEKeha0olJ0NqtYsH/2K4ZMkZ+Vsh7XsXwJsIkMcS OyUtgbbpV+hwBJDm6gmZKplxTu0rATtjOExgm7dnve6pmRiqP5TN/Qf2YW7DAZFB pXjtc0/yEnerlBrM+h/2kZ0hVaQY35p6qGC2qNwmXmhjqkHFi05Vkb5iWPfrFz1Q 4N4n2Ga+NR1L64RnhMCVLoj/ZtWOuEzOFnLyil/pVFoxSxdIRg78TF90l0V1Ibje m7ZM0Q6gWTDxbb0qZ1B60VAtuIbbGSq3gjHANIjX1pi57lrYi0VmKUkb2KtOTP7D K2wQ/g2fOV9251SXrb1fNZErvS88y0e/uS00qDdHMhCuTmRrt3D42pnKZ3C3DHA= =i5UT -----END PGP SIGNATURE----- --UJAU7uQvRaVONa1blGsspohhrpNfoCSLb--