From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQz7G-0001PO-Fd for qemu-devel@nongnu.org; Thu, 26 Feb 2015 09:08:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQz7B-0007q5-Q1 for qemu-devel@nongnu.org; Thu, 26 Feb 2015 09:08:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQz7B-0007pm-CU for qemu-devel@nongnu.org; Thu, 26 Feb 2015 09:08:33 -0500 Message-ID: <54EF28C3.9080008@redhat.com> Date: Thu, 26 Feb 2015 15:08:03 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1423710438-14377-1-git-send-email-wency@cn.fujitsu.com> <1423710438-14377-8-git-send-email-wency@cn.fujitsu.com> <54EB9E8B.8070300@redhat.com> In-Reply-To: <54EB9E8B.8070300@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 07/14] NBD client: implement block driver interfaces for block replication List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Wen Congyang , qemu devel , Kevin Wolf , Stefan Hajnoczi Cc: Lai Jiangshan , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , Gonglei , Yang Hongyang , zhanghailiang On 23/02/2015 22:41, Max Reitz wrote: >> >> } >> +static int nbd_start_replication(BlockDriverState *bs, int mode) >> +{ >> + BDRVNBDState *s = bs->opaque; >> + Error *local_err = NULL; >> + int ret; >> + >> + /* >> + * TODO: support COLO_SECONDARY_MODE if we allow secondary >> + * QEMU becoming primary QEMU. >> + */ >> + if (mode != COLO_PRIMARY_MODE) { >> + return -1; > > Once again, I'd like -ENOTSUP more (or -EINVAL or whatever you prefer). Using the Error API is the right thing to do here. Paolo