From: Ian Campbell Subject: Re: [PATCH v16 2/7] remus: introduce remus device Date: Fri, 18 Jul 2014 11:14:53 +0100 Message-ID: <1405678493.13883.24.camel@kazak.uk.xensource.com> References: <1405406805-1455-1-git-send-email-yanghy@cn.fujitsu.com> <1405406805-1455-3-git-send-email-yanghy@cn.fujitsu.com> <21445.29371.640484.799653@mariner.uk.xensource.com> <53C658F9.3090507@cn.fujitsu.com> <21446.26151.961369.811500@mariner.uk.xensource.com> <53C8F1BC.7030705@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53C8F1BC.7030705@cn.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Hongyang Yang Cc: laijs@cn.fujitsu.com, wency@cn.fujitsu.com, andrew.cooper3@citrix.com, yunhong.jiang@intel.com, Ian Jackson , xen-devel@lists.xen.org, eddie.dong@intel.com, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On Fri, 2014-07-18 at 18:06 +0800, Hongyang Yang wrote: > > My proposal above would do away with the need for match to look at the > > kind at all. It would only iterate over the subkinds which are > > relevant to that kind. > > > > What are the other purposes you mention ? I didn't notice them. > > I intend to keep this *kind* because I will use them for filter out > what kind of device the remus abstract layer need to handle. > > take the code v17.6(refer to above link) as an example: > > typedef enum libxl__remus_device_kind { > LIBXL__REMUS_DEVICE_NIC = (1 << 0), > LIBXL__REMUS_DEVICE_DISK = (1 << 1), > } libxl__remus_device_kind; I've not been following closely so I make no comment on whether you actually should or shouldn't need a kind in this code (I'll leave that to Ian) but if you do need it then this is needlessly duplicating libxl__device_kind AFAICT. If you really do need a bit field then you can use 1<