From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmkJF-0002x6-V3 for qemu-devel@nongnu.org; Thu, 15 Oct 2015 11:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmkJB-0005SR-5D for qemu-devel@nongnu.org; Thu, 15 Oct 2015 11:19:13 -0400 Received: from mx2.parallels.com ([199.115.105.18]:59659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmkJA-0005Rm-VH for qemu-devel@nongnu.org; Thu, 15 Oct 2015 11:19:09 -0400 Message-ID: <561FC3C7.9090906@odin.com> Date: Thu, 15 Oct 2015 18:18:31 +0300 From: Pavel Butsykin MIME-Version: 1.0 References: <1444894224-9542-1-git-send-email-den@openvz.org> <20151015144928.GA1988@tesla.redhat.com> In-Reply-To: <20151015144928.GA1988@tesla.redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kashyap Chamarthy , "Denis V. Lunev" Cc: qemu-devel@nongnu.org, Peter Maydell , Luiz Capitulino , Markus Armbruster , Pavel Butsykin 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 >> CC: Pavel Butsykin >> CC: Markus Armbruster >> CC: Luiz Capitulino >> CC: Eric Blake >> CC: Peter Maydell >> >> > 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