module Action = Functoria.Action
let filename ~name = Fpath.(v (name ^ "_libvirt") + "xml")
let append fmt s = Fmt.pf fmt (s ^^ "@.")
let configure_main ~name =
Action.with_output ~path:(filename ~name) ~purpose:"libvirt.xml" (fun fmt ->
append fmt "";
append fmt " %s" name;
append fmt " 262144";
append fmt " 262144";
append fmt " 1";
append fmt " ";
append fmt " linux";
append fmt " %s.xen" name;
append fmt " ";
(* 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 *)
append fmt " ";
append fmt " ";
append fmt " preserve";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt "")
let configure_virtio ~name =
Action.with_output ~path:(filename ~name) ~purpose:"libvirt.xml" (fun fmt ->
append fmt "";
append fmt " %s" name;
append fmt " 262144";
append fmt " 262144";
append fmt " 1";
append fmt " ";
append fmt " hvm";
append fmt " %s.virtio" name;
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " /usr/bin/qemu-system-x86_64";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt " ";
append fmt "")