Skip to main content

import_guest_namespace

Function import_guest_namespace 

Source
pub async fn import_guest_namespace(
    host_ns: &mut Namespace,
    export_sock: &Path,
    tenant: &str,
) -> Result<ImportedGuestNamespace>
Expand description

Import the guest’s live namespace (Direction B, #708 phase 2): dial the guest’s export socket with the phase-1 socket 9P client Remote9pMount, and bind the resulting Mount into host_ns at /workers/<tenant>/wanix, giving the host visibility into the guest’s task tree.

Call this after the sandbox has been started: the export socket appears only once the guest boots and listen(2)s, so the dial is retried with bounded backoff ([IMPORT_CONNECT_ATTEMPTS]). export_sock is the host-side WanixInjection::export_socket_path.

This is the reverse, independent 9P session of the Direction-A export the host serves in inject_9p_socket — a separate socket, a separate client, no shared coupling (#708).