qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 5/5] Convert single line fprintf() to warn_re


From: Alistair Francis
Subject: Re: [Qemu-devel] [PATCH v2 5/5] Convert single line fprintf() to warn_report()
Date: Thu, 3 Aug 2017 08:43:55 -0700

On Fri, Jul 28, 2017 at 4:57 PM, Philippe Mathieu-Daudé <address@hidden> wrote:
> Hi Alistair,
>
> On 07/28/2017 07:16 PM, Alistair Francis wrote:
>>
>> 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
>> updated to allow the code to compile.
>>
>> Signed-off-by: Alistair Francis <address@hidden>
>> ---
>>
>>   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-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o
>> migration/page_cache.o $(test-qom-obj-y)
>
>
> I don't understand what was not working in the previous line.
>
>> -tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
>> +tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o
>> $(test-qom-obj-y)
>
>
> Here adding $(util-obj-y) should be enough.
>
> But I did not test it :P

I didn't understand it either. It is possible I was doing something
really wrong, but I couldn't get it to work otherwise.

Thanks,
Alistair

>
> Regards,
>
> Phil.
>
>
>>   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 via email to

[Prev in Thread] Current Thread [Next in Thread]