Received: from eggs.gnu.org ([2001:4830:134:3::10]:40166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwoVa-0006j2-62 for qemu-devel@nongnu.org; Fri, 05 Dec 2014 03:45:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwoVV-0004sv-ET for qemu-devel@nongnu.org; Fri, 05 Dec 2014 03:45:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwoVV-0004sW-5Y for qemu-devel@nongnu.org; Fri, 05 Dec 2014 03:44:57 -0500 From: Markus Armbruster References: <1416991272-10277-1-git-send-email-bdpayne@acm.org> <1417033667-10364-1-git-send-email-bdpayne@acm.org> <1417033667-10364-2-git-send-email-bdpayne@acm.org> <20141127020403.GA7921@fam-t430.nay.redhat.com> <874mtbdbov.fsf@blackfin.pond.sub.org> Date: Fri, 05 Dec 2014 09:44:48 +0100 In-Reply-To: (Bryan D. Payne's message of "Thu, 4 Dec 2014 08:49:34 -0800") Message-ID: <87iohq4ha7.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] qmp: extend QMP to provide read/write access to physical memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Bryan D. Payne" Cc: Fam Zheng , qemu-devel@nongnu.org, lcapitulino@redhat.com "Bryan D. Payne" writes: >> >> Can you explain again why the existing commands to read guest memory >> (from the top of my head: dump-guest-memory, memsave, pmemsave) are >> insufficient? How does your solution improve on them? What exactly can >> it do what these commands can't? What exactly can't it do what these >> commands can? >> >> I feel we need to understand the answers to these questions to sensibly >> evolve the API in this area. > > > Certainly. The main issue with this series of commands is that they dump > the memory to a file on disk. What I'm trying to facilitate here is an > application that monitors the guest memory in real time while the guest is > running (likely with brief pauses during memory analysis periods). Writing > all of this data to disk, and then reading it back again for the analysis > application is several orders of magnitude too slow for these types of > applications. > > This new method that I'm proposing here keeps everything in memory, which > makes it much faster. Actually, it sends it through a UNIX domain socket. Still I/O, just different I/O. "Faster" is plausible, but by how much I can't say without measurements. "Several orders of magnitude" needs evidence. I think you could make another supporting argument: the socket is easier to use than futzing around with files. > Tldr; existing solutions are suitable for forensic analysis, whereas I'm > looking to solve the runtime analysis problem. Understood. Based on your qapi-schema.json change only, I figure your new command sets up a special-purpose monitor-like thing on a newly created a UNIX domain socket. This monitor-like thing talks its own language, which is so far undocmented. Why restrict this to a UNIX domain socket? In other places involving byte streams we use a QEMU character device. Can you explain why you need a separate stream instead of embedding the conversation in QMP? We already have such embedded I/O: ringbuf-read, ringbuf-write. Yes, it got multiple documented bugs, but that's because it was badly done, not because such a thing couldn't be done nicely. If you add a separate stream talking its own language, you get to document the language. A file in docs/ should do. The QMP command documentation should point to it.