Skip to content

Add attached key for usb devices#2530

Merged
stgraber merged 3 commits intolxc:mainfrom
bensmrs:usb-attached
Oct 3, 2025
Merged

Add attached key for usb devices#2530
stgraber merged 3 commits intolxc:mainfrom
bensmrs:usb-attached

Conversation

@bensmrs
Copy link
Copy Markdown
Contributor

@bensmrs bensmrs commented Oct 3, 2025

Closes: #2505

@bensmrs bensmrs requested a review from stgraber as a code owner October 3, 2025 13:41
@github-actions github-actions bot added the Documentation Documentation needs updating label Oct 3, 2025
@bensmrs
Copy link
Copy Markdown
Contributor Author

bensmrs commented Oct 3, 2025

While writing the PR, I noticed that

oldAttached := util.IsTrueOrEmpty(oldDevices[d.name]["attached"])
newAttached := util.IsTrueOrEmpty(expandedDevices[d.name]["attached"])
if !oldAttached && newAttached {
runConf.Mounts = append(runConf.Mounts, deviceConfig.MountEntryItem{
DevName: d.name,
Attached: true,
})
} else if oldAttached && !newAttached {
runConf.Mounts = append(runConf.Mounts, deviceConfig.MountEntryItem{
DevName: d.name,
Attached: false,
})
}
should never actually be executed, as attached is not in UpdatableFields. I’ll investigate more.

@stgraber
Copy link
Copy Markdown
Member

stgraber commented Oct 3, 2025

@bensmrs we need an API extension on this one

Signed-off-by: Benjamin Somers <[email protected]>
@github-actions github-actions bot added the API Changes to the REST API label Oct 3, 2025
@stgraber stgraber merged commit ec71294 into lxc:main Oct 3, 2025
36 checks passed
@bensmrs bensmrs deleted the usb-attached branch October 9, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes to the REST API Documentation Documentation needs updating

Development

Successfully merging this pull request may close these issues.

Add a "detached" property for devices

2 participants