123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104moduleAction=Functoria.Actionletfilename~name=Fpath.(v(name^"_libvirt")+"xml")letappendfmts=Fmt.pffmt(s^^"@.")letconfigure_main~name=Action.with_output~path:(filename~name)~purpose:"libvirt.xml"(funfmt->appendfmt"<domain type='xen'>";appendfmt" <name>%s</name>"name;appendfmt" <memory unit='KiB'>262144</memory>";appendfmt" <currentMemory unit='KiB'>262144</currentMemory>";appendfmt" <vcpu placement='static'>1</vcpu>";appendfmt" <os>";appendfmt" <type arch='armv7l' machine='xenpv'>linux</type>";appendfmt" <kernel>%s.xen</kernel>"name;appendfmt" <cmdline> </cmdline>";(* the libxl driver currently needs an empty cmdline to be able to
start the domain on arm - due to this?
http://lists.xen.org/archives/html/xen-devel/2014-02/msg02375.html *)appendfmt" </os>";appendfmt" <clock offset='utc' adjustment='reset'/>";appendfmt" <on_crash>preserve</on_crash>";appendfmt" <!-- ";appendfmt" You must define network and block interfaces manually.";appendfmt" See http://libvirt.org/drvxen.html for information about \
converting .xl-files to libvirt xml automatically.";appendfmt" -->";appendfmt" <devices>";appendfmt" <!--";appendfmt" The disk configuration is defined here:";appendfmt" http://libvirt.org/formatstorage.html.";appendfmt" An example would look like:";appendfmt" <disk type='block' device='disk'>";appendfmt" <driver name='phy'/>";appendfmt" <source dev='/dev/loop0'/>";appendfmt" <target dev='' bus='xen'/>";appendfmt" </disk>";appendfmt" -->";appendfmt" <!-- ";appendfmt" The network configuration is defined here:";appendfmt" http://libvirt.org/formatnetwork.html";appendfmt" An example would look like:";appendfmt" <interface type='bridge'>";appendfmt" <mac address='c0:ff:ee:c0:ff:ee'/>";appendfmt" <source bridge='br0'/>";appendfmt" </interface>";appendfmt" -->";appendfmt" <console type='pty'>";appendfmt" <target type='xen' port='0'/>";appendfmt" </console>";appendfmt" </devices>";appendfmt"</domain>")letconfigure_virtio~name=Action.with_output~path:(filename~name)~purpose:"libvirt.xml"(funfmt->appendfmt"<domain type='kvm'>";appendfmt" <name>%s</name>"name;appendfmt" <memory unit='KiB'>262144</memory>";appendfmt" <currentMemory unit='KiB'>262144</currentMemory>";appendfmt" <vcpu placement='static'>1</vcpu>";appendfmt" <os>";appendfmt" <type arch='x86_64' machine='pc'>hvm</type>";appendfmt" <kernel>%s.virtio</kernel>"name;appendfmt" <!-- Command line arguments can be given if required:";appendfmt" <cmdline>-l *:debug</cmdline>";appendfmt" -->";appendfmt" </os>";appendfmt" <clock offset='utc' adjustment='reset'/>";appendfmt" <devices>";appendfmt" <emulator>/usr/bin/qemu-system-x86_64</emulator>";appendfmt" <!--";appendfmt" Disk/block configuration reference is here:";appendfmt" https://libvirt.org/formatdomain.html#elementsDisks";appendfmt" This example uses a raw file on the host as a block in the \
guest:";appendfmt" <disk type='file' device='disk'>";appendfmt" <driver name='qemu' type='raw'/>";appendfmt" <source file='/var/lib/libvirt/images/%s.img'/>"name;appendfmt" <target dev='vda' bus='virtio'/>";appendfmt" </disk>";appendfmt" -->";appendfmt" <!-- ";appendfmt" Network configuration reference is here:";appendfmt" https://libvirt.org/formatdomain.html#elementsNICS";appendfmt" This example adds a device in the 'default' libvirt bridge:";appendfmt" <interface type='bridge'>";appendfmt" <source bridge='virbr0'/>";appendfmt" <model type='virtio'/>";appendfmt" <alias name='0'/>";appendfmt" </interface>";appendfmt" -->";appendfmt" <serial type='pty'>";appendfmt" <target port='0'/>";appendfmt" </serial>";appendfmt" <console type='pty'>";appendfmt" <target type='serial' port='0'/>";appendfmt" </console>";appendfmt" <memballoon model='none'/>";appendfmt" </devices>";appendfmt"</domain>")