Monitor: Debug stray prints the right way
authorLuiz Capitulino <lcapitulino@redhat.com>
Thu, 11 Feb 2010 01:50:06 +0000 (23:50 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 19 Feb 2010 21:18:18 +0000 (15:18 -0600)
commitb33bcc55bf5fc77296a3c1393f55c638c9bd462e
treee8f408d2c1dcbe8f7981471781d73c6272544108
parent63a433d5cb0277861a4d878b77643c46800c8c22
Monitor: Debug stray prints the right way

QObject Monitor handlers should not call any Monitor print
function: they should only build objects, printing is done
by common code.

Current QMP code will ignore such calls, as we can't send
garbage to clients, additionally it will also emit an
undefined error on the assumption that print calls usually
report errors.

However, the right way to deal with this is to rely on a
return code. This has been fixed by other commit already.

Now, this commit drops the error from monitor_vprintf() and
adds a better debugging mechanism for those 'stray' prints:
we count them if debug is enabled and let the developer know
if a QObject handler is trying to print anything.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c