Skip to content

i/builtin: flag interfaces unsupported for parallel instances [p2] - #17704

Open
Mohit-Chachada wants to merge 8 commits into
canonical:masterfrom
Mohit-Chachada:parallel-instances-unsupported-iface-p2
Open

Mohit-Chachada wants to merge 8 commits into
canonical:masterfrom
Mohit-Chachada:parallel-instances-unsupported-iface-p2

Conversation

@Mohit-Chachada

@Mohit-Chachada Mohit-Chachada commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #17666. Only the last commit is new here.

See the previously prepared list of interfaces that do not support parallel instances. This change flags some of those interfaces with appropriate error msg that will be included in the user shown error when trying to parallel install such a snap.

Notes

  • Exception to the above list: i think the lxd interface can be allowed slot side parallel instances too after i/builtin: lxd interface allows access to the connected lxd parallel instance #17708 is fixed [ the list marked it unsupported on slot side ]
  • RFC for Open Points: The list allows it, but I am not sure if we should allow parallel instances on plug-side for
    • gpio-memory-control: similar concerns as shared-memory non-private mode
    • io-ports-control: concurrent/conflicting I/O privilege level changes and interrupt disabling from two instances could lead to a system-crash?
  • There are more interfaces that do not support parallel instances on only-slot side, but these will be handled in follow-ups to limit the PR size

SNAPDENG-37498

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Broad interface-policy changes and unresolved error-message inconsistencies warrant final human review.

Review effort: Balanced
Findings: None

What changed in this PR

Adds slot-side parallel-instance restrictions for built-in interfaces with appropriate system, gadget, and singleton-service errors.

Changes:

  • Introduces shared restriction errors and slot classification.
  • Flags unsupported parallel-instance slot providers.
  • Expands unit and integration coverage.
