qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-discuss] How to get qemu log?


From: Peter Maydell
Subject: Re: [Qemu-devel] [Qemu-discuss] How to get qemu log?
Date: Mon, 14 Aug 2017 07:57:32 +0100

On 14 August 2017 at 07:26, Sam <address@hidden> wrote:
> Hi all,
>
> I add some log like this in QEMU_SRC/hw/i386/pc.c
>
> +++ b/hw/i386/pc.c
>>
>> @@ -1364,6 +1364,13 @@ void pc_memory_init(PCMachineState *pcms,
>>
>>
>>>      linux_boot = (machine->kernel_filename != NULL);
>>
>>
>>> +    /* add for qemu start speed */
>>
>> +    time_t rawtime;
>>
>> +    struct tm * timeinfo;
>>
>> +    time ( &rawtime );
>>
>> +    timeinfo = localtime ( &rawtime );
>>
>> +    error_printf_unless_qmp("jpc_memory_init begin --
>>> %s\n",asctime(timeinfo));
>>
>> +
>>
>>
> Then I use `QEMU -D /qemu.log ...` command to start a vm, but I have seen
> nothing in /qemu.log, I don't know why, and how to show my log while
> starting qemu?

You haven't called a function that adds a message to the -d/-D
qemu.log logging -- those are the ones declared in include/qemu/log.h.

The function you have called is for printing error messages,
which will be displayed to the QEMU monitor prompt if they
were provoked by a monitor command, otherwise to stderr.
It's not intended for general debug/progress logging.

thanks
-- PMM



reply via email to

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