All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] block: drive_add/del without BlockBackend
@ 2016-02-23 17:16 Kevin Wolf
  2016-02-23 17:16 ` [Qemu-devel] [PATCH 1/2] hmp: 'drive_add -n' for creating a node without BB Kevin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-02-23 17:16 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, pkrempa, qemu-devel, armbru, mreitz

See patch 1 for the detailed description why this is needed. The short
version is that libvirt needs to enable detect-zeroes on a mirror
target.

Peter, can you please check if this provides what you need? I checked
whether I could do the mirroring operation manually; and if I did it
right, it looks good to me. (Shortened) protocol of my test:

$ ./qemu-img create -f qcow2 /tmp/test.qcow2 64M
Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

$ ./qemu-io -c 'write -P 0 0 64M' /tmp/test.qcow2 
wrote 67108864/67108864 bytes at offset 0
64 MiB, 1 ops; 0.3141 sec (203.694 MiB/sec and 3.1827 ops/sec)

$ ls -lh /tmp/test.qcow2 
-rw-r--r--. 1 kwolf kwolf 65M 23. Feb 17:57 /tmp/test.qcow2

$ ./qemu-img create -f qcow2 /tmp/copy.qcow2 64M
Formatting '/tmp/copy.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

$ x86_64-softmmu/qemu-system-x86_64 -qmp stdio -hda /tmp/test.qcow2
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 5, "major": 2}, "package": ""}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute":"human-monitor-command","arguments":{"command-line":"drive_add -n 0 file.filename=/tmp/copy.qcow2,node-name=copy,detect-zeroes=on"}}
{"return": ""}
{"execute":"blockdev-mirror","arguments":{"device":"ide0-hd0","target":"copy","sync":"full"}}
{"return": {}}
{"timestamp": {"seconds": 1456247099, "microseconds": 895774}, "event": "BLOCK_JOB_READY", "data": {"device": "ide0-hd0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "mirror"}}
{"execute":"block-job-complete","arguments":{"device":"ide0-hd0"}}
{"return": {}}
{"timestamp": {"seconds": 1456247127, "microseconds": 552227}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "ide0-hd0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "mirror"}}

$ ls -lh /tmp/copy.qcow2 
-rw-r--r--. 1 kwolf kwolf 320K 23. Feb 18:04 /tmp/copy.qcow2

Kevin Wolf (2):
  hmp: 'drive_add -n' for creating a node without BB
  hmp: Extend drive_del to delete nodes without BB

 blockdev.c                | 39 +++++++++++++++++++++++++++++++++++++++
 device-hotplug.c          |  7 +++++++
 hmp-commands.hx           |  4 ++--
 include/block/block_int.h |  2 ++
 4 files changed, 50 insertions(+), 2 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-03-09 10:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23 17:16 [Qemu-devel] [PATCH 0/2] block: drive_add/del without BlockBackend Kevin Wolf
2016-02-23 17:16 ` [Qemu-devel] [PATCH 1/2] hmp: 'drive_add -n' for creating a node without BB Kevin Wolf
2016-02-24 17:50   ` Max Reitz
2016-02-24 18:24     ` Kevin Wolf
2016-02-25 13:18   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2016-02-25 16:05     ` Eric Blake
2016-02-23 17:16 ` [Qemu-devel] [PATCH 2/2] hmp: Extend drive_del to delete nodes " Kevin Wolf
2016-02-24 17:54   ` Max Reitz
2016-02-24 18:23     ` Kevin Wolf
2016-02-26 13:09       ` Max Reitz
2016-02-25 12:51     ` Peter Krempa
2016-02-26 13:11       ` Max Reitz
2016-03-09 10:54 ` [Qemu-devel] [PATCH 0/2] block: drive_add/del without BlockBackend Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.