@@ -583,6 +583,7 @@ static const BlockJobDriver backup_job_driver = {
static int64_t backup_calculate_cluster_size(BlockDriverState *target,
Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
int ret;
BlockDriverInfo bdi;
@@ -237,6 +237,7 @@ static bool bdrv_dirty_bitmap_recording(BdrvDirtyBitmap *bitmap)
int bdrv_dirty_bitmap_check(const BdrvDirtyBitmap *bitmap, uint32_t flags,
Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
if ((flags & BDRV_BITMAP_BUSY) && bdrv_dirty_bitmap_busy(bitmap)) {
error_setg(errp, "Bitmap '%s' is currently in use by another"
" operation and cannot be used", bitmap->name);
@@ -320,6 +320,7 @@ static bool raw_is_io_aligned(int fd, void *buf, size_t len)
static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
BDRVRawState *s = bs->opaque;
char *buf;
size_t max_align = MAX(MAX_BLOCKSIZE, getpagesize());
@@ -817,6 +818,7 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
uint64_t new_perm, uint64_t new_shared,
Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
BDRVRawState *s = bs->opaque;
int ret = 0;
Error *local_err = NULL;
@@ -2232,6 +2234,7 @@ static int64_t raw_get_allocated_file_size(BlockDriverState *bs)
static int coroutine_fn
raw_co_create(BlockdevCreateOptions *options, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
BlockdevCreateOptionsFile *file_opts;
Error *local_err = NULL;
int fd;
@@ -419,6 +419,7 @@ out:
static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
struct glfs *glfs;
int ret;
int old_errno;
@@ -694,6 +695,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster *gconf,
const char *filename,
QDict *options, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
int ret;
if (filename) {
ret = qemu_gluster_parse_uri(gconf, filename);
@@ -117,6 +117,7 @@ static QemuOptsList qcow_runtime_opts = {
static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
BDRVQcowState *s = bs->opaque;
unsigned int len, i, shift;
int ret;
@@ -1207,6 +1207,7 @@ static int qcow2_update_options(BlockDriverState *bs, QDict *options,
static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
int flags, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
BDRVQcow2State *s = bs->opaque;
unsigned int len, i;
int ret = 0;
@@ -748,6 +748,7 @@ exit:
int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed,
Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
int ret = 0;
VHDXHeader *hdr;
VHDXLogSequence logs = { 0 };
@@ -971,6 +971,7 @@ static int calculate_rounded_image_size(BlockdevCreateOptionsVpc *vpc_opts,
static int coroutine_fn vpc_co_create(BlockdevCreateOptions *opts,
Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
BlockdevCreateOptionsVpc *vpc_opts;
BlockBackend *blk = NULL;
BlockDriverState *bs = NULL;
If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz <groug@kaod.org> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> --- block/backup.c | 1 + block/dirty-bitmap.c | 1 + block/file-posix.c | 3 +++ block/gluster.c | 2 ++ block/qcow.c | 1 + block/qcow2.c | 1 + block/vhdx-log.c | 1 + block/vpc.c | 1 + 8 files changed, 11 insertions(+)