On 08/04/2017 09:09 AM, Fam Zheng wrote: > Errors from the callees must be captured and propagated to our caller, > ensure this for both find_extent() and bdrv_getlength(). > > Reported-by: Markus Armbruster <arm...@redhat.com> > Signed-off-by: Fam Zheng <f...@redhat.com> > --- > block/vmdk.c | 26 ++++++++++++++++++-------- > 1 file changed, 18 insertions(+), 8 deletions(-) >
> + if (ret == VMDK_OK) { > + int64_t extent_len = bdrv_getlength(extent->file->bs); > + if (extent_len < 0) { > + fprintf(stderr, > + "ERROR: could not get extent file length for sector > %" > + PRId64 "\n", sector_num); > + ret = extent_len; Pre-existing - our use of fprintf() is not ideal. But this patch doesn't make it worse. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature