From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV1yc-0006Ft-Td for qemu-devel@nongnu.org; Wed, 24 Apr 2013 11:51:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UV1yX-0002w6-MW for qemu-devel@nongnu.org; Wed, 24 Apr 2013 11:51:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV1yX-0002vi-Cp for qemu-devel@nongnu.org; Wed, 24 Apr 2013 11:51:17 -0400 Date: Wed, 24 Apr 2013 11:50:22 -0400 From: Luiz Capitulino Message-ID: <20130424115022.2ac2667d@redhat.com> In-Reply-To: <5176ABB7.8080102@redhat.com> References: <1366731014-48790-1-git-send-email-jfrei@linux.vnet.ibm.com> <1366731014-48790-2-git-send-email-jfrei@linux.vnet.ibm.com> <5176ABB7.8080102@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] Split out dump-guest-memory memory mapping code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Peter Maydell , Ekaterina Tumanova , Alexander Graf , qemu-devel , Rabin Vincent , Christian Borntraeger , Jens Freimann , Paolo Bonzini , Andreas =?UTF-8?B?RsOkcmJlcg==?= On Tue, 23 Apr 2013 09:41:43 -0600 Eric Blake wrote: > On 04/23/2013 09:30 AM, Jens Freimann wrote: > > Split out dump-guest-memory memory mapping code to allow dumping without > > memory mapping > > > > The qemu dump.c code currently requires CONFIG_HAVE_CORE_DUMP as well as > > CONFIG_HAVE_GET_MEMORY_MAPPING. This allows for dumping with and without paging. > > Some architectures will provide only the non-paging case. This patch allows an > > architecture to provide dumping even when CONFIG_HAVE_GET_MEMORY_MAPPING is not > > available. To do that, we split out the common code and provide stub functions > > for the non-paging case. If -p is specified on a target that doesn't support it, > > we will pass an error to the calling code. > > > > Signed-off-by: Ekaterina Tumanova > > Signed-off-by: Jens Freimann > > --- > > > +++ b/include/qapi/qmp/qerror.h > > @@ -249,4 +249,7 @@ void assert_no_error(Error *err); > > #define QERR_SOCKET_CREATE_FAILED \ > > ERROR_CLASS_GENERIC_ERROR, "Failed to create socket" > > > > +#define QERR_UNSUPPORTED_COMMAND_OPTION \ > > + ERROR_CLASS_GENERIC_ERROR, "Option(s) %s of %s command not supported for %s" > > Rather than adding a new QERR_* constant here, just use error_setg() in > qmp_dump_guest_memory() in the first place. > > This raises an interesting question about introspection - how will > management apps (such as libvirt) be able to determine whether the > paging command is supported for a given architecture? Do we need to > expand the 'MachineInfo' QMP datatype so that 'query-machines' can tell > us whether a given machine will support or reject attempts to set > 'paging':true during 'dump-guest-memory'? Is libvirt going to query this for the automatic dump feature? I'm asking this because if the fact that an arch doesn't support memory dump is only visible to human users, then try & fail doesn't seem bad.