File Description
tests/​main/​parallel-install-iface-support/​task.yaml Adds allowed-plug and rejected-slot integration cases.
interfaces/​builtin/​login_session_observe.go Restricts parallel slot instances.
interfaces/​builtin/​login_session_control.go Restricts parallel slot instances.
interfaces/​builtin/​log_observe.go Restricts parallel slot instances.
interfaces/​builtin/​location_observe.go Restricts singleton service slots.
interfaces/​builtin/​location_control.go Restricts singleton service slots.
interfaces/​builtin/​locale_control.go Restricts parallel slot instances.
interfaces/​builtin/​libvirt.go Restricts parallel slot instances.
interfaces/​builtin/​kvm.go Restricts parallel slot instances.
interfaces/​builtin/​kernel_module_observe.go Restricts parallel slot instances.
interfaces/​builtin/​kernel_module_load.go Restricts parallel slot instances.
interfaces/​builtin/​kernel_module_control.go Restricts parallel slot instances.
interfaces/​builtin/​kernel_firmware_control.go Restricts parallel slot instances.
interfaces/​builtin/​kernel_crypto_api.go Restricts parallel slot instances.
interfaces/​builtin/​kerberos_tickets.go Restricts parallel slot instances.
interfaces/​builtin/​juju_client_observe.go Restricts parallel slot instances.
interfaces/​builtin/​joystick.go Restricts parallel slot instances.
interfaces/​builtin/​jack1.go Restricts parallel slot instances.
interfaces/​builtin/​ion_memory_control.go Restricts parallel slot instances.
interfaces/​builtin/​io_ports_control.go Restricts parallel slot instances.
interfaces/​builtin/​intel_qat.go Restricts parallel slot instances.
interfaces/​builtin/​intel_mei.go Restricts parallel slot instances.
interfaces/​builtin/​iio.go Adds system/gadget-aware slot checks.
interfaces/​builtin/​iio_test.go Tests system/gadget slot checks.
interfaces/​builtin/​i2c.go Adds system/gadget-aware slot checks.
interfaces/​builtin/​i2c_test.go Tests system/gadget slot checks.
interfaces/​builtin/​hugepages_control.go Restricts parallel slot instances.
interfaces/​builtin/​hostname_control.go Restricts parallel slot instances.
interfaces/​builtin/​home.go Restricts parallel slot instances.
interfaces/​builtin/​hidraw.go Adds system/gadget-aware slot checks.
interfaces/​builtin/​hidraw_test.go Tests system/gadget slot checks.
interfaces/​builtin/​hardware_random_observe.go Restricts parallel slot instances.
interfaces/​builtin/​hardware_random_control.go Restricts parallel slot instances.
interfaces/​builtin/​hardware_observe.go Restricts parallel slot instances.
interfaces/​builtin/​gsettings.go Restricts parallel slot instances.
interfaces/​builtin/​gpio.go Adds system/gadget-aware slot checks.
interfaces/​builtin/​gpio_test.go Tests system/gadget slot checks.
interfaces/​builtin/​gpio_memory_control.go Restricts parallel slot instances.
interfaces/​builtin/​gpio_control.go Restricts parallel slot instances.
interfaces/​builtin/​gpio_chardev.go Restricts gadget-provided slots.
interfaces/​builtin/​gpg_public_keys.go Restricts parallel slot instances.
interfaces/​builtin/​gpg_keys.go Restricts parallel slot instances.
interfaces/​builtin/​gconf.go Restricts parallel slot instances.
interfaces/​builtin/​fwupd.go Restricts singleton service slots.
interfaces/​builtin/​fuse_support.go Restricts parallel slot instances.
interfaces/​builtin/​framebuffer.go Restricts parallel slot instances.
interfaces/​builtin/​fpga.go Restricts parallel slot instances.
interfaces/​builtin/​firewall_control.go Restricts parallel slot instances.
interfaces/​builtin/​export_test.go Exposes parallel-instance errors to tests.
interfaces/​builtin/​dvb.go Restricts parallel slot instances.
interfaces/​builtin/​dsp.go Adds system/gadget-aware slot checks.
interfaces/​builtin/​dsp_test.go Tests system/gadget slot checks.
interfaces/​builtin/​docker.go Restricts slots. Nit (1 vote): app-provided slots should use the singleton-service reason, not the system-slot reason.
interfaces/​builtin/​display_control.go Restricts parallel slot instances.
interfaces/​builtin/​devlxd.go Restricts parallel slot instances.
interfaces/​builtin/​device_buttons.go Restricts parallel slot instances.
interfaces/​builtin/​desktop.go Restricts slots. Nit (1 vote): app-provided slots should use the singleton-service reason, not the system-slot reason.
interfaces/​builtin/​desktop_legacy.go Restricts parallel slot instances.
interfaces/​builtin/​desktop_launch.go Restricts parallel slot instances.
interfaces/​builtin/​dcdbas_control.go Restricts parallel slot instances.
interfaces/​builtin/​daemon_notify.go Restricts parallel slot instances.
interfaces/​builtin/​custom_device.go Restricts gadget-provided slots.
interfaces/​builtin/​cpu_control.go Restricts parallel slot instances.
interfaces/​builtin/​contacts_service.go Restricts parallel slot instances.
interfaces/​builtin/​confdb.go Restricts parallel slot instances.
interfaces/​builtin/​common.go Adds shared errors and slot classification logic.
interfaces/​builtin/​common_test.go Tests system/gadget error selection.
interfaces/​builtin/​cifs_mount.go Restricts parallel slot instances.
interfaces/​builtin/​can_bus.go Restricts parallel slot instances.
interfaces/​builtin/​camera.go Restricts parallel slot instances.
interfaces/​builtin/​calendar_service.go Restricts parallel slot instances.
interfaces/​builtin/​browser_support.go Restricts parallel slot instances.
interfaces/​builtin/​broadcom_asic_control.go Restricts parallel slot instances.
interfaces/​builtin/​bool_file.go Adds system/gadget-aware slot checks.
interfaces/​builtin/​bool_file_test.go Tests system/gadget slot checks.
interfaces/​builtin/​bluez.go Restricts singleton service slots.
interfaces/​builtin/​bluetooth_control.go Restricts parallel slot instances.
interfaces/​builtin/​block_devices.go Restricts parallel slot instances.
interfaces/​builtin/​avahi_observe.go Restricts singleton service slots.
interfaces/​builtin/​avahi_control.go Restricts singleton service slots.
interfaces/​builtin/​autopilot.go Restricts parallel slot instances.
interfaces/​builtin/​audio_playback.go Restricts singleton service slots.
interfaces/​builtin/​appstream_metadata.go Restricts parallel slot instances.
interfaces/​builtin/​alsa.go Restricts parallel slot instances.
interfaces/​builtin/​allegro_vcu.go Restricts parallel slot instances.
interfaces/​builtin/​all_test.go Covers the expanded slot restriction set.
interfaces/​builtin/​accounts_service.go Restricts parallel slot instances.
interfaces/​builtin/​account_control.go Restricts parallel slot instances.
interfaces/​builtin/​accel.go Restricts parallel slot instances.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Thu Sep 24 17:28:53 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/36022941943

Test Predictor Analysis

Preparing

Test Success %
openstack:ubuntu-20.04-64:tests/main/desktop-portal-open-uri 🟢 99.0%
openstack:ubuntu-20.04-64:tests/main/interfaces-block-devices-zfs 🟢 99.0%
openstack:ubuntu-20.04-64:tests/main/nss-modules:nis 🟢 90.0%
openstack:ubuntu-20.04-64:tests/main/nvidia-files:450_server 🟢 99.0%
openstack:ubuntu-20.04-64:tests/main/nvidia-files:470 🟢 99.0%
openstack:ubuntu-20.04-64:tests/main/nvidia-files:470_server 🟢 99.0%
openstack:ubuntu-20.04-64:tests/main/nvidia-files:550_server 🟢 99.0%
openstack:ubuntu-24.04-64:tests/main/lxd-postrm-purge 🟢 99.0%
openstack:ubuntu-core-24-64:tests/main/apparmor-prompting-support 🟢 90.0%

Executing

Test Success %
openstack:ubuntu-core-18-64:tests/core/services 🟢 99.0%

Restoring

Test Success %
openstack:ubuntu-24.04-64:tests/cross/go-build:s390x 🟢 99.0%

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list of the below tests you wish to run (unskip plus test list must be valid yaml)

  • openstack:arch-linux-64:tests/main/interfaces-location-control
  • openstack:debian-12-64:tests/main/interfaces-location-control
  • openstack:ubuntu-20.04-64:tests/main/interfaces-location-control
  • openstack:ubuntu-24.04-64:tests/main/auto-refresh-retry
  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-24.04-64:tests/main/interfaces-location-control
  • openstack:ubuntu-24.04-64:tests/main/network-retry
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/interfaces-location-control
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers

@Mohit-Chachada Mohit-Chachada changed the title Parallel instances unsupported iface p2 i/builtin: flag interfaces unsupported for parallel instances [p2] Sep 24, 2026
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.41%. Comparing base (cc32fd1) to head (1c56a8b).
⚠️ Report is 44 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17704      +/-   ##
==========================================
- Coverage   80.73%   78.41%   -2.32%     
==========================================
  Files        1414     1416       +2     
  Lines      199948   200743     +795     
  Branches     2502     2503       +1     
==========================================
- Hits       161433   157421    -4012     
+ Misses      33937    33902      -35     
- Partials     4578     9420    +4842     
Flag Coverage Δ
unittests 78.41% <100.00%> (-2.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Mohit-Chachada
Mohit-Chachada force-pushed the parallel-instances-unsupported-iface-p2 branch from 4fb2ae2 to 75d4c04 Compare September 24, 2026 11:41
@Mohit-Chachada
Mohit-Chachada force-pushed the parallel-instances-unsupported-iface-p2 branch from 75d4c04 to 1c56a8b Compare September 24, 2026 15:48

This branch has not been deployed

No deployments
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