All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair.francis@xilinx.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Alistair Francis <alistair.francis@xilinx.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 5/5] Convert single line fprintf() to warn_report()
Date: Mon, 14 Aug 2017 12:00:33 -0700	[thread overview]
Message-ID: <CAKmqyKPA6v3RpZAFOibfNeOZVzai5phfXo2njDkD6PxsBgqVrw@mail.gmail.com> (raw)
In-Reply-To: <87valqw9x0.fsf@dusky.pond.sub.org>

On Mon, Aug 14, 2017 at 6:34 AM, Markus Armbruster <armbru@redhat.com> wrote:
> PATCH 3/5 has the exact same subject.  Why are the two separate?

You are right, that is a mess.

This one doesn't check for newlines at the end while the earlier one
checked for and removed new lines.

>
> Alistair Francis <alistair.francis@xilinx.com> writes:
>
>> Convert any remaining uses of fprintf(stderr, "warning:"...
>> to use warn_report() instead. This helps standardise on a single
>> method of printing warnings to the user.
>>
>> All of the warnings were changed using this command:
>>   find ./* -type f -exec sed -i 's|fprintf(.*".*warning[,:] |warn_report("|Ig' {} +
>>
>> The #include lines and chagnes to the test Makefile were manually
>
> changes

Fixed.

>
>> updated to allow the code to compile.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>> ---
>>
>>  tests/Makefile.include | 4 ++--
>>  util/cutils.c          | 3 ++-
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index 7af278db55..4886caf565 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -560,8 +560,8 @@ tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y)
>>  tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y)
>>  tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y)
>>  tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o
>> -tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-util-obj-y)
>> -tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
>> +tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-qom-obj-y)
>> +tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-qom-obj-y)
>
> No.  What symbols exactly is the linker missing?

Without the change, this is the error I see when running make check:

  CC      tests/test-x86-cpuid.o
  LINK    tests/test-x86-cpuid
  GTESTER tests/test-x86-cpuid
  CC      tests/test-xbzrle.o
  LINK    tests/test-xbzrle
libqemustub.a(monitor.o): In function `monitor_get_fd':
/scratch/alistai/master-qemu/stubs/monitor.c:10: undefined reference
to `error_setg_internal'
collect2: error: ld returned 1 exit status
/scratch/alistai/master-qemu/rules.mak:121: recipe for target
'tests/test-xbzrle' failed
make: *** [tests/test-xbzrle] Error 1

If only the xbzrle change is made then I see this:

  LINK    tests/test-xbzrle
  GTESTER tests/test-xbzrle
  CC      tests/test-vmstate.o
  LINK    tests/test-vmstate
  GTESTER tests/test-vmstate
  CC      tests/test-cutils.o
  LINK    tests/test-cutils
util/cutils.o: In function `parse_debug_env':
/scratch/alistai/master-qemu/util/cutils.c:605: undefined reference to
`warn_report'
collect2: error: ld returned 1 exit status
/scratch/alistai/master-qemu/rules.mak:121: recipe for target
'tests/test-cutils' failed
make: *** [tests/test-cutils] Error 1

Thanks,
Alistair


>
>>  tests/test-int128$(EXESUF): tests/test-int128.o
>>  tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
>>  tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
>> diff --git a/util/cutils.c b/util/cutils.c
>> index 1534682083..b33ede83d1 100644
>> --- a/util/cutils.c
>> +++ b/util/cutils.c
>> @@ -30,6 +30,7 @@
>>  #include "qemu/iov.h"
>>  #include "net/net.h"
>>  #include "qemu/cutils.h"
>> +#include "qemu/error-report.h"
>>
>>  void strpadcpy(char *buf, int buf_size, const char *str, char pad)
>>  {
>> @@ -601,7 +602,7 @@ int parse_debug_env(const char *name, int max, int initial)
>>          return initial;
>>      }
>>      if (debug < 0 || debug > max || errno != 0) {
>> -        fprintf(stderr, "warning: %s not in [0, %d]", name, max);
>> +        warn_report("%s not in [0, %d]", name, max);
>>          return initial;
>>      }
>>      return debug;

  reply	other threads:[~2017-08-14 19:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 22:14 [Qemu-devel] [PATCH v2 0/5] More warning reporting fixed Alistair Francis
2017-07-28 22:16 ` [Qemu-devel] [PATCH v2 1/5] hw/i386: Improve some of the warning messages Alistair Francis
2017-07-28 22:16 ` [Qemu-devel] [PATCH v2 2/5] Convert remaining error_report() to warn_report() Alistair Francis
2017-07-28 22:16 ` [Qemu-devel] [PATCH v2 3/5] Convert single line fprintf() " Alistair Francis
2017-08-14 12:58   ` Markus Armbruster
2017-07-28 22:16 ` [Qemu-devel] [PATCH v2 4/5] Convert multi-line " Alistair Francis
2017-08-14 13:30   ` Markus Armbruster
2017-08-14 18:48     ` Alistair Francis
2017-08-15  5:41       ` Markus Armbruster
2017-08-14 20:16   ` Philippe Mathieu-Daudé
2017-07-28 22:16 ` [Qemu-devel] [PATCH v2 5/5] Convert single line " Alistair Francis
2017-07-28 23:57   ` Philippe Mathieu-Daudé
2017-08-03 15:43     ` Alistair Francis
2017-08-14 13:34   ` Markus Armbruster
2017-08-14 19:00     ` Alistair Francis [this message]
2017-08-15  7:30       ` Markus Armbruster
2017-08-17 14:35         ` Paolo Bonzini
2017-08-17 17:02           ` Markus Armbruster
2017-08-17 17:55             ` Alistair Francis
2017-08-17 19:31               ` Philippe Mathieu-Daudé
2017-08-18  5:32                 ` Markus Armbruster
2017-08-18 17:09                   ` Alistair Francis
2017-08-18 17:33                   ` Philippe Mathieu-Daudé
2017-08-17 19:17             ` Philippe Mathieu-Daudé
2017-07-28 22:20 ` [Qemu-devel] [PATCH v2 0/5] More warning reporting fixed Alistair Francis
2017-07-28 22:37 ` no-reply
2017-07-28 23:01   ` Alistair Francis

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=CAKmqyKPA6v3RpZAFOibfNeOZVzai5phfXo2njDkD6PxsBgqVrw@mail.gmail.com \
    --to=alistair.francis@xilinx.com \
    --cc=armbru@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.