From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmkzG-0005q4-JS for qemu-devel@nongnu.org; Thu, 15 Oct 2015 12:02:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmkzB-00084E-HD for qemu-devel@nongnu.org; Thu, 15 Oct 2015 12:02:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmkzB-000840-9U for qemu-devel@nongnu.org; Thu, 15 Oct 2015 12:02:33 -0400 Date: Thu, 15 Oct 2015 18:02:30 +0200 From: Kashyap Chamarthy Message-ID: <20151015160230.GA24087@tesla.redhat.com> References: <1444894224-9542-1-git-send-email-den@openvz.org> <20151015144928.GA1988@tesla.redhat.com> <561FC3C7.9090906@odin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <561FC3C7.9090906@odin.com> Subject: Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Butsykin Cc: Peter Maydell , Pavel Butsykin , Markus Armbruster , qemu-devel@nongnu.org, Luiz Capitulino , "Denis V. Lunev" 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