qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] Fix make check breakage (was [PULL 00/14] QMP queue)
Date: Tue, 14 Jan 2014 13:22:48 -0500	[thread overview]
Message-ID: <20140114132248.3f0be1dd@redhat.com> (raw)
In-Reply-To: <20140114164451.GE3320@dhcp-200-207.str.redhat.com>

On Tue, 14 Jan 2014 17:44:51 +0100
Kevin Wolf <kwolf@redhat.com> wrote:

> Am 14.01.2014 um 04:38 hat Edgar E. Iglesias geschrieben:
> > On Tue, Jan 14, 2014 at 09:27:10AM +1000, Peter Crosthwaite wrote:
> > > Ping,
> > > 
> > > Has this one been forgotten or are there issues? PMM had a small
> > > comment, but he waived it AFAICT.
> > 
> > Pong,
> > 
> > I've merged it now, thanks!
> 
> I believe it's something in this pull requests that breaks make check.

And you're right. But first, let me confirm that we're talking about the
same breakage. This is what I'm getting:

make tests/check-qom-interface
libqemuutil.a(qemu-error.o): In function `error_vprintf':
/home/lcapitulino/work/src/upstream/qmp-unstable/util/qemu-error.c:23: undefined reference to `cur_mon'
/home/lcapitulino/work/src/upstream/qmp-unstable/util/qemu-error.c:24: undefined reference to `cur_mon'
/home/lcapitulino/work/src/upstream/qmp-unstable/util/qemu-error.c:24: undefined reference to `monitor_vprintf'
libqemuutil.a(qemu-error.o): In function `error_printf_unless_qmp':
/home/lcapitulino/work/src/upstream/qmp-unstable/util/qemu-error.c:47: undefined reference to `monitor_cur_is_qmp'
libqemuutil.a(qemu-error.o): In function `error_print_loc':
/home/lcapitulino/work/src/upstream/qmp-unstable/util/qemu-error.c:174: undefined reference to `cur_mon'
collect2: error: ld returned 1 exit status
make: *** [tests/check-qom-interface] Error 1

I tried bisecting it, but git bisect weren't capable of finding the
culprit. So debugged it, and the problem was introduced by:

  commit 594278718323ca7bffaab0fb7fc6c82fa2c1cd5f
  Author: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
  Date:   Wed Jan 1 18:49:52 2014 -0800
  
      qerror: Remove assert_no_error()

There isn't nothing really wrong with this commit. The problem seems to
be that the tests link against libqemuutil.a and this library pulls in
everything from util/. The commit above changed util/error.c to call
error_report(), which depends on 'cur_mon', which is only made available
by monitor.o.

I don't think we want to mess up with including monitor.o on libqemuutil.a.
Besides, I now find it a bit weird to call error_report() from an error
reporting function. So it's better to just call fprintf(stderr,) instead.

Peter, Markus, are you ok with this patch?

PS: I do run make check before sending a pull request, and did run this
    time too. Not sure how I didn't catch this. Thanks for the report
    Kevin!

diff --git a/util/error.c b/util/error.c
index f11f1d5..7c7650c 100644
--- a/util/error.c
+++ b/util/error.c
@@ -44,7 +44,7 @@ void error_set(Error **errp, ErrorClass err_class, const char *fmt, ...)
     err->err_class = err_class;
 
     if (errp == &error_abort) {
-        error_report("%s", error_get_pretty(err));
+        fprintf(stderr, "%s", error_get_pretty(err));
         abort();
     }
 
@@ -80,7 +80,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,
     err->err_class = err_class;
 
     if (errp == &error_abort) {
-        error_report("%s", error_get_pretty(err));
+        fprintf(stderr, "%s", error_get_pretty(err));
         abort();
     }
 
@@ -125,7 +125,7 @@ void error_set_win32(Error **errp, int win32_err, ErrorClass err_class,
     err->err_class = err_class;
 
     if (errp == &error_abort) {
-        error_report("%s", error_get_pretty(err));
+        fprintf(stderr, "%s", error_get_pretty(err));
         abort();
     }
 
@@ -171,7 +171,7 @@ void error_free(Error *err)
 void error_propagate(Error **dst_err, Error *local_err)
 {
     if (local_err && dst_err == &error_abort) {
-        error_report("%s", error_get_pretty(local_err));
+        fprintf(stderr, "%s", error_get_pretty(local_err));
         abort();
     } else if (dst_err && !*dst_err) {
         *dst_err = local_err;

  reply	other threads:[~2014-01-14 18:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 22:03 [Qemu-devel] [PULL 00/14] QMP queue Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 01/14] vl: add missing transition debug->finish_migrate Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 02/14] qemu-monitor: HMP cpu-add wrapper Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 03/14] rng: initialize file descriptor to -1 Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 04/14] qom: fix leak for objects created with -object Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 05/14] qom: catch errors in object_property_add_child Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 06/14] monitor: add object-del (QMP) and object_del (HMP) command Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 07/14] monitor: add object-add (QMP) and object_add " Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 08/14] error: Add error_abort Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 09/14] qdev: Delete dead code Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 10/14] hw: Remove assert_no_error usages Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 11/14] target-i386: Remove assert_no_error usage Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 12/14] qemu-option: Remove qemu_opts_create_nofail Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 13/14] qerror: Remove assert_no_error() Luiz Capitulino
2014-01-06 22:03 ` [Qemu-devel] [PULL 14/14] migration: qmp_migrate(): keep working after syntax error Luiz Capitulino
2014-01-06 22:41 ` [Qemu-devel] [PULL 00/14] QMP queue Peter Maydell
2014-01-13 23:27 ` Peter Crosthwaite
2014-01-14  3:38   ` Edgar E. Iglesias
2014-01-14 16:44     ` Kevin Wolf
2014-01-14 18:22       ` Luiz Capitulino [this message]
2014-01-14 22:26         ` [Qemu-devel] Fix make check breakage (was [PULL 00/14] QMP queue) Peter Crosthwaite
2014-01-15  0:30           ` Peter Crosthwaite
2014-01-15  9:55         ` Markus Armbruster
2014-01-15 12:27           ` Peter Crosthwaite
2014-01-15 13:52             ` Markus Armbruster

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=20140114132248.3f0be1dd@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=anthony@codemonkey.ws \
    --cc=edgar.iglesias@xilinx.com \
    --cc=kwolf@redhat.com \
    --cc=peter.crosthwaite@xilinx.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).