Skip to content

Conversation

@leidwang
Copy link
Contributor

@leidwang leidwang commented Dec 15, 2025

  • Add viosock driver info(hwid/device name) in win_driver_utils.py
  • Configure viosock test variant in driver_load_stress.cfg
  • Configure viosock test variant in win_virtio_driver_update_test.cfg
  • Set vsock transfer parameters and background stress testing options

ID: 4313,4314,4315

Summary by CodeRabbit

  • New Features

    • Added VirtIO Socket (viosock) to driver metadata so viosock devices are recognized and handled.
  • Tests

    • Added test variants exercising VirtIO Socket data transfer, including stress and driver-update scenarios with background stress, file generation, transfer, and verification steps.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Walkthrough

Added VirtIO Socket (viosock) support: a new "viosock" entry in provider/win_driver_utils.py with HWID and device_name, plus a with_viosock variant in qemu/tests/cfg/driver_load_stress.cfg and a with_viosock variant in qemu/tests/cfg/win_virtio_driver_update_test.cfg that configure vsock devices, port 2222, test tooling, file generation, MD5 verification, and send/receive transfer commands.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly summarizes the main change: adding viosock driver support for update tests, which is directly reflected in the modifications to win_driver_utils.py and test configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b56b187 and c9c25c6.

📒 Files selected for processing (3)
  • provider/win_driver_utils.py
  • qemu/tests/cfg/driver_load_stress.cfg
  • qemu/tests/cfg/win_virtio_driver_update_test.cfg
🚧 Files skipped from review as they are similar to previous changes (2)
  • provider/win_driver_utils.py
  • qemu/tests/cfg/driver_load_stress.cfg
🔇 Additional comments (1)
qemu/tests/cfg/win_virtio_driver_update_test.cfg (1)

335-353: Verify version requirements, driver verifier name, and test tool execution syntax.

The with_viosock variant appears structurally sound and follows the established pattern. However, confirm the following before merge:

  1. Version requirements (lines 343–344): Verify that required_virtio_win_prewhql = [0.1.294, ) and required_virtio_win = [1.9.51.0, ) are the correct minimum versions for viosock support.

  2. Driver verifier name (line 339): Confirm that "VirtioSocket" is the exact driver verifier name expected by Windows driver verification (as used in device manager or devcon output).

  3. Test tool and commands (lines 346–353): The receive_data_cmd (line 352) uses a single backslash in C:\${test_tool}, which should resolve correctly in shell context. Additionally, verify that send_data_cmd (line 353) with the %s placeholder correctly substitutes the CID or peer address at runtime.

  4. Device HWIDs (line 341): Cross-reference the HWIDs with the viosock entry added to provider/win_driver_utils.py to ensure they match.


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.

@leidwang leidwang force-pushed the vsock_driver_testing branch from e85e56c to 22de3c1 Compare December 15, 2025 07:19
@leidwang leidwang changed the title win_virtio_drivers: add viosock driver support for stress and update tests win_virtio_drivers: add viosock driver support for update tests Dec 15, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
qemu/tests/cfg/win_virtio_driver_update_test.cfg (1)

335-356: Consider removing redundant cdroms += " virtio" in with_viosock

The with_viosock variant wiring (driver name, device name, HWIDs, vsock settings, transfer commands) looks consistent with the Python driver metadata and the stress variant. However, the base test already sets cdroms += " virtio winutils", so adding cdroms += " virtio" again here likely just duplicates the same CD-ROM alias and can be confusing. If no extra CD is actually needed, consider dropping this line.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46fefae and e85e56c.

📒 Files selected for processing (3)
  • provider/win_driver_utils.py (1 hunks)
  • qemu/tests/cfg/driver_load_stress.cfg (1 hunks)
  • qemu/tests/cfg/win_virtio_driver_update_test.cfg (1 hunks)
🔇 Additional comments (1)
provider/win_driver_utils.py (1)

