Hi Ewan, I'm almost ready to integrate some PPC-specific stuff into
xend, and I was wondering if you had a plan for how that should work.

First example: the device tree data structure we talked about a few
weeks ago. We will need to pass the config data to PPC code, probably in
XendDomainInfo.initDomain(), and then pass the resulting data structure
into libxc's xc_linux_load() somehow.

As another example, initDomain() already has some architecture hackage
in it for memory allocation. We think we'll need to modify that some
more in the future for PPC, possibly even changing the "order" argument
to xc.domain_memory_increase_reservation().

Rather than having these inline tests everywhere ("if os.uname()[4] in
('ia64', 'ppc64'):"), would it make more sense to have some sort of
"architecture" object, and do things like:
class Architecture:
        def init_reservation(self, mem_kb):
                return mem_kb
        def init_reservation_order(self):
                return 0
class ia64_Architecture(Architecture):
        def init_reservation(self, mem_kb):
                if 'hvm' in xc.xeninfo()['xen_caps']:
                        mem_kb += 4*1024;
                return mem_kb

Sample use in XendDomainInfo.py:
from xen.xend import arch
        init_reservation = arch.init_reservation(mem_kb)

I'm not sure how/where to instantiate the arch object though.

Does that make sense to you? The Architecture object would expand to
include every piece of arch-specific functionality we run across in the

Hollis Blanchard
IBM Linux Technology Center

Xen-ppc-devel mailing list

Reply via email to