diff mbox

[2/9] qemu-log: fix cpu_reset log target

Message ID 1457954501-26528-3-git-send-email-den@openvz.org (mailing list archive)
State New, archived
Headers show

Commit Message

Denis V. Lunev March 14, 2016, 11:21 a.m. UTC
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Do not print superfluous zero cpu state on vm start with -d cpu_reset

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
---
 qom/cpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Paolo Bonzini March 14, 2016, 2:24 p.m. UTC | #1
On 14/03/2016 12:21, Denis V. Lunev wrote:
> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> 
> Do not print superfluous zero cpu state on vm start with -d cpu_reset

It's really just the very first reset that is all zeroes.  If you
use "-S", you can be in prelaunch state and have a meaningful state.

Overall I'm not sure that this patch provides a big benefit, but
I'll defer to Andreas and others that may want to chime in.

Paolo


> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Stefan Hajnoczi <stefanha@redhat.com>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Andreas Färber <afaerber@suse.de>
> ---
>  qom/cpu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/qom/cpu.c b/qom/cpu.c
> index c45d0bb..69e3b87 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -247,7 +247,8 @@ static void cpu_common_reset(CPUState *cpu)
>  {
>      CPUClass *cc = CPU_GET_CLASS(cpu);
>  
> -    if (qemu_loglevel_mask(CPU_LOG_RESET)) {
> +    if (qemu_loglevel_mask(CPU_LOG_RESET) &&
> +            !runstate_check(RUN_STATE_PRELAUNCH)) {
>          qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index);
>          log_cpu_state(cpu, cc->reset_dump_flags);
>      }
>
diff mbox

Patch

diff --git a/qom/cpu.c b/qom/cpu.c
index c45d0bb..69e3b87 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -247,7 +247,8 @@  static void cpu_common_reset(CPUState *cpu)
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
 
-    if (qemu_loglevel_mask(CPU_LOG_RESET)) {
+    if (qemu_loglevel_mask(CPU_LOG_RESET) &&
+            !runstate_check(RUN_STATE_PRELAUNCH)) {
         qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index);
         log_cpu_state(cpu, cc->reset_dump_flags);
     }