All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kashyap Chamarthy <kchamart@redhat.com>
To: Pavel Butsykin <pbutsykin@odin.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Pavel Butsykin <pbutsykin@virtuozzo.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>
Subject: Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements
Date: Thu, 15 Oct 2015 18:02:30 +0200	[thread overview]
Message-ID: <20151015160230.GA24087@tesla.redhat.com> (raw)
In-Reply-To: <561FC3C7.9090906@odin.com>

On Thu, Oct 15, 2015 at 06:18:31PM +0300, Pavel Butsykin wrote:
> 
> 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": {}}

[. . .]

> 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)

Ah, my bad.  Thanks for pointing it out, Pavel.

> -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
> 

Yep, '-d cmd,time' perfectly logs the QMP requests/response, on stdio,
when I invoke QMP commands from a different shell:


    $ ./qemu-system-x86_64 \
    [. . .]
    2015-10-15 17:38:58.474 qmp request:
    {
        "execute": "blockdev-snapshot-internal-sync",
        "arguments": {
            "name": "snapshot2",
            "device": "virtio0"
        }
    }
    2015-10-15 17:38:58.488 qmp response:
    {
        "return": {
        }
    }
    2015-10-15 17:39:25.743 qmp request:
    {
        "execute": "quit",
        "arguments": {
        }
    }
    2015-10-15 17:39:25.743 qmp response:
    {
        "return": {
        }
    }
    2015-10-15 17:39:25.744 qmp event:
    {
        "timestamp": {
            "seconds": 1444923565,
            "microseconds": 744211
        },
        "event": "SHUTDOWN"
    }


    * * *

Also, Stefan Hajnoczi pointed out on IRC that: "-D is mainly a TCG
thing.  There are plenty of fprintf(stderr) calls in QEMU".  So, the
stderr might not be affected by it.


-- 
/kashyap

  reply	other threads:[~2015-10-15 16:02 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15  7:30 [Qemu-devel] [PATCH 0/3] QEMU logging improvements Denis V. Lunev
2015-10-15  7:30 ` [Qemu-devel] [PATCH 1/3] log: improve performance of qemu_log and qemu_log_mask if disabled Denis V. Lunev
2015-10-15 17:23   ` Alex Bennée
2015-10-15 17:40     ` Denis V. Lunev
2015-10-15 18:36       ` Alex Bennée
2015-10-16  7:17   ` Markus Armbruster
2015-10-16  7:45     ` Denis V. Lunev
2015-10-16 11:02       ` Markus Armbruster
2015-10-16 11:08         ` Denis V. Lunev
2015-10-15  7:30 ` [Qemu-devel] [PATCH 2/3] log: report hmp/qmp command and qmp event Denis V. Lunev
2015-10-16  7:34   ` Markus Armbruster
2015-10-16  9:51     ` Pavel Butsykin
2015-10-16 12:35       ` Markus Armbruster
2015-10-16 12:33   ` [Qemu-devel] What's the intended use of log.h logging? (was: [PATCH 2/3] log: report hmp/qmp command and qmp event) Markus Armbruster
2015-10-16 12:48     ` [Qemu-devel] What's the intended use of log.h logging? Paolo Bonzini
2015-10-16 12:54       ` Peter Maydell
2015-10-16 13:00         ` Paolo Bonzini
2015-10-16 13:38           ` Denis V. Lunev
2015-10-16 13:26         ` Daniel P. Berrange
2015-10-16 13:29           ` Peter Maydell
2015-10-16 13:30             ` Paolo Bonzini
2015-10-16 13:36               ` Peter Maydell
2015-10-16 14:17                 ` Paolo Bonzini
2015-10-16 14:31                   ` Peter Maydell
2015-10-16 15:27                     ` Paolo Bonzini
2015-10-19 13:17                     ` Markus Armbruster
2015-10-19 13:19                       ` Paolo Bonzini
2015-10-19 13:54                       ` Peter Maydell
2015-10-16 12:51     ` [Qemu-devel] What's the intended use of log.h logging? (was: [PATCH 2/3] log: report hmp/qmp command and qmp event) Peter Maydell
2015-10-19 14:29       ` [Qemu-devel] What's the intended use of log.h logging? Markus Armbruster
2015-10-19 14:41         ` Peter Maydell
2015-10-19 16:57           ` Dr. David Alan Gilbert
2015-10-19 17:02         ` Dr. David Alan Gilbert
2015-10-20 13:11         ` Kevin Wolf
2015-10-16 14:36     ` [Qemu-devel] What's the intended use of log.h logging? (was: [PATCH 2/3] log: report hmp/qmp command and qmp event) Alex Bennée
2015-10-19 14:52       ` [Qemu-devel] What's the intended use of log.h logging? Markus Armbruster
2015-10-19 14:57         ` Peter Maydell
2015-10-21 10:41     ` [Qemu-devel] What's the intended use of log.h logging? (was: [PATCH 2/3] log: report hmp/qmp command and qmp event) Stefan Hajnoczi
2015-10-21 11:10       ` [Qemu-devel] What's the intended use of log.h logging? Denis V. Lunev
2015-10-21 12:22       ` [Qemu-devel] What's the intended use of log.h logging? (was: [PATCH 2/3] log: report hmp/qmp command and qmp event) Peter Maydell
2015-10-22 12:26         ` Stefan Hajnoczi
2015-10-22 13:05           ` [Qemu-devel] What's the intended use of log.h logging? Paolo Bonzini
2015-10-15  7:30 ` [Qemu-devel] [PATCH 3/3] log: adds a timestamp to each log entry Denis V. Lunev
2015-10-16  7:49   ` Markus Armbruster
2015-10-16  9:55     ` Pavel Butsykin
2015-10-16 11:33       ` Markus Armbruster
2015-10-15 14:49 ` [Qemu-devel] [PATCH 0/3] QEMU logging improvements Kashyap Chamarthy
2015-10-15 15:18   ` Pavel Butsykin
2015-10-15 16:02     ` Kashyap Chamarthy [this message]
2015-10-26  9:16 ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151015160230.GA24087@tesla.redhat.com \
    --to=kchamart@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=lcapitulino@redhat.com \
    --cc=pbutsykin@odin.com \
    --cc=pbutsykin@virtuozzo.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.