Commit 56c6abc
muvm-guest: pwbridge: forward fds on send
Any outgoing Pipewire message with num_fd > 0 previously hit
unimplemented!(), which in practice crashed the guest on the first
ClientNode.PortBuffers that any pw-stream / pw-filter client emits.
Handle fd-bearing send messages by draining the expected fds from
request_fds, converting each via vgpu_id_from_prime into a
CrossDomainResource + GemHandleFinalizer, and attaching them to the
StreamSendResult. If request_fds is short of what the header claims,
warn and return EIO instead of panicking.
Only ClientNode.PortBuffers is treated as fd-bearing on the send path.
Per the PipeWire 1.6 native protocol that is the only client->server
method whose fds are dma-buf candidates — each fd corresponds to an
SPA_Data in the submitted buffer pool. SecurityContext.Create is the
only other send-side method that carries fds (a unix socket + an
eventfd, neither of which are dma-bufs); it is not supported by this
bridge. Any other fd-bearing send message — a future protocol
addition, an unsupported interface, or a malformed client — warns and
returns EIO rather than blindly handing the fd to
DRM_IOCTL_PRIME_FD_TO_HANDLE, which would EINVAL on anything that
isn't a dma-buf and yield an opaque failure.
Replace the unreachable!() PipeWireResourceFinalizer stub with an
enum that dispatches to GemHandleFinalizer, so the finalizers
produced here actually run.
Signed-off-by: Adam Ford <[email protected]>1 parent c24672a commit 56c6abc
1 file changed
Lines changed: 42 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
173 | | - | |
174 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
349 | 354 | | |
350 | 355 | | |
351 | 356 | | |
| 357 | + | |
| 358 | + | |
352 | 359 | | |
353 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
354 | 387 | | |
355 | 388 | | |
356 | 389 | | |
357 | | - | |
358 | | - | |
| 390 | + | |
| 391 | + | |
359 | 392 | | |
360 | 393 | | |
361 | 394 | | |
| |||
0 commit comments