mirror of
https://dev.lirent.ru/Vatrog/vm-automation-signaling.git
synced 2026-06-26 04:36:37 +03:00
vmsig: management daemon, runtime endpoint lifecycle, roster, discovery, in-tree drivers, packaging
- core: runtime attach/detach of a per-endpoint adapter trio (runtime-safe add_adapter + vmsig_core_detach_endpoint, deferred reap) - roster: VMSIG_EV_ROSTER + CAP_ROSTER, retained per-endpoint and replayed to late subscribers - discovery: inotify trigger dir, vmid/endpoint slot allocator, host probe; vmsigd daemon with config + per-uid admission - input driver and vgpu perception built in-tree; vgpu perception as a separate library - memctx: own the supplied ro_fd (closed at detach) - deb packaging: install rules, systemd unit, tmpfiles, default config
This commit is contained in:
@@ -85,7 +85,7 @@ struct vmsig_adapter {
|
||||
int stub;
|
||||
const char* ram_path; /* armed: RAM-backing path (NOT published outward) */
|
||||
uint64_t low;
|
||||
int cfg_ro_fd; /* >=0 => infra-sealed RO-fd (policy); <0 => default */
|
||||
int cfg_ro_fd; /* >=0 => infra-sealed RO-fd (owned by adapter, closed in mc_close); <0 => default */
|
||||
vmsig_emit emit;
|
||||
int registered; /* register_memctx already called */
|
||||
vmsig_worker* worker; /* off-loop bootstrap + atomic writes */
|
||||
@@ -398,7 +398,11 @@ static void mc_close(vmsig_adapter* a) {
|
||||
if (a->win) vmie_win32_close(a->win); /* AFTER worker join: no in-flight gva_write */
|
||||
#endif
|
||||
if (a->stub_fd >= 0) close(a->stub_fd);
|
||||
/* cfg_ro_fd belongs to the infrastructure (the open caller) — do NOT close it. */
|
||||
/* ro_fd ownership transferred to the adapter at open(): close it here so a re-grant
|
||||
* (detach + re-attach with a fresh infra ro_fd) does not leak the prior one. Infra
|
||||
* that must keep its own copy dups before handing it in — symmetric to the holder
|
||||
* side, which dups the borrowed RO-fd it receives. */
|
||||
if (a->cfg_ro_fd >= 0) close(a->cfg_ro_fd);
|
||||
free(a);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user