Skip to content

Commit 683f897

Browse files
committed
Merge pull request xapi-project#11 from djs55/forupstream/xenswitch
Optionally use the message switch
2 parents 481ef03 + a9bb088 commit 683f897

18 files changed

+222
-401
lines changed

lib/config.ml

Lines changed: 0 additions & 72 deletions
This file was deleted.

lib/config.mli

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/path.ml

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,54 +13,39 @@
1313
*)
1414

1515
let network_conf = ref "/etc/xcp/network.conf"
16-
let vif_script = ref "/usr/lib/xcp/scripts/vif"
17-
let qemu_vif_script = ref "/usr/lib/xcp/scripts/qemu-vif-script"
18-
let vbd_script = ref "/etc/xen/scripts/block"
19-
let pci_flr_script = ref "/usr/lib/xcp/lib/pci-flr"
20-
let vncterm = ref "/usr/lib/xcp/lib/vncterm"
21-
let xenguest = ref "/usr/lib/xcp/lib/xenguest"
2216
let qemu_dm_wrapper = ref "/usr/lib/xcp/lib/qemu-dm-wrapper"
2317
let qemu_system_i386 = ref "/usr/lib/xen/bin/qemu-system-i386"
24-
let tune2fs = ref "/sbin/tune2fs"
25-
let mkfs = ref "/sbin/mkfs"
26-
let mount = ref "/bin/mount"
27-
let umount = ref "/bin/umount"
28-
let ionice = ref "/usr/bin/ionice"
2918
let chgrp = ref "/bin/chgrp"
30-
let setup_vif_rules = ref "/usr/lib/xcp/lib/setup-vif-rules"
3119
let hvmloader = ref "/usr/lib/xen-4.1/boot/hvmloader"
32-
let pygrub = ref "/usr/lib/xen-4.1/bin/pygrub"
33-
let eliloader = ref "/usr/bin/eliloader"
3420

3521
open Unix
3622

37-
let essentials = [
38-
X_OK, "vbd-script", vbd_script, "path to the vbd backend script";
39-
R_OK, "network-conf", network_conf, "path to the network backend switch";
40-
X_OK, "vif-script", vif_script, "path to the vif backend script";
41-
X_OK, "qemu-vif-script", qemu_vif_script, "path to the qemu vif script";
42-
X_OK, "vncterm", vncterm, "path to the vncterm binary";
43-
X_OK, "xenguest", xenguest, "path to the xenguest binary";
23+
let hvm_guests = [
24+
R_OK, "hvmloader", hvmloader, "path to the hvmloader binary for HVM guests";
4425
X_OK, "qemu-dm-wrapper", qemu_dm_wrapper, "path to the qemu-dm-wrapper script";
4526
X_OK, "qemu-system-i386", qemu_system_i386, "path to the qemu-system-i386 binary";
46-
X_OK, "tune2fs", tune2fs, "path to the tune2fs binary";
47-
X_OK, "mkfs", mkfs, "path to the mkfs binary";
48-
X_OK, "mount", mount, "path to the mount binary";
49-
X_OK, "umount", umount, "path to the umount binary";
50-
X_OK, "ionice", ionice, "path to the ionice binary";
27+
]
28+
29+
(* libvirt xc *)
30+
let network_configuration = [
31+
R_OK, "network-conf", network_conf, "path to the network backend switch";
32+
]
33+
34+
let essentials = [
5135
X_OK, "chgrp", chgrp, "path to the chgrp binary";
52-
X_OK, "setup-vif-rules", setup_vif_rules, "path to the setup-vif-rules script";
53-
R_OK, "hvmloader", hvmloader, "path to the hvmloader binary for HVM guests";
54-
X_OK, "pygrub", pygrub, "path to the pygrub bootloader binary";
55-
X_OK, "eliloader", eliloader, "path to the eliloader bootloader binary";
5636
]
5737

5838
let nonessentials = [
59-
X_OK, "pci-flr-script", pci_flr_script, "path to the PCI function-level reset script";
6039
]
6140

62-
(* Sometimes we tell other services to execute programs (e.g. udev calling the vif script)
63-
and they will have a different working directory *)
64-
let canonicalise x = Filename.(if is_relative x then concat (Unix.getcwd ()) x else x)
65-
66-
let config_spec = List.map (fun (_, a, b, c) -> a, Arg.String (fun x -> b := canonicalise x), c) (essentials @ nonessentials)
41+
let make_resources ~essentials ~nonessentials =
42+
let open Xcp_service in
43+
List.map (fun (perm, name, path, description) -> {
44+
essential = true;
45+
name; description; path;
46+
perms = [ perm ]
47+
}) essentials @ (List.map (fun (perm, name, path, description) -> {
48+
essential = false;
49+
name; description; path;
50+
perms = [ perm ]
51+
}) nonessentials)

lib/xenops_server.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ and perform ?subtask (op: operation) (t: Xenops_task.t) : unit =
12411241
let state = B.VM.get_state vm in
12421242
info "VM %s has memory_limit = %Ld" id state.Vm.memory_limit;
12431243

1244-
Cohttp_posix_io.Unbuffered_IO.open_uri memory_url
1244+
Open_uri.with_open_uri memory_url
12451245
(fun mfd ->
12461246
let open Xenops_migrate in
12471247
let module Request = Cohttp.Request.Make(Cohttp_posix_io.Unbuffered_IO) in

0 commit comments

Comments
 (0)