August 10th, 2010

404

ковыряюсь в коде xen'а

Его писали офигенные программисты.

Смотрите:
#define for_each_vcpu(_d,_v)                    \
 for ( (_v) = (_d)->vcpu[0];                    \
       (_v) != NULL;                            \
       (_v) = (_v)->next_in_list )

....


   for_each_vcpu ( d, v )
    {
        vcpu_runstate_get(v, &runstate);
        cpu_time += runstate.time[RUNSTATE_running];
        info->max_vcpu_id = v->vcpu_id;
        if ( !test_bit(_VPF_down, &v->pause_flags) )
        {
            if ( !(v->pause_flags & VPF_blocked) )
                flags &= ~XEN_DOMINF_blocked;
            if ( v->is_running )
                flags |= XEN_DOMINF_running;
            info->nr_online_vcpus++;
        }
    }



Реально круто.
404

xen compilation

 aptitude install mercurial git-core build-essential\
 python-dev libncurses-dev libssl-dev xorg-dev \
 bridge-utils bison flex libsdl-dev \
 uuid-dev gettext bcc iasl texinfo
 hg clone http://xenbits.xensource.com/xen-unstable.hg #loooooooooooooooooooooong cat
 cd xen-unstable.hg
 make world -j 8
 make -j 8


Tested on xen 4.1 && debian lenny AMD64