Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-22 Thread Vasilis Liaskovitis
On Mon, 2019-03-18 at 18:01 +0100, Jan Beulich wrote: > > > > An alternative prototype could be: > > > > int (*get_func)(char *output); > > > > if we want the function to write the current parameter value > > > > into a > > > > caller-provided buffer, and possibly return error codes. >

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-19 Thread Jan Beulich
>>> On 19.03.19 at 09:12, wrote: > On 19/03/2019 09:04, Jan Beulich wrote: > On 19.03.19 at 07:07, wrote: >>> Why don't we replace the "*get_func()" with a "char *current_val" being >>> filled at parameter setting time? How current_val is allocated (static >>> string or dynamic buffer) just h

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-19 Thread Juergen Gross
On 19/03/2019 09:04, Jan Beulich wrote: On 19.03.19 at 07:07, wrote: >> Why don't we replace the "*get_func()" with a "char *current_val" being >> filled at parameter setting time? How current_val is allocated (static >> string or dynamic buffer) just has to be known by the custom parameter >

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-19 Thread Jan Beulich
>>> On 19.03.19 at 07:07, wrote: > Why don't we replace the "*get_func()" with a "char *current_val" being > filled at parameter setting time? How current_val is allocated (static > string or dynamic buffer) just has to be known by the custom parameter > parsing function. Could accumulate (over t

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-18 Thread Juergen Gross
On 18/03/2019 18:01, Jan Beulich wrote: On 18.03.19 at 16:44, wrote: >> On Mon, 2019-03-18 at 15:02 +0100, Jan Beulich wrote: > I'm also > unconvinced this is appropriate if the value is actually > a signed quantity. isn't OPT_UINT only for unsigned integers? >>> >>> You

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-18 Thread Jan Beulich
>>> On 18.03.19 at 16:44, wrote: > On Mon, 2019-03-18 at 15:02 +0100, Jan Beulich wrote: >> > > I'm also >> > > unconvinced this is appropriate if the value is actually >> > > a signed quantity. >> > >> > isn't OPT_UINT only for unsigned integers? >> >> You'll notice that there's no OPT_INT or O

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-18 Thread Vasilis Liaskovitis
On Mon, 2019-03-18 at 15:02 +0100, Jan Beulich wrote: > > > > From the return value of strcmp()? I don't think so, because > > > > you > may have run past all table entries. Instead it's that property > that you can use, i.e. checking whether ... > > > > > +for ( param = start; param < end

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-18 Thread Jan Beulich
>>> On 18.03.19 at 14:34, wrote: > On Wed, 2019-03-13 at 17:35 +0100, Jan Beulich wrote: >> > > > On 06.03.19 at 13:58, wrote: >> > +found = false; >> >> I don't think you need this variable here, or if so, it shouldn't >> be boolean: Either you mean to support returning data for >> mult

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-18 Thread Vasilis Liaskovitis
thanks for the review. On Wed, 2019-03-13 at 17:35 +0100, Jan Beulich wrote: > > > > On 06.03.19 at 13:58, wrote: > > +static int get_params(const char *cmdline, char *values, > > + const struct kernel_param *start, > > + const struct kernel_param *end) >

Re: [Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-13 Thread Jan Beulich
>>> On 06.03.19 at 13:58, wrote: > +static int get_params(const char *cmdline, char *values, > + const struct kernel_param *start, > + const struct kernel_param *end) > +{ > +char opt[128], *optkey, *q; > +const char *p = cmdline, *val = values; W

[Xen-devel] [PATCH v1 1/4] xen: add hypercall for getting parameters at runtime

2019-03-06 Thread Vasilis Liaskovitis
Add a sysctl hypercall to support getting hypervisor parameters at runtime. Signed-off-by: Vasilis Liaskovitis --- tools/flask/policy/modules/dom0.te | 2 +- xen/common/kernel.c | 109 xen/common/sysctl.c | 45 xen/inc