From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQoHv-0003D1-3R for qemu-devel@nongnu.org; Tue, 02 Feb 2016 22:39:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQoHr-0000OK-Ss for qemu-devel@nongnu.org; Tue, 02 Feb 2016 22:39:27 -0500 Received: from [59.151.112.132] (port=39502 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQoHr-0000OE-Gb for qemu-devel@nongnu.org; Tue, 02 Feb 2016 22:39:23 -0500 References: <1452676712-24239-1-git-send-email-xiecl.fnst@cn.fujitsu.com> <1452676712-24239-6-git-send-email-xiecl.fnst@cn.fujitsu.com> <56B0C945.60100@redhat.com> <56B17169.90601@cn.fujitsu.com> <56B17590.8020702@redhat.com> From: Wen Congyang Message-ID: <56B1769B.1090202@cn.fujitsu.com> Date: Wed, 3 Feb 2016 11:40:11 +0800 MIME-Version: 1.0 In-Reply-To: <56B17590.8020702@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v14 5/8] docs: block replication's description List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Changlong Xie , qemu devel , Fam Zheng , Max Reitz , Paolo Bonzini , Kevin Wolf , Stefan Hajnoczi Cc: Gonglei , zhanghailiang , fnstml-hwcolo@cn.fujitsu.com 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 >>>> >>>> Signed-off-by: Wen Congyang >>>> Signed-off-by: zhanghailiang >>>> Signed-off-by: Gonglei >>>> Signed-off-by: Changlong Xie >>>> --- >>>> 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