]> git.proxmox.com Git - mirror_qemu.git/commit
qemu-error: add {error, warn}_report_once_cond
authorCornelia Huck <cohuck@redhat.com>
Thu, 30 Aug 2018 14:59:01 +0000 (16:59 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 24 Sep 2018 15:13:07 +0000 (17:13 +0200)
commitc55510b72218a2d0b263eda006fd7aac1496b694
treed62c582b3d29c693f68ec6f55accc828bb98b228
parentd6f71af65410d3e003ba331c5e57eddcf716cbcf
qemu-error: add {error, warn}_report_once_cond

Add two functions to print an error/warning report once depending
on a passed-in condition variable and flip it if printed. This is
useful if you want to print a message not once-globally, but e.g.
once-per-device.

Inspired by warn_once() in hw/vfio/ccw.c, which has been replaced
with warn_report_once_cond().

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20180830145902.27376-2-cohuck@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Function comments reworded]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
hw/vfio/ccw.c
include/qemu/error-report.h
util/qemu-error.c