Skip to content

[python/qemu-driver] _vsock_available function changes #169

Merged
bennyz merged 1 commit intojumpstarter-dev:mainfrom
odra:qemu-vsock
Jan 28, 2026
Merged

[python/qemu-driver] _vsock_available function changes #169
bennyz merged 1 commit intojumpstarter-dev:mainfrom
odra:qemu-vsock

Conversation

@odra
Copy link
Contributor

@odra odra commented Jan 27, 2026

Motvation

The driver fails to create a VM if vsock cannot be used.

Changes

  • Changes how _vsock_available identifies if vsock is available by checking /dev/vhost-vsock path and perms

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced socket availability detection with improved validation checks. Now accurately determines vsock availability by verifying path existence and access permissions, with proper handling for non-Linux systems.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Leonardo Rossetti <lrossett@redhat.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

The _vsock_available function in the QEMU driver was enhanced to accept an optional socket path parameter and now performs actual existence and permission checks on the vsock device file instead of relying solely on platform detection.

Changes

Cohort / File(s) Summary
QEMU Driver Enhancement
python/packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py
Updated _vsock_available() function signature to accept socket_path parameter (default: /dev/vhost-vsock). Enhanced logic to validate socket path exists and is readable/writable, with fallback behavior for non-Linux systems.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A socket path is now checked with care,
No more blind faith in the Linux air,
Existence and permissions we verify,
Before vsock dreams reach the sky,
Robust and true, our driver shall be!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: updates to the _vsock_available function that now checks /dev/vhost-vsock path and permissions instead of just checking the Linux platform.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bennyz bennyz changed the title [ptyhon/qemu-driver] _vsock_available function changes [python/qemu-driver] _vsock_available function changes Jan 28, 2026
Copy link
Member

@mangelajo mangelajo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiting for CI

@bennyz bennyz merged commit ef62dca into jumpstarter-dev:main Jan 28, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants