tools/qvm-run: use prefix_data feature instead of copy_stdin subprocess#468
tools/qvm-run: use prefix_data feature instead of copy_stdin subprocess#468marmarek merged 4 commits intoQubesOS:mainfrom
Conversation
Useful for services that use initial part of stdin for extra instructions, like qubes.VMShell. This requires --prefix-data support in qrexec-client, not only qrexec-client-vm. QubesOS/qubes-issues#10855
When resolving properties (or other calls) on '@dispvm' target, get the disposable template name as the target, not the object - qubesd_call() expects a string. Fixes: a6e0dcd "Use caller's default_dispvm as target for @dispvm"
The actual run_service() method defaults to subprocess.PIPE for stdin/stdout/stderr. Make mockup do the same. Adjust tests to be explicit about those parameters. This also adjusts handling stdout/stderr=subprocess.DEVNULL - in that case the process has stdout attribute set to NULL. And similarly for stderr.
Now that both qrexec-client and qrexec-client-vm supports --prefix-data feature, it can be used to feed the initial command to qubes.VMShell service. This means, the python part does not need write to stdin anymore, and qrexec's stdin can be connected directly to the qvm-run's stdi /dev/null if not needed). This avoids one data copy, but also removes multiprocessing.Process usage, which is problematic on Python 3.14 (it needs all arguments to be pickle-able due to changed start method). This change has a minor side effect: when using `qvm-run --dispvm=...` with a shell command, the admin.vm.feature.CheckWithTemplate+os call is now directed to the disposable template (before starting the disposable qube), instead of at the new disposable qube itself. This is because the shell command to inject now needs to be assembled before starting the disposable. Fixes QubesOS/qubes-issues#10855
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #468 +/- ##
==========================================
+ Coverage 76.79% 76.82% +0.03%
==========================================
Files 53 53
Lines 9367 9361 -6
==========================================
- Hits 7193 7192 -1
+ Misses 2174 2169 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026042316-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026032404-devel&flavor=update
Failed tests43 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/170766#dependencies 32 fixed
Unstable testsDetails
Performance TestsPerformance degradation:11 performance degradations
Remaining performance tests:100 tests
|
Do not rely on multiprocessing.Process() in qvm-run. See commit messages for more details.
This needs QubesOS/qubes-core-qrexec#230
Fixes QubesOS/qubes-issues#10855