On 02/03/2016 11:35 AM, Eric Blake wrote: > On 02/02/2016 08:18 PM, Changlong Xie wrote: >> On 02/02/2016 11:20 PM, Eric Blake wrote: >>> On 01/13/2016 02:18 AM, Changlong Xie wrote: >>>> From: Wen Congyang <we...@cn.fujitsu.com> >>>> >>>> Signed-off-by: Wen Congyang <we...@cn.fujitsu.com> >>>> Signed-off-by: zhanghailiang <zhang.zhanghaili...@huawei.com> >>>> Signed-off-by: Gonglei <arei.gong...@huawei.com> >>>> Signed-off-by: Changlong Xie <xiecl.f...@cn.fujitsu.com> >>>> --- >>>> docs/block-replication.txt | 229 > >>>> +== Usage == >>>> +Primary: >>>> + -drive >>>> if=xxx,driver=quorum,read-pattern=fifo,id=colo1,vote-threshold=1,\ >>>> + children.0.file.filename=1.raw,\ >>>> + children.0.driver=raw >>>> + >>>> + Run qmp command in primary qemu: >>>> + { 'execute': 'human-monitor-command', >>>> + 'arguments': { >>>> + 'command-line': 'drive_add buddy >>>> driver=replication,mode=primary,file.driver=nbd,file.host=xxxx,file.port=xxxx,file.export=colo1,node-name=nbd_client1,if=none' >>>> >>> >>> Eww. We shouldn't ever have to pack a command line as . single QMP >>> string that needs reparsing. Instead, you should pass the information >>> as a nested QMP dictionary, something like: >>> >>> 'arguments': { >>> 'remote-command': { 'command': 'drive_add', 'name': 'buddy', >>> 'driver': 'replication', 'mode': 'primary', >>> 'file': { 'driver': 'nbd', 'host': 'xxxx', >> >> Hi Eric >> >> What is 'remote-command' here? I just tried below commands, but got some >> errors. > > Oh, I totally missed that this was using the existing > 'human-monitor-command' to send an HMP command, instead of trying to > send a formal QMP command. I thought you were documenting a new QMP > command. > > Still, it would be nice to do this command using strict QMP (that would > be via 'blockdev-add') rather than via HMP (an all-in-one text command > crammed into the single 'command-line' argument). > >> >> 'blockdev-add' doesn't support 'nbd'. So we use 'drive_add' here, and >> it's a hmp command. If i'm right, there seems just one way to execute >> hmp commands in QMP: > > For 2.6, we _really_ ought to get blockdev-add working for everything. > We're running short on time, though :( >
If the qmp command 'blockdev-add' supports nbd in qemu-2.6, we will update this document when it is suppoted. Thanks Wen Congyang