From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47239 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfqJt-0005Gu-HZ for qemu-devel@nongnu.org; Thu, 20 Jan 2011 03:56:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfqJq-0003Re-Ib for qemu-devel@nongnu.org; Thu, 20 Jan 2011 03:56:41 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:58313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfqJq-0003OR-Cx for qemu-devel@nongnu.org; Thu, 20 Jan 2011 03:56:38 -0500 Received: by wwi18 with SMTP id 18so328633wwi.10 for ; Thu, 20 Jan 2011 00:56:36 -0800 (PST) Date: Thu, 20 Jan 2011 08:56:07 +0000 From: Stefan Hajnoczi Subject: Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command Message-ID: <20110120085529.GA24021@stefanha-thinkpad.localdomain> References: <20110119170238.GA9615@lst.de> <20110119170248.GA9819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110119170248.GA9819@lst.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org On Wed, Jan 19, 2011 at 06:02:48PM +0100, Christoph Hellwig wrote: > Index: qemu/hmp-commands.hx > =================================================================== > --- qemu.orig/hmp-commands.hx 2011-01-19 17:47:10.444004409 +0100 > +++ qemu/hmp-commands.hx 2011-01-19 17:49:51.673254095 +0100 > @@ -53,6 +53,25 @@ Quit the emulator. > ETEXI > > { > + .name = "resize", > + .args_type = "id:s,size:o", > + .params = "device size", > + .help = "resize a block image", > + .user_print = monitor_user_noop, > + .mhandler.cmd_new = do_resize, > + }, > + > +STEXI > +@item resize > +@findex resize > +Resize a block image while a guest is running. Usually requires guest > +action to see the updated size. Resize to a lower size is supported, > +but should be used with extreme caution. Note that this command only > +resizes image files, it can not resize block devices like LVM volumes. > +ETEXI > + > + > + { > .name = "eject", > .args_type = "force:-f,device:B", > .params = "[-f] device", [...] > Index: qemu/qmp-commands.hx > =================================================================== > --- qemu.orig/qmp-commands.hx 2011-01-19 17:47:10.478012371 +0100 > +++ qemu/qmp-commands.hx 2011-01-19 17:50:07.406016841 +0100 > @@ -601,6 +601,34 @@ Example: > -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } } > <- { "return": {} } > > + > +EQMP > + > + { > + .name = "block_resize", > + .args_type = "id:s,size:o", > + .params = "id size", > + .help = "resize a block image", > + .user_print = monitor_user_noop, > + .mhandler.cmd_new = do_resize, > + }, > + > +SQMP > +block_resize > +------------ > + > +Resize a block image while a guest is running. > + > +Arguments: > + > +- "id": the device's ID, must be unique (json-string) > +- "size": new size > + > +Example: > + > +-> { "execute": "block_resize", "arguments": { "id": "scratch", "size": 1073741824 } } > +<- { "return": {} } > + > EQMP eject, change, block_passwd, and others call the device name argument "device" instead of "id". In the interest of a consistent external API it would be nice to use "device" for the block_resize command too. Stefan