Features/Block/Rebase: Difference between revisions

From QEMU
(Created page with '== Summary == Add dynamic rebase of running disk == Owner == * '''Name:''' Choonho Son * '''Email:''' choonho.son@gmail.com == Description == == Usage example == '''QMP com…')
 
No edit summary
 
(6 intermediate revisions by one other user not shown)
Line 5: Line 5:
== Owner ==
== Owner ==


* '''Name:''' Choonho Son
* '''Name:''' [[User:Choonho.son|Choonho Son]]
* '''Email:''' choonho.son@gmail.com
* '''Email:''' choonho.son@gmail.com


== Description ==
== Description ==
'''qapi-schema.json'''
##
# @block_rebase
#
# This command will change backing file of disk.
#
# Since: 2.x
##
{ 'command': 'block_rebase',
  'data' : { 'device' : 'str',
              'file' : 'str' } }
'''qmp-command.hx'''
    {
        .name      = "block_rebase",
        .args_type  = "device:s,file:s",
        .mhandler.cmd_new = qmp_marshal_input_block_rebase,
    },
SQMP
block_rebase
------------
Rebase a block image file in another location while a guest is running.
Arguments:
- "device": the device's ID, must be unique
- "file": new backing file path
Example:
-> { "execute": "block_rebase", "arguments": { "device": "ide0-hd0", "file": "/storage/new_base.img" }}
<- { "return": {} }
EQMP
'''hmp-command.hx'''
    {
        .name      = "block_rebase",
        .args_type  = "drive:s,file:s",
        .params    = "drive file",
        .help      = "rebase drive's backing file",
        .mhandler.cmd = hmp_block_rebase,
    },
STEXI
@item block_rebase
@findex block_rebase
Rebase drive's backing file.
ETEXI


== Usage example ==
== Usage example ==
'''Original Disk'''
[[File:Qcow2.png]]
'''New rebased Disk'''
[[File:Rebase.png]]


'''QMP command'''
'''QMP command'''
  { "execute": "block_rebase", "arguments": { "device": "ide0-hd0", "file": "/storage/ubuntu_base.img" } }
  { "execute": "block_rebase", "arguments": { "device": "ide0-hd0", "file": "/storage/new_base.img" } }


'''HMP command'''
'''HMP command'''
  (qemu) block_rebase ide0-hd0 /storage/ubuntu_base.img
  (qemu) block_rebase ide0-hd0 /storage/new_base.img
 
== Detailed Smmary ==
'''Links'''
* [https://github.com/choonho/qemu-rebase qemu-rebase.git]


== Status ==
== Status ==
[[Category:Obsolete feature pages]]

Latest revision as of 14:44, 11 October 2016

Summary

Add dynamic rebase of running disk

Owner

Description

qapi-schema.json

##
# @block_rebase
#
# This command will change backing file of disk.
#
# Since: 2.x
##
{ 'command': 'block_rebase',
  'data' : { 'device' : 'str',
             'file' : 'str' } }


qmp-command.hx

    {
        .name       = "block_rebase",
        .args_type  = "device:s,file:s",
        .mhandler.cmd_new = qmp_marshal_input_block_rebase,
    },

SQMP
block_rebase
------------

Rebase a block image file in another location while a guest is running.

Arguments:

- "device": the device's ID, must be unique
- "file": new backing file path

Example:
-> { "execute": "block_rebase", "arguments": { "device": "ide0-hd0", "file": "/storage/new_base.img" }}
<- { "return": {} }
EQMP

hmp-command.hx

    {
        .name       = "block_rebase",
        .args_type  = "drive:s,file:s",
        .params     = "drive file",
        .help       = "rebase drive's backing file",
        .mhandler.cmd = hmp_block_rebase,
    },

STEXI
@item block_rebase
@findex block_rebase
Rebase drive's backing file.
ETEXI

Usage example

Original Disk

Qcow2.png

New rebased Disk

Rebase.png

QMP command

{ "execute": "block_rebase", "arguments": { "device": "ide0-hd0", "file": "/storage/new_base.img" } }

HMP command

(qemu) block_rebase ide0-hd0 /storage/new_base.img

Detailed Smmary

Links

Status