qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/3] block: add resize monitor command
Date: Thu, 20 Jan 2011 08:56:07 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

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
> address@hidden resize
> address@hidden 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]