On Mon, Feb 8, 2016 at 5:07 AM, Wei Liu <wei.l...@citrix.com> wrote:
>
>
> [...]
> > >> +        num_vcpus = max_vcpuid + 1;
> > >> +        GCNEW_ARRAY(vcpus, num_vcpus);
> > >> +        if (sched_rtds_validate_params(gc, scinfo->vcpus[0].period,
> > >> +                                 scinfo->vcpus[0].budget,
> > >
> > > This doesn't make sense. You take this path because scinfo->num_vcpus is
> > > 0 but now you're dereferencing scinfo->vcpus[0]. Do I miss anything?
> > For commands like " xl sched-rtds -d vm1 -v all -p 1000 -b 1000"
> > (which sets all vcpus with
> > the same scheduling parameters), we pass the budget and period via
> > scinfo->vcpus[0].
> >
> > I'll add more explanation here.
>
> No, adding more explanation won't help.
>
> Let me explain a bit. Libxl is the library that can be used by multiple
> applications. Xl is just one of the applications. The other application
> that I know of is libvirt.
>
> So, the incarnation of a particular xl command is of no concern how we
> define the semantics of a libxl API. That is, you can come up with an
> unambiguous API but still support the same xl command.
>
> Currently the semantics of this (new?) libxl API seems to be broken,
> because you're (ab)using num_vcpus to represent a special case. In
> effect you can't really whether the array is empty. When num_vcpus is 0,
> you shouldn't dereference vcpus array, at all, because the semantics of
> num_vcpus == 0 is that the array is empty.
>
> Wei.

I see. I'll think about re-designing the data structure of
libxl_vcpu_sched_params.

Chong
>
> > >
> > >> +                                 &vcpus[0].s.rtds.period,
> > >> +                                 &vcpus[0].s.rtds.budget))
> > >
> >
> > --
> > Chong Li
> > Department of Computer Science and Engineering
> > Washington University in St.louis




-- 
Chong Li
Department of Computer Science and Engineering
Washington University in St.louis

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to