[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC Patch v4 1/8] ioreq: remove most 'buf' parameter from static functions



On Wed, Dec 06, 2017 at 02:44:52PM +0000, Paul Durrant wrote:
>> -----Original Message-----
>> From: Chao Gao [mailto:chao.gao@xxxxxxxxx]
>> Sent: 06 December 2017 07:50
>> To: xen-devel@xxxxxxxxxxxxx
>> Cc: Chao Gao <chao.gao@xxxxxxxxx>; Andrew Cooper
>> <Andrew.Cooper3@xxxxxxxxxx>; Jan Beulich <jbeulich@xxxxxxxx>; Paul
>> Durrant <Paul.Durrant@xxxxxxxxxx>
>> Subject: [RFC Patch v4 1/8] ioreq: remove most 'buf' parameter from static
>> functions
>> 
>> It is a preparation to support multiple IOREQ pages.
>> No functional change.
>> 
>> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
>> ---
>> v4:
>>  -new
>> ---
>>  xen/arch/x86/hvm/ioreq.c | 48 +++++++++++++++++++++++------------------
>> -------
>>  1 file changed, 23 insertions(+), 25 deletions(-)
>> 
>> diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
>> index d991ac9..a879f20 100644
>> --- a/xen/arch/x86/hvm/ioreq.c
>> +++ b/xen/arch/x86/hvm/ioreq.c
>> @@ -237,10 +237,9 @@ static void hvm_free_ioreq_gfn(struct
>> hvm_ioreq_server *s, gfn_t gfn)
>>      set_bit(i, &d->arch.hvm_domain.ioreq_gfn.mask);
>>  }
>> 
>> -static void hvm_unmap_ioreq_gfn(struct hvm_ioreq_server *s, bool buf)
>> +static void hvm_unmap_ioreq_gfn(struct hvm_ioreq_server *s,
>> +                                struct hvm_ioreq_page *iorp)
>>  {
>> -    struct hvm_ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq;
>> -
>
>I don't really like this approach. I'd prefer swapping the bool for an 
>unsigned page index, where we follow the convention adopted in 
>hvm_get_ioreq_server_frame() for which macros exist: 0 equating to the 
>bufioreq page, 1+ for the struct-per-cpu pages.

Ok. I have no preference for these two. But I will take your advice. 

Thanks
Chao

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.