[I erroneously gave a Tested-by to the next patch (02/12) in this series, instead of this one.]
On Wed, Jul 27, 2016 at 03:01:42PM +0800, Changlong Xie wrote: > From: Wen Congyang <we...@cn.fujitsu.com> > > Signed-off-by: Wen Congyang <we...@cn.fujitsu.com> > Signed-off-by: Changlong Xie <xiecl.f...@cn.fujitsu.com> > Signed-off-by: Wang WeiWei <wangww.f...@cn.fujitsu.com> > --- > block.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) Tested-by: Kashyap Chamarthy <address@hidden> Test case: Without this patch applied ========================== Create an empty target image: $ qemu-img create -f qcow2 target.qcow2 1G $ ./qmp-shell -v -p ./qmp-sock (QEMU) blockdev-add options={"id":"drive-ide1-0-0","driver":"qcow2","file":{"driver":"file","filename":"/export/target.qcow2"},"backing":"drive-ide0-0-0"} (QEMU) blockdev-backup device=drive-ide0-0-0 target=drive-ide1-0-0 sync=none { "execute": "blockdev-backup", "arguments": { "device": "drive-ide0-0-0", "target": "drive-ide1-0-0", "sync": "none" } } { "error": { "class": "GenericError", "desc": "Node 'drive-ide0-0-0' is busy: node is used as backing hd of '#block360'" } } With this patch applied ======================= `blockdev-backup` of an image to its immediate overlay succeds: ----------------------------------------------------------------------- (QEMU) blockdev-backup device=drive-ide0-0-0 target=drive-ide1-0-0 sync=none { "execute": "blockdev-backup", "arguments": { "device": "drive-ide0-0-0", "target": "drive-ide1-0-0", "sync": "none" } } { "return": {} } (QEMU) query-block-jobs { "execute": "query-block-jobs", "arguments": {} } { "return": [ { "busy": false, "type": "backup", "len": 41126400, "paused": false, "ready": false, "io-status": "ok", "offset": 0, "device": "drive-ide0-0-0", "speed": 0 } ] } ----------------------------------------------------------------------- -- /kashyap