From: Halil Pasic <pasic@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qemu-error: remove dependency of stubs on monitor
Date: Mon, 24 Oct 2016 15:19:19 +0200 [thread overview]
Message-ID: <8d349810-cd7c-7fae-13e6-ab6beb8dc058@linux.vnet.ibm.com> (raw)
In-Reply-To: <37942764-b3c8-1ac1-5121-894ada7300f2@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]
On 10/24/2016 01:52 PM, Paolo Bonzini wrote:
>
> On 24/10/2016 12:34, Dr. David Alan Gilbert wrote:
>> > * Paolo Bonzini (pbonzini@redhat.com) wrote:
>>> >> Leave the implementation of error_printf, error_printf_unless_qmp
>>> >> and error_vprintf to libqemustub.a and monitor.c, so that we can
>>> >> remove the monitor_printf and monitor_vprintf stubs.
>>> >>
>>> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>> >> ---
>>> >> This should help shutting up the vmstate unit tests.
>> >
>> > Why does this make it any easier than my patch?
>> > You're still going to need to add something stub specific to turn
>> > the output on and off.
> It makes it possible to override the functions independent of the rest
> of util/qemu-error.c. You can implement the functions in the test, simply as
>
> had_stderr_output = true;
>
> and then assert that had_stderr_output is false or true depending on the
> test.
>
> (It's also a useful starting point to fix the cur_mon race).
>
> Consider this an RFC. error_printf probably should stay in qemu-error.c
> since it can always call error_vprintf.
>
> Paolo
>
Agree with Paolo that the ability to provide a custom (test specific)
implementation is generally beneficial testing and IMHO superior
compared to the solution previously proposed by Dave. Unfortunately I do
not see how is this accomplished by the patch.
I still consider using Error objects in the code under test and
not reporting errors directly the cleanest approach.
Halil
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2016-10-24 13:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 9:33 [Qemu-devel] [PATCH] qemu-error: remove dependency of stubs on monitor Paolo Bonzini
2016-10-24 10:34 ` Dr. David Alan Gilbert
2016-10-24 11:52 ` Paolo Bonzini
2016-10-24 13:08 ` Markus Armbruster
2016-10-24 13:17 ` Paolo Bonzini
2016-10-24 14:19 ` Markus Armbruster
2016-10-24 14:36 ` Paolo Bonzini
2016-10-24 13:19 ` Halil Pasic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d349810-cd7c-7fae-13e6-ab6beb8dc058@linux.vnet.ibm.com \
--to=pasic@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).