qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements


From: Pavel Butsykin
Subject: Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements
Date: Thu, 15 Oct 2015 18:18:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0



On 15.10.2015 17:49, Kashyap Chamarthy wrote:
On Thu, Oct 15, 2015 at 10:30:21AM +0300, Denis V. Lunev wrote:
The following is done:
- QMP/HMP events are now logged

I applied this patch series locally, and tried to test it the below way:

Launch a minimal QEMU instance:

   $ /home/kashyapc/build/build-qemu-upstream/x86_64-softmmu/qemu-system-x86_64 
\
    -nographic                      \
    -nodefconfig                    \
    -nodefaults                     \
    -m 2048                         \
    -cpu SandyBridge                \
    -device virtio-scsi-pci,id=scsi \
    -device virtio-serial-pci       \
    -drive file=./cirros.qcow2,if=virtio,cache=writeback \
    -serial stdio \
    -D ./output-of-qemu.txt \
    -qmp unix:./qmp-sock,server

And, issued QMP commands via `qmp-shell`:

   $ ./qmp-shell /export/qmp-sock
   Welcome to the QMP low-level shell!
   Connected to QEMU 2.4.50
   (QEMU)
   (QEMU) query-status
   {"return": {"status": "running", "singlestep": false, "running": true}}
   (QEMU)
   (QEMU) blockdev-snapshot-internal-sync device=virtio0 name=snapshot1
   {"return": {}}

As we can see, the QMP commands gets successfully invoked, but nothing
gets logged to the output-of-qemu.txt file.  Maybe because everything is
logged onto my stdout of qmp-shell?

A couple of related questions:

   - Is the way I supplied '-D' option correct?  If so, why the
     output-of-qemu.txt file does not get created?  _Should_ it?

   - If I `touch output-of-qemu.txt`, then re-try issuing QMP commmands
     from 'qmp-shell', still, nothing gets logged to it.  Probably
     because only stderr is supposed to get logged to '-D logfile'?

Do I have to turn on any other special knob to take advantage of
LOG_CMD/LOG_TIME flags mentioned in your patch[1]?

I'm pretty sure I'm missing something. . .

[1] http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg03316.html

- timestamp is added to the log message
- arguments of qemu_log/qemu_log_mask are not calculated now if the log
   is disabled

These patches are sent in the hope that it is not too late for QEMU 2.5.

Logging subsystem in QEMU looks rudimentary to me and should be definitely
improved, f.e. log on stalled NFS could ruin the system completely. Anyway,
it is too late for this at the moment.

Signed-off-by: Denis V. Lunev <address@hidden>
CC: Pavel Butsykin <address@hidden>
CC: Markus Armbruster <address@hidden>
CC: Luiz Capitulino <address@hidden>
CC: Eric Blake <address@hidden>
CC: Peter Maydell <address@hidden>




You forgot to specify the mask: -d cmd,time

qemu$ qemu-system-x86_64 -h|grep log
...
-d item1,... enable logging of specified items (use '-d help' for a list of log items)
-D logfile      output log to logfile (default stderr)

So it should work:
$ /home/kashyapc/build/build-qemu-upstream/x86_64-softmmu/qemu-system-x86_64 \
     -nographic                      \
     -nodefconfig                    \
     -nodefaults                     \
     -m 2048                         \
     -cpu SandyBridge                \
     -device virtio-scsi-pci,id=scsi \
     -device virtio-serial-pci       \
     -drive file=./cirros.qcow2,if=virtio,cache=writeback \
     -serial stdio \
     -D ./output-of-qemu.txt \
     -d cmd,time \
     -qmp unix:./qmp-sock,server




reply via email to

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