* [PATCH] numa: Add missing \n to error message
@ 2019-11-06 12:46 Greg Kurz
2019-11-06 12:55 ` Greg Kurz
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Greg Kurz @ 2019-11-06 12:46 UTC (permalink / raw)
To: Eduardo Habkost; +Cc: Marcel Apfelbaum, qemu-trivial, qemu-devel
If memory allocation fails when using -mem-path, QEMU is supposed to print
out a message to indicate that fallback to anonymous RAM is deprecated. This
is done with error_printf() which does output buffering. As a consequence,
the message is only printed at the next flush, eg. when quiting QEMU, and
it also lacks a trailing newline:
qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
qemu-system-ppc64: warning: falling back to regular RAM allocation
QEMU 4.1.50 monitor - type 'help' for more information
(qemu) q
This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
Add the missing \n to fix both issues.
Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
Signed-off-by: Greg Kurz <groug@kaod.org>
---
hw/core/numa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 038c96d4abc6..e3332a984f7c 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
warn_report("falling back to regular RAM allocation");
error_printf("This is deprecated. Make sure that -mem-path "
" specified path has sufficient resources to allocate"
- " -m specified RAM amount");
+ " -m specified RAM amount\n");
/* Legacy behavior: if allocation failed, fall back to
* regular RAM allocation.
*/
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 12:46 [PATCH] numa: Add missing \n to error message Greg Kurz
@ 2019-11-06 12:55 ` Greg Kurz
2019-11-06 13:01 ` Laurent Vivier
2019-11-12 9:34 ` Laurent Vivier
2 siblings, 0 replies; 9+ messages in thread
From: Greg Kurz @ 2019-11-06 12:55 UTC (permalink / raw)
To: Eduardo Habkost; +Cc: qemu-trivial, qemu-devel
Oops I hadn't realized that Marcel had a new e-mail address... since last
year :-\ Sorry for the noise.
On Wed, 06 Nov 2019 13:46:40 +0100
Greg Kurz <groug@kaod.org> wrote:
> If memory allocation fails when using -mem-path, QEMU is supposed to print
> out a message to indicate that fallback to anonymous RAM is deprecated. This
> is done with error_printf() which does output buffering. As a consequence,
> the message is only printed at the next flush, eg. when quiting QEMU, and
> it also lacks a trailing newline:
>
> qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
> qemu-system-ppc64: warning: falling back to regular RAM allocation
> QEMU 4.1.50 monitor - type 'help' for more information
> (qemu) q
> This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
>
> Add the missing \n to fix both issues.
>
> Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> hw/core/numa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/numa.c b/hw/core/numa.c
> index 038c96d4abc6..e3332a984f7c 100644
> --- a/hw/core/numa.c
> +++ b/hw/core/numa.c
> @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
> warn_report("falling back to regular RAM allocation");
> error_printf("This is deprecated. Make sure that -mem-path "
> " specified path has sufficient resources to allocate"
> - " -m specified RAM amount");
> + " -m specified RAM amount\n");
> /* Legacy behavior: if allocation failed, fall back to
> * regular RAM allocation.
> */
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 12:46 [PATCH] numa: Add missing \n to error message Greg Kurz
2019-11-06 12:55 ` Greg Kurz
@ 2019-11-06 13:01 ` Laurent Vivier
2019-11-06 14:12 ` Greg Kurz
2019-11-12 9:34 ` Laurent Vivier
2 siblings, 1 reply; 9+ messages in thread
From: Laurent Vivier @ 2019-11-06 13:01 UTC (permalink / raw)
To: Greg Kurz, Eduardo Habkost
Cc: Marcel Apfelbaum, qemu-trivial, qemu-devel, Markus Armbruster,
Igor Mammedov
Le 06/11/2019 à 13:46, Greg Kurz a écrit :
> If memory allocation fails when using -mem-path, QEMU is supposed to print
> out a message to indicate that fallback to anonymous RAM is deprecated. This
> is done with error_printf() which does output buffering. As a consequence,
> the message is only printed at the next flush, eg. when quiting QEMU, and
> it also lacks a trailing newline:
>
> qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
> qemu-system-ppc64: warning: falling back to regular RAM allocation
> QEMU 4.1.50 monitor - type 'help' for more information
> (qemu) q
> This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
>
> Add the missing \n to fix both issues.
>
> Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> hw/core/numa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/numa.c b/hw/core/numa.c
> index 038c96d4abc6..e3332a984f7c 100644
> --- a/hw/core/numa.c
> +++ b/hw/core/numa.c
> @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
> warn_report("falling back to regular RAM allocation");
> error_printf("This is deprecated. Make sure that -mem-path "
> " specified path has sufficient resources to allocate"
> - " -m specified RAM amount");
> + " -m specified RAM amount\n");
> /* Legacy behavior: if allocation failed, fall back to
> * regular RAM allocation.
> */
>
>
Why is this an error_printf() and not an error_report()?
Thanks,
Laurent
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 13:01 ` Laurent Vivier
@ 2019-11-06 14:12 ` Greg Kurz
2019-11-06 14:20 ` Laurent Vivier
2019-11-06 16:55 ` Markus Armbruster
0 siblings, 2 replies; 9+ messages in thread
From: Greg Kurz @ 2019-11-06 14:12 UTC (permalink / raw)
To: Laurent Vivier
Cc: Eduardo Habkost, qemu-trivial, Markus Armbruster, qemu-devel,
Igor Mammedov
On Wed, 6 Nov 2019 14:01:01 +0100
Laurent Vivier <laurent@vivier.eu> wrote:
> Le 06/11/2019 à 13:46, Greg Kurz a écrit :
> > If memory allocation fails when using -mem-path, QEMU is supposed to print
> > out a message to indicate that fallback to anonymous RAM is deprecated. This
> > is done with error_printf() which does output buffering. As a consequence,
> > the message is only printed at the next flush, eg. when quiting QEMU, and
> > it also lacks a trailing newline:
> >
> > qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
> > qemu-system-ppc64: warning: falling back to regular RAM allocation
> > QEMU 4.1.50 monitor - type 'help' for more information
> > (qemu) q
> > This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
> >
> > Add the missing \n to fix both issues.
> >
> > Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> > hw/core/numa.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/hw/core/numa.c b/hw/core/numa.c
> > index 038c96d4abc6..e3332a984f7c 100644
> > --- a/hw/core/numa.c
> > +++ b/hw/core/numa.c
> > @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
> > warn_report("falling back to regular RAM allocation");
> > error_printf("This is deprecated. Make sure that -mem-path "
> > " specified path has sufficient resources to allocate"
> > - " -m specified RAM amount");
> > + " -m specified RAM amount\n");
> > /* Legacy behavior: if allocation failed, fall back to
> > * regular RAM allocation.
> > */
> >
> >
>
> Why is this an error_printf() and not an error_report()?
>
Because CODING_STYLE suggests to do so I guess:
Reporting errors to the human user
----------------------------------
Do not use printf(), fprintf() or monitor_printf(). Instead, use
error_report() or error_vreport() from error-report.h. This ensures the
error is reported in the right place (current monitor or stderr), and in
a uniform format.
Use error_printf() & friends to print additional information. <===
error_report() prints the current location. In certain common cases
like command line parsing, the current location is tracked
automatically. To manipulate it manually, use the loc_``*``() from
error-report.h.
> Thanks,
> Laurent
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 14:12 ` Greg Kurz
@ 2019-11-06 14:20 ` Laurent Vivier
2019-11-06 14:35 ` Philippe Mathieu-Daudé
2019-11-06 16:55 ` Markus Armbruster
1 sibling, 1 reply; 9+ messages in thread
From: Laurent Vivier @ 2019-11-06 14:20 UTC (permalink / raw)
To: Greg Kurz
Cc: Eduardo Habkost, qemu-trivial, qemu-devel, Markus Armbruster,
Igor Mammedov
Le 06/11/2019 à 15:12, Greg Kurz a écrit :
> On Wed, 6 Nov 2019 14:01:01 +0100
> Laurent Vivier <laurent@vivier.eu> wrote:
>
>> Le 06/11/2019 à 13:46, Greg Kurz a écrit :
>>> If memory allocation fails when using -mem-path, QEMU is supposed to print
>>> out a message to indicate that fallback to anonymous RAM is deprecated. This
>>> is done with error_printf() which does output buffering. As a consequence,
>>> the message is only printed at the next flush, eg. when quiting QEMU, and
>>> it also lacks a trailing newline:
>>>
>>> qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
>>> qemu-system-ppc64: warning: falling back to regular RAM allocation
>>> QEMU 4.1.50 monitor - type 'help' for more information
>>> (qemu) q
>>> This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
>>>
>>> Add the missing \n to fix both issues.
>>>
>>> Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
>>> Signed-off-by: Greg Kurz <groug@kaod.org>
>>> ---
>>> hw/core/numa.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/core/numa.c b/hw/core/numa.c
>>> index 038c96d4abc6..e3332a984f7c 100644
>>> --- a/hw/core/numa.c
>>> +++ b/hw/core/numa.c
>>> @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
>>> warn_report("falling back to regular RAM allocation");
>>> error_printf("This is deprecated. Make sure that -mem-path "
>>> " specified path has sufficient resources to allocate"
>>> - " -m specified RAM amount");
>>> + " -m specified RAM amount\n");
>>> /* Legacy behavior: if allocation failed, fall back to
>>> * regular RAM allocation.
>>> */
>>>
>>>
>>
>> Why is this an error_printf() and not an error_report()?
>>
>
> Because CODING_STYLE suggests to do so I guess:
>
> Reporting errors to the human user
> ----------------------------------
>
> Do not use printf(), fprintf() or monitor_printf(). Instead, use
> error_report() or error_vreport() from error-report.h. This ensures the
> error is reported in the right place (current monitor or stderr), and in
> a uniform format.
>
> Use error_printf() & friends to print additional information. <===
>
> error_report() prints the current location. In certain common cases
> like command line parsing, the current location is tracked
> automatically. To manipulate it manually, use the loc_``*``() from
> error-report.h.
So I guess it's to not report the current location and the binary name .
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 14:20 ` Laurent Vivier
@ 2019-11-06 14:35 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-11-06 14:35 UTC (permalink / raw)
To: Laurent Vivier, Greg Kurz
Cc: qemu-trivial, Markus Armbruster, Igor Mammedov, Eduardo Habkost,
qemu-devel
On 11/6/19 3:20 PM, Laurent Vivier wrote:
> Le 06/11/2019 à 15:12, Greg Kurz a écrit :
>> On Wed, 6 Nov 2019 14:01:01 +0100
>> Laurent Vivier <laurent@vivier.eu> wrote:
>>
>>> Le 06/11/2019 à 13:46, Greg Kurz a écrit :
>>>> If memory allocation fails when using -mem-path, QEMU is supposed to print
>>>> out a message to indicate that fallback to anonymous RAM is deprecated. This
>>>> is done with error_printf() which does output buffering. As a consequence,
>>>> the message is only printed at the next flush, eg. when quiting QEMU, and
>>>> it also lacks a trailing newline:
>>>>
>>>> qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
>>>> qemu-system-ppc64: warning: falling back to regular RAM allocation
>>>> QEMU 4.1.50 monitor - type 'help' for more information
>>>> (qemu) q
>>>> This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
>>>>
>>>> Add the missing \n to fix both issues.
>>>>
>>>> Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
>>>> Signed-off-by: Greg Kurz <groug@kaod.org>
>>>> ---
>>>> hw/core/numa.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/hw/core/numa.c b/hw/core/numa.c
>>>> index 038c96d4abc6..e3332a984f7c 100644
>>>> --- a/hw/core/numa.c
>>>> +++ b/hw/core/numa.c
>>>> @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
>>>> warn_report("falling back to regular RAM allocation");
>>>> error_printf("This is deprecated. Make sure that -mem-path "
>>>> " specified path has sufficient resources to allocate"
>>>> - " -m specified RAM amount");
>>>> + " -m specified RAM amount\n");
>>>> /* Legacy behavior: if allocation failed, fall back to
>>>> * regular RAM allocation.
>>>> */
>>>>
>>>>
>>>
>>> Why is this an error_printf() and not an error_report()?
>>>
>>
>> Because CODING_STYLE suggests to do so I guess:
>>
>> Reporting errors to the human user
>> ----------------------------------
>>
>> Do not use printf(), fprintf() or monitor_printf(). Instead, use
>> error_report() or error_vreport() from error-report.h. This ensures the
>> error is reported in the right place (current monitor or stderr), and in
>> a uniform format.
>>
>> Use error_printf() & friends to print additional information. <===
>>
>> error_report() prints the current location. In certain common cases
>> like command line parsing, the current location is tracked
>> automatically. To manipulate it manually, use the loc_``*``() from
>> error-report.h.
>
> So I guess it's to not report the current location and the binary name .
>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 14:12 ` Greg Kurz
2019-11-06 14:20 ` Laurent Vivier
@ 2019-11-06 16:55 ` Markus Armbruster
2019-11-06 17:04 ` Laurent Vivier
1 sibling, 1 reply; 9+ messages in thread
From: Markus Armbruster @ 2019-11-06 16:55 UTC (permalink / raw)
To: Greg Kurz
Cc: qemu-trivial, Igor Mammedov, qemu-devel, Laurent Vivier, Eduardo Habkost
Greg Kurz <groug@kaod.org> writes:
> On Wed, 6 Nov 2019 14:01:01 +0100
> Laurent Vivier <laurent@vivier.eu> wrote:
>
>> Le 06/11/2019 à 13:46, Greg Kurz a écrit :
>> > If memory allocation fails when using -mem-path, QEMU is supposed to print
>> > out a message to indicate that fallback to anonymous RAM is deprecated. This
>> > is done with error_printf() which does output buffering. As a consequence,
>> > the message is only printed at the next flush, eg. when quiting QEMU, and
>> > it also lacks a trailing newline:
>> >
>> > qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
>> > qemu-system-ppc64: warning: falling back to regular RAM allocation
>> > QEMU 4.1.50 monitor - type 'help' for more information
>> > (qemu) q
>> > This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
>> >
>> > Add the missing \n to fix both issues.
>> >
>> > Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
>> > Signed-off-by: Greg Kurz <groug@kaod.org>
>> > ---
>> > hw/core/numa.c | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/hw/core/numa.c b/hw/core/numa.c
>> > index 038c96d4abc6..e3332a984f7c 100644
>> > --- a/hw/core/numa.c
>> > +++ b/hw/core/numa.c
>> > @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
>> > warn_report("falling back to regular RAM allocation");
>> > error_printf("This is deprecated. Make sure that -mem-path "
>> > " specified path has sufficient resources to allocate"
>> > - " -m specified RAM amount");
>> > + " -m specified RAM amount\n");
>> > /* Legacy behavior: if allocation failed, fall back to
>> > * regular RAM allocation.
>> > */
>> >
>> >
>>
>> Why is this an error_printf() and not an error_report()?
>>
>
> Because CODING_STYLE suggests to do so I guess:
>
> Reporting errors to the human user
> ----------------------------------
>
> Do not use printf(), fprintf() or monitor_printf(). Instead, use
> error_report() or error_vreport() from error-report.h. This ensures the
> error is reported in the right place (current monitor or stderr), and in
> a uniform format.
>
> Use error_printf() & friends to print additional information. <===
You're right.
Since I have nothing queued up right now, I'd prefer to have this go via
qemu-trivial.
> error_report() prints the current location. In certain common cases
> like command line parsing, the current location is tracked
> automatically. To manipulate it manually, use the loc_``*``() from
> error-report.h.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 16:55 ` Markus Armbruster
@ 2019-11-06 17:04 ` Laurent Vivier
0 siblings, 0 replies; 9+ messages in thread
From: Laurent Vivier @ 2019-11-06 17:04 UTC (permalink / raw)
To: Markus Armbruster, Greg Kurz
Cc: qemu-trivial, Igor Mammedov, Eduardo Habkost, qemu-devel
Le 06/11/2019 à 17:55, Markus Armbruster a écrit :
> Greg Kurz <groug@kaod.org> writes:
>
>> On Wed, 6 Nov 2019 14:01:01 +0100
>> Laurent Vivier <laurent@vivier.eu> wrote:
>>
>>> Le 06/11/2019 à 13:46, Greg Kurz a écrit :
>>>> If memory allocation fails when using -mem-path, QEMU is supposed to print
>>>> out a message to indicate that fallback to anonymous RAM is deprecated. This
>>>> is done with error_printf() which does output buffering. As a consequence,
>>>> the message is only printed at the next flush, eg. when quiting QEMU, and
>>>> it also lacks a trailing newline:
>>>>
>>>> qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
>>>> qemu-system-ppc64: warning: falling back to regular RAM allocation
>>>> QEMU 4.1.50 monitor - type 'help' for more information
>>>> (qemu) q
>>>> This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
>>>>
>>>> Add the missing \n to fix both issues.
>>>>
>>>> Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
>>>> Signed-off-by: Greg Kurz <groug@kaod.org>
>>>> ---
>>>> hw/core/numa.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/hw/core/numa.c b/hw/core/numa.c
>>>> index 038c96d4abc6..e3332a984f7c 100644
>>>> --- a/hw/core/numa.c
>>>> +++ b/hw/core/numa.c
>>>> @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
>>>> warn_report("falling back to regular RAM allocation");
>>>> error_printf("This is deprecated. Make sure that -mem-path "
>>>> " specified path has sufficient resources to allocate"
>>>> - " -m specified RAM amount");
>>>> + " -m specified RAM amount\n");
>>>> /* Legacy behavior: if allocation failed, fall back to
>>>> * regular RAM allocation.
>>>> */
>>>>
>>>>
>>>
>>> Why is this an error_printf() and not an error_report()?
>>>
>>
>> Because CODING_STYLE suggests to do so I guess:
>>
>> Reporting errors to the human user
>> ----------------------------------
>>
>> Do not use printf(), fprintf() or monitor_printf(). Instead, use
>> error_report() or error_vreport() from error-report.h. This ensures the
>> error is reported in the right place (current monitor or stderr), and in
>> a uniform format.
>>
>> Use error_printf() & friends to print additional information. <===
>
> You're right.
>
> Since I have nothing queued up right now, I'd prefer to have this go via
> qemu-trivial.
Ok, I will take it in my next qemu-trivial pull request (with the other
Greg's patch).
Thanks,
Laurent
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] numa: Add missing \n to error message
2019-11-06 12:46 [PATCH] numa: Add missing \n to error message Greg Kurz
2019-11-06 12:55 ` Greg Kurz
2019-11-06 13:01 ` Laurent Vivier
@ 2019-11-12 9:34 ` Laurent Vivier
2 siblings, 0 replies; 9+ messages in thread
From: Laurent Vivier @ 2019-11-12 9:34 UTC (permalink / raw)
To: Greg Kurz, Eduardo Habkost; +Cc: Marcel Apfelbaum, qemu-trivial, qemu-devel
Le 06/11/2019 à 13:46, Greg Kurz a écrit :
> If memory allocation fails when using -mem-path, QEMU is supposed to print
> out a message to indicate that fallback to anonymous RAM is deprecated. This
> is done with error_printf() which does output buffering. As a consequence,
> the message is only printed at the next flush, eg. when quiting QEMU, and
> it also lacks a trailing newline:
>
> qemu-system-ppc64: unable to map backing store for guest RAM: Cannot allocate memory
> qemu-system-ppc64: warning: falling back to regular RAM allocation
> QEMU 4.1.50 monitor - type 'help' for more information
> (qemu) q
> This is deprecated. Make sure that -mem-path specified path has sufficient resources to allocate -m specified RAM amountgreg@boss02:~/Work/qemu/qemu-spapr$
>
> Add the missing \n to fix both issues.
>
> Fixes: cb79224b7e4b "deprecate -mem-path fallback to anonymous RAM"
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> hw/core/numa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/numa.c b/hw/core/numa.c
> index 038c96d4abc6..e3332a984f7c 100644
> --- a/hw/core/numa.c
> +++ b/hw/core/numa.c
> @@ -503,7 +503,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
> warn_report("falling back to regular RAM allocation");
> error_printf("This is deprecated. Make sure that -mem-path "
> " specified path has sufficient resources to allocate"
> - " -m specified RAM amount");
> + " -m specified RAM amount\n");
> /* Legacy behavior: if allocation failed, fall back to
> * regular RAM allocation.
> */
>
>
Applied to my trivial-patches branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-11-12 9:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 12:46 [PATCH] numa: Add missing \n to error message Greg Kurz
2019-11-06 12:55 ` Greg Kurz
2019-11-06 13:01 ` Laurent Vivier
2019-11-06 14:12 ` Greg Kurz
2019-11-06 14:20 ` Laurent Vivier
2019-11-06 14:35 ` Philippe Mathieu-Daudé
2019-11-06 16:55 ` Markus Armbruster
2019-11-06 17:04 ` Laurent Vivier
2019-11-12 9:34 ` Laurent Vivier
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).