◈ Passerelle

Use

Passerelle — User Guide

<strong>Status note (11 November 2026).</strong> The host tools (qshare, qrun) and the QNX driver binaries described here are the target user experience defined by the specification (DX-01 to DX-04). They land during weeks 2 to 4 of the hackathon schedule. Items not yet usable are marked <strong>[planned]</strong>. Everything marked <strong>[exists]</strong> works today. The portable libraries can already be built and unit tested on a Linux PC — see building.md.


1. Prerequisites

Component Requirement Notes
Host OS Linux (kernel ≥ 5.x, memfd support) macOS hosts work for 9P with QEMU ≥ 7.0, untested at foundation level; Windows hosts are not supported by QEMU 9P
QEMU ≥ 8.2 qemu-system-x86_64 or qemu-system-aarch64
Guest QNX SDP 8.0 (QNX Everywhere) Image built with mkqnximage, x86_64le or aarch64le
virtiofs only virtiofsd (Rust daemon) on the host Linux hosts only; feasibility test E5
Build tools CMake ≥ 3.16, C11 compiler qcc from the SDP for guest builds; any gcc/clang for PC builds

2. Installation

2.1 Host side <strong>[planned — week 2]</strong>

git clone https://github.com/Tradoooo/passerelle.git
cd passerelle
# qshare/qrun are Python 3 tools installed on PATH:
pip install --user host/qshare host/bench   # or copy host/qshare/qshare to ~/bin

2.2 Guest side

The driver binary (qnx-fs-9p or qnx-virtiofs) is cross-compiled with the SDP (see building.md) and embedded into the boot image with an mkqnximage snippet that qshare generates:

# local/snippets/system_files.custom  (generated by qshare --image-snippet)
/sbin/qnx-fs-9p

3. Quick Start: qshare <strong>[planned — DX-01]</strong>

$ qshare ~/project

qshare inspects the target architecture and prints (or, with --launch, directly runs) the QEMU command line:

It also emits the mkqnximage snippet that embeds the driver and mounts the share at boot, so the guest comes up with the folder already mounted at /host.

4. Mounting and Unmounting Inside the Guest

4.1 Mount

# Foreground, for debugging:
/sbin/qnx-fs-9p -t hostshare /host

# Or through the standard mount interface (QNX-07) [planned]:
mount -t pgw9p hostshare /host

Mount completes in under 50 ms (PERF-06).

4.2 Unmount

umount /host          # or: slay qnx-fs-9p

On unmount the virtio device is reset and all interrupt handlers are detached (VIO-09); unmount under load terminates cleanly (ROB-03).

5. Mount Options

Option Default Meaning Requirement
ro off (read-write) Read-only share; every write attempt fails with EROFS FS-09
noexec off Execution of binaries from the share is refused (EACCES) FS-09
nosuid <strong>on</strong> Set-user-ID bits on shared files are ignored; no privilege elevation SEC-01
attr_ttl=<ns> 0 (no cache) Bounded attribute-cache lifetime; hard ceiling 10 s (PGW_ATTR_CACHE_NS_MAX) FS-13, D4
msize=<bytes> 131072 9P maximum message size, 4096 … 4 MiB P9-01
timeout=<ms> 10000 Abandon a request unanswered after this delay ROB-05
inflight=<n> 32 Maximum requests in flight at once (1 … 256) P9-05

Defaults are defined once in common/include/pgw/limits.h <strong>[exists]</strong> and applied by pgw_fs_opts_default(). <strong>There is no data cache</strong>: a file modified on the PC is seen modified in the guest on the next read (FS-12, decision D4).

6. qrun — Execute From the Host <strong>[planned — DX-03]</strong>

$ qrun -- /host/build/my_program --flag     # runs inside the guest
$ echo $?                                    # exit code is propagated

qrun connects to the running VM, executes a program located on the share, and streams stdout/stderr and the exit status back to the host shell.

7. Project Examples (DX-04) <strong>[planned — week 3+]</strong>

7.1 CMake project

# Host: cross-compile for QNX, test binaries land in the share
cmake -B build-qnx -DCMAKE_TOOLCHAIN_FILE=$QNX_HOST/usr/cmake/QNXToolchain.cmake \
      -DCMAKE_SYSTEM_PROCESSOR=x86_64
cmake --build build-qnx -j8

# Run the guest test suite straight from the share — no copying:
qrun -- /host/build-qnx/ctest --output-on-failure

7.2 Rust project

cargo build --target x86_64-pc-nto-qnx8.0.0
qrun -- /host/target/x86_64-pc-nto-qnx8.0.0/debug/my_tests

Both patterns rely on execution and shared-library loading from the share (FS-06, feasibility test E3).

8. Troubleshooting

Symptom Likely cause Fix
mount hangs at boot Driver started before pci-server Order the IFS startup script so pci-server runs first (QNX-02)
Device not found (x86_64) Wrong QEMU device Use -virtfs ... (produces virtio-9p-pci, ID 0x1049/0x1009)
Device not found (ARM64) MMIO base mismatch Machine virt places virtio-mmio at fixed windows; pass the base reported by QEMU (-device virtio-mmio,... debug output)
No interrupts delivered MSI-X unavailable in this PCI configuration The driver retries with legacy INTx; check pci-server options (feasibility E1)
Slow throughput Tiny msize Mount with msize=131072 or larger; check host disk speed
Permission denied on files created by another user mapped-xattr stores ownership in host xattrs Run QEMU with the recommended security model; see SEC-03 in architecture.md §3.7
Stale attributes after editing on the host attr_ttl cache enabled Mount with attr_ttl=0 (the default)
Two files with the same inode number Share spans multiple host filesystems Add multidevs=remap to the QEMU -virtfs option
Case-insensitive lookups macOS host with case-insensitive APFS Documented host behavior; use a case-sensitive volume if needed
virtiofs daemon fails to start Missing memfd/shared memory config Ensure -object memory-backend-memfd,id=mem,size=...,share=on -numa node,memdev=mem (E5)

Diagnostics: the driver writes to the system log (slog2info) and exposes per-operation counters (QNX-08); kernel tracing shows per-request events (QNX-09) — use tracelogger/traceprinter to inspect them.

9. Where to Go Next