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 cluster >>>> %#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. > > 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. > > Still just printing a line on stderr and continuing otherwise doesn't > feel quite right, the user will usually miss the message because it ends > up in the log of a seemingly well working guest and if printed > unconditionally, it may still flood the logs. > > 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. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature