From: "Jan Beulich" Subject: Re: [PATCH v12 5/9] x86: dynamically attach/detach QoS monitoring service for a guest Date: Wed, 23 Jul 2014 08:53:24 +0100 Message-ID: <53CF86140200007800024F6C@mail.emea.novell.com> References: <76a4654789627dcc38af0cad728da78d6e1facbe.1404462280.git.dongxiao.xu@intel.com> <53B6B4D40200007800020B56@mail.emea.novell.com> <40776A41FC278F40B59438AD47D147A911A5F02E@SHSMSX104.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <40776A41FC278F40B59438AD47D147A911A5F02E@SHSMSX104.ccr.corp.intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dongxiao Xu Cc: "keir@xen.org" , "Ian.Campbell@citrix.com" , "stefano.stabellini@eu.citrix.com" , "George.Dunlap@eu.citrix.com" , "andrew.cooper3@citrix.com" , "Ian.Jackson@eu.citrix.com" , "xen-devel@lists.xen.org" , "dgdegra@tycho.nsa.gov" List-Id: xen-devel@lists.xenproject.org >>> On 15.07.14 at 07:31, wrote: >> From: Jan Beulich [mailto:JBeulich@suse.com] >> Sent: Friday, July 04, 2014 8:06 PM >> >>> On 04.07.14 at 10:34, wrote: >> > + case XEN_DOMCTL_pqos_monitor_op: >> > + if ( !pqos_monitor_enabled() ) >> > + { >> > + ret = -ENODEV; >> > + break; >> > + } >> > + >> > + switch ( domctl->u.pqos_monitor_op.cmd ) >> > + { >> > + case XEN_DOMCTL_PQOS_MONITOR_OP_ATTACH: >> > + ret = pqos_monitor_alloc_rmid(d); >> > + break; >> >> Wouldn't it make sense to return the allocated rmid from this operation? > > The current return type for this function is int, where 0 stands correct, > and -EXXX stands for error. > However rmid is "unsigned int" type, which leads to type conflict. Only if full 32 bits would ever be used for RMID. But anyway, if the caller doesn't really care, or if the extra hypercall is no problem, just leave it the way it is. Jan