From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGP2T-0001ac-1e for qemu-devel@nongnu.org; Fri, 15 Mar 2013 03:26:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGP2R-0006UI-Rg for qemu-devel@nongnu.org; Fri, 15 Mar 2013 03:26:52 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:42428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGP2R-0006TK-Aw for qemu-devel@nongnu.org; Fri, 15 Mar 2013 03:26:51 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Mar 2013 17:16:39 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id B7F743578052 for ; Fri, 15 Mar 2013 18:26:46 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2F7DJB752363286 for ; Fri, 15 Mar 2013 18:13:20 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2F7QE4A009448 for ; Fri, 15 Mar 2013 18:26:15 +1100 Message-ID: <5142CCB6.7000004@linux.vnet.ibm.com> Date: Fri, 15 Mar 2013 15:24:38 +0800 From: Wenchao Xia MIME-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC] qmp interface for save vmstate to image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , Eric Blake , Dietmar Maurer , Stefan Hajnoczi , Paolo Bonzini , Kevin Wolf , qemu-devel Hi, Juan and guys, I'd like to add a new way to save vmstate, which will based on the migration thread, but will write contents to block images, instead of fd as stream. Following is the method to add API: 1 add parameters to migrate interface, and a new type of uri: image:[VMSATE_SAVE_IMAGE] ## # @MigrateImageOptions: # # Options for migration to image. # # @path: the full path to the image to be used. # @use-existing: #optional, whether to use existing image in path. If # not specified, qemu will try create new image. # @create-size: #optional, the image's virtual size in creation. Only # valid when use-existing is false or absence, unit is M. # @fmt: #optional the format of the image. If not specified, when # use-existing is true, qemu will try detect the image format, # when use-existing is false or absence, qcow2 format will be # used. # @stream: #optional, whether to save vmstate as stream, in which way # small writes reduce but size may continue growing. If not # specified, vmstate will be saved with fixed size. # # Since: 1.5 ## { 'type': 'MigrateImageOptions', 'data': { 'path': 'str', '*use-existing': 'bool', '*create-size': 'int', '*fmt': 'str', '*stream': 'bool' } } ## # @migrate # # Migrates the current running guest to another Virtual Machine. # # @uri: the Uniform Resource Identifier of the destination VM # # @blk: #optional do block migration (full disk copy) # # @inc: #optional incremental disk copy migration # # @detach: this argument exists only for compatibility reasons and # is ignored by QEMU # # @image-options: #optional, the options used in migration to image. # Only valid in migration to image. # # Returns: nothing on success # # Since: 0.14.0 ## { 'command': 'migrate', 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool', '*image-options': MigrateImageOptions} } In this way query-migrate and migrate incoming could be naturelly used for querying and restoring, But introduce some options only for the image migration. 2 new command vmstate-save with above options. Then use query-migrate and migrate incoming to query/restore the states, which seems wild. I can't decide which is better, could u take a look and put some comments on this? -- Best Regards Wenchao Xia