63-66: Viosock driver metadata is consistent with existing entries

The new viosock entry mirrors the structure of other PCI drivers and matches the device_hwid/device_name used in the cfg variants, so it should integrate cleanly with the existing helper functions.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
qemu/tests/cfg/driver_load_stress.cfg (1)

236-257: Previous review feedback still applies.

A past review already flagged the missing driver_id_pattern and redundant cdroms += " virtio" line. Additionally, virtio_win_media_type = iso on line 246 is also redundant since the base configuration already sets it at line 10.

🧹 Nitpick comments (1)
qemu/tests/cfg/win_virtio_driver_update_test.cfg (1)

335-356: Add driver_id_pattern and remove redundant settings.

The variant is missing driver_id_pattern, which other driver variants in this file use for device identification (see with_viomem at line 333, with_viofs at line 256). Additionally, lines 344-345 are redundant since the base configuration already sets cdroms += " virtio winutils" (line 6) and virtio_win_media_type = iso (line 10).

         - with_viosock:
             no Host_RHEL.m6 Host_RHEL.m7 Host_RHEL.m8
             no during_bg_test
             vsocks = vhost_vsock0
             driver_name = "viosock"
             driver_verifier = "VirtioSocket"
             device_name = "VirtIO Socket Driver"
             device_hwid = '"PCI\VEN_1AF4&DEV_1053" "PCI\VEN_1AF4&DEV_1012"'
+            driver_id_pattern = "(.*?):.*?VirtIO Socket Driver"
             run_bgstress = vsock_transfer_data
-            cdroms += " virtio"
-            virtio_win_media_type = iso
             required_virtio_win_prewhql = [0.1.294, )
             required_virtio_win = [1.9.51.0, )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e85e56c and 22de3c1.

📒 Files selected for processing (3)
  • provider/win_driver_utils.py (1 hunks)
  • qemu/tests/cfg/driver_load_stress.cfg (1 hunks)
  • qemu/tests/cfg/win_virtio_driver_update_test.cfg (1 hunks)
🔇 Additional comments (1)
provider/win_driver_utils.py (1)

63-66: LGTM!

The viosock driver entry follows the established pattern and is consistent with the viomem entry above (both use raw strings). The hardware IDs (DEV_1053 for modern/1.0+ and DEV_1012 for legacy/transitional) are correct for the VirtIO Socket device.

@leidwang leidwang force-pushed the vsock_driver_testing branch from 22de3c1 to fd31e94 Compare December 15, 2025 07:23
@leidwang
Copy link
Contributor Author

depends on avocado-framework/avocado-vt#4287

@leidwang
Copy link
Contributor Author

depends on #4422

@leidwang
Copy link
Contributor Author

leidwang commented Dec 15, 2025

