From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35404 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPkMg-00067L-Qb for qemu-devel@nongnu.org; Mon, 06 Dec 2010 18:21:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPkMf-0003An-9v for qemu-devel@nongnu.org; Mon, 06 Dec 2010 18:21:02 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:57414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPkMf-0003Ah-6G for qemu-devel@nongnu.org; Mon, 06 Dec 2010 18:21:01 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oB6N3qk9006739 for ; Mon, 6 Dec 2010 18:03:52 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 3832D4DE803F for ; Mon, 6 Dec 2010 18:19:09 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB6NKtV52293852 for ; Mon, 6 Dec 2010 18:20:57 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB6NKsAv019042 for ; Mon, 6 Dec 2010 18:20:55 -0500 Message-ID: <4CFD6FD5.6000005@linux.vnet.ibm.com> Date: Mon, 06 Dec 2010 17:20:53 -0600 From: Michael Roth MIME-Version: 1.0 References: <1291399402-20366-1-git-send-email-mdroth@linux.vnet.ibm.com> <1291399402-20366-9-git-send-email-mdroth@linux.vnet.ibm.com> <1291673319.2213.8.camel@aglitke> In-Reply-To: <1291673319.2213.8.camel@aglitke> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RFC][PATCH v5 08/21] virtagent: add agent_viewfile qmp/hmp command List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Adam Litke Cc: agl@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com, Jes.Sorensen@redhat.com, qemu-devel@nongnu.org, aliguori@linux.vnet.ibm.com, ryanh@us.ibm.com, abeekhof@redhat.com On 12/06/2010 04:08 PM, Adam Litke wrote: > On Fri, 2010-12-03 at 12:03 -0600, Michael Roth wrote: >> Utilize the getfile RPC to provide a means to view text files in the >> guest. Getfile can handle binary files as well but we don't advertise >> that here due to the special handling requiring to store it and provide >> it back to the user (base64 encoding it for instance). Hence the >> otherwise confusing "viewfile" as opposed to "getfile". > > What happens to the monitor if you use this to view a binary file? At the very least we probably get a lot of truncated files from the binary->string conversion via monitor_printf(). Im not sure how the qobject/json layer would deal with things. > Retrieving binary files progmatically using the QMP interface is a valid > use case right? For getfile (the RPC), but not for viewfile (HMP/QMP). It's doable, but we'd *have to* pass this data to the user as base64-encoded data at the QMP level. At the HMP level I think we're good either way, since we could just base64 decode in the print function. So in the case of QMP we'd be pushing complexity to the user in exchange for not having a seperate plain-text-only interface. Either way seems reasonable, but I'd been planning on adding a seperate `agent_copyfile ` command for dealing with binary data, and making viewfile quick and easy for plain text (both for HMP and QMP).