On 09/05/2014 08:07 AM, Max Reitz wrote: > Add a helper function for easily marking an image corrupt (on fatal > corruptions) while outputting an informative message to stderr and via > QAPI. > > Signed-off-by: Max Reitz <[email protected]> > --- > block/qcow2.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ > block/qcow2.h | 5 +++++ > 2 files changed, 53 insertions(+) >
> +void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t
> offset,
> + int64_t size, const char *message_format, ...)
> +{
> + BDRVQcowState *s = bs->opaque;
> + char *message;
> + va_list ap;
> +
> + fatal = fatal && !bs->read_only;
I probably would have written: fatal &= !bs->read_only
but that's cosmetic.
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