uninstall_install and downgrade_upgrade test results:
JOB LOG : /root/avocado/job-results/job-2025-12-15T06.59-fcf7629/job.log
(1/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.uninstall_install.q35: STARTED
(1/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.uninstall_install.q35: PASS (520.29 s)
(2/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.downgrade_upgrade.q35: STARTED
(2/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.downgrade_upgrade.q35: PASS (597.87 s)
(3/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.uninstall_install.q35: STARTED
(3/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.uninstall_install.q35: PASS (452.52 s)
(4/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.downgrade_upgrade.q35: STARTED
(4/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.downgrade_upgrade.q35: PASS (510.95 s)

@leidwang leidwang force-pushed the vsock_driver_testing branch from fd31e94 to 0ed60ef Compare December 15, 2025 09:51
@leidwang
Copy link
Contributor Author

disable/enable test results:
JOB LOG : /root/avocado/job-results/job-2025-12-15T04.46-bbb9f73/job.log
(1/2) Host_RHEL.m10.u.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.before_bg_test.q35: STARTED
(1/2) Host_RHEL.m10.u.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.before_bg_test.q35: PASS (196.97 s)
(2/2) Host_RHEL.m10.u.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.after_bg_test.q35: STARTED
(2/2) Host_RHEL.m10.u.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.after_bg_test.q35: PASS (202.61 s)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
qemu/tests/cfg/win_virtio_driver_update_test.cfg (1)

335-356: Viosock downgrade/upgrade still hits missing-driver ISO; consider gating + verify driver_verifier name

Given your job log, with_viosock.*.downgrade_upgrade will continue to fail until cdrom_virtio_downgrade points to an ISO that actually contains viosock.inf. Right now this variant only disables during_bg_test, so downgrade/upgrade remains in the matrix.

If you don’t plan to update the downgrade ISO immediately, I’d recommend gating downgrade/upgrade for viosock to avoid environment‑driven false negatives:

        - with_viosock:
             no Host_RHEL.m6 Host_RHEL.m7 Host_RHEL.m8
             no during_bg_test
+            no downgrade_upgrade
             vsocks = vhost_vsock0
             driver_name = "viosock"
             driver_verifier = "VirtioSocket"

Also, please double‑check that driver_verifier = "VirtioSocket" matches the actual name Windows Driver Verifier expects for this driver; if the string is off, DV won’t actually be applied even though the test passes.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd31e94 and 0ed60ef.

📒 Files selected for processing (3)
  • provider/win_driver_utils.py (1 hunks)
  • qemu/tests/cfg/driver_load_stress.cfg (1 hunks)
  • qemu/tests/cfg/win_virtio_driver_update_test.cfg (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • qemu/tests/cfg/driver_load_stress.cfg
  • provider/win_driver_utils.py

@leidwang leidwang force-pushed the vsock_driver_testing branch from 0ed60ef to b56b187 Compare December 16, 2025 05:55
@leidwang
Copy link
Contributor Author

Hi @xiagao Could you please review this PR?Thanks.

- Add viosock driver info(hwid/device name) in win_driver_utils.py
- Configure viosock test variant in driver_load_stress.cfg
- Configure viosock test variant in win_virtio_driver_update_test.cfg
- Set vsock transfer parameters and background stress testing options

ID: 4313,4314,4315

Signed-off-by: Leidong Wang <[email protected]>
@leidwang leidwang force-pushed the vsock_driver_testing branch from b56b187 to c9c25c6 Compare December 23, 2025 06:25
@leidwang
Copy link
Contributor Author

Latest test results:
JOB LOG : /root/avocado/job-results/job-2025-12-23T00.46-d20ef40/job.log
(1/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.uninstall_install.q35: STARTED
(1/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.uninstall_install.q35: PASS (583.24 s)
(2/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.downgrade_upgrade.q35: STARTED
(2/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.before_bg_test.downgrade_upgrade.q35: PASS (656.14 s)
(3/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.during_bg_test.uninstall_install.q35: STARTED
(3/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.during_bg_test.uninstall_install.q35: PASS (453.84 s)
(4/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.during_bg_test.downgrade_upgrade.q35: STARTED
(4/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.during_bg_test.downgrade_upgrade.q35: PASS (528.99 s)
(5/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.uninstall_install.q35: STARTED
(5/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.uninstall_install.q35: PASS (458.60 s)
(6/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.downgrade_upgrade.q35: STARTED
(6/6) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.win_virtio_driver_update_test.with_viosock.after_bg_test.downgrade_upgrade.q35: PASS (536.36 s)

JOB LOG : /root/avocado/job-results/job-2025-12-23T00.17-7c3b28a/job.log
(1/3) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.before_bg_test.q35: STARTED
(1/3) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.before_bg_test.q35: PASS (225.98 s)
(2/3) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.during_bg_test.q35: STARTED
(2/3) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.during_bg_test.q35: PASS (226.30 s)
(3/3) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.after_bg_test.q35: STARTED
(3/3) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.driver_load_stress.with_viosock.after_bg_test.q35: PASS (229.17 s)

Copy link
Contributor

@xiagao xiagao left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

2 participants