|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V2 10/23] xen/mm: Make x86's XENMEM_resource_ioreq_server handling common
On 15.10.2020 18:44, Oleksandr Tyshchenko wrote:
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -30,6 +30,10 @@
> #include <public/memory.h>
> #include <xsm/xsm.h>
>
> +#ifdef CONFIG_IOREQ_SERVER
> +#include <xen/ioreq.h>
> +#endif
Preferably #ifdef-s would not be needed here. If any, they'd better
live in xen/ioreq.h itself then.
> @@ -1045,6 +1049,38 @@ static int acquire_grant_table(struct domain *d,
> unsigned int id,
> return 0;
> }
>
> +#ifdef CONFIG_IOREQ_SERVER
To limit the number of #ifdef-s, could this be moved ...
> +static int acquire_ioreq_server(struct domain *d,
> + unsigned int id,
> + unsigned long frame,
> + unsigned int nr_frames,
> + xen_pfn_t mfn_list[])
> +{
... here such that ...
> @@ -1103,9 +1139,14 @@ static int acquire_resource(
> mfn_list);
> break;
>
> +#ifdef CONFIG_IOREQ_SERVER
> + case XENMEM_resource_ioreq_server:
> + rc = acquire_ioreq_server(d, xmar.id, xmar.frame, xmar.nr_frames,
> + mfn_list);
> + break;
> +#endif
... the ones here then can be dropped?
> default:
Also you'll want to a blank line between the new case statement and
the "default:".
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |