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

Re: [Xen-users] Call schedule set on arinc653 scheduler?



> I write small program to call arinc653, it gives me no error when i
> compiled with parameter -lxenctrl and -luuid. When i run it, it works
> fine like i set variable to xc_sched_xfair_schedule_set(xci, 0,
> &sched); and when it's correct will give true. But still when i check
> 'xl list' still no state running on VM.
>
> Name                                        ID   Mem VCPUs      State   
> Time(s)
> Domain-0                                     0  6258     1     r-----     
> 370.1
> Debian                                       3   512     1     ------       
> 0.0
>

Are you sure you have the Debian VM's UUID right?  Can you run "xl
list -v" to confirm the UUID below?

> Here is the arinc653_schedule_set
>
> #include <stdio.h>
> #include <xenctrl.h>
> #include <uuid/uuid.h>
>
> int main()
> {
>         struct xen_sysctl_arinc653_schedule sched;
>         xc_interface *xci = xc_interface_open(NULL, NULL, 0);
>         int i;
>
>         /* initialize major frame and number of minor frames */
>         sched.major_frame = 0;
>         sched.num_sched_entries = 2;
>
>         uuid_parse("", sched.sched_entries[0].dom_handle);

uuid_parse fails when given a null string, so
sched.sched_entries[0].dom_handle is likely junk.  You can use
uuid_clear(sched.sched_entries[0].dom_handle) instead to set this
handle to the NULL string.

>         sched.sched_entries[0].vcpu_id = 0;
>         sched.sched_entries[0].runtime = 10;
>         sched.major_frame += sched.sched_entries[0].runtime;
>
>         uuid_parse("938b9c5b-8d9d-402a-9be0-0e0cc4cf67dc",
> sched.sched_entries[1].dom_handle);
>         sched.sched_entries[1].vcpu_id = 0;
>         sched.sched_entries[1].runtime = 10;
>         sched.major_frame += sched.sched_entries[1].runtime;
>
>         i = xc_sched_arinc653_schedule_set(xci, 0, &sched);
>         if (i)
>         {
>                 printf("true\n");
>         } else {
>                 printf("false\n");
>         }

Your print statement is somewhat misleading here, since
xc_sched_arinc653_schedule_set returns 0 on success and something else
on failure not true/false.

>         return 0;
> }
>
> interestingly when i run this program suddenly the dom0 hang but when
> i make num_sched_entries bigger than 2, it runs and give me true
> message.

If sched.sched_entries[0].dom_handle has junk, it will hang because
dom0 does not have a slice.

If the only thing that you are changing is num_sched_entries than it's
unlikely that the schedule you are loading is valid, which would
result in the schedule being rejected and an error being returned.
The "true" output would seem to confirm this.

     Nate

>
> Does anyone have any idea what change I need to make to get the scheduler to 
> run
> the VM?  I appreciate the help.
>
> Thanks,
> Idris
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxx
> http://lists.xen.org/xen-users

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


 


Rackspace

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