Skip to content

xapi/attach_helpers: remove useless check for leaked vbds #7035

Draft
psafont wants to merge 2 commits intomasterfrom
dev/pau/control-domain
Draft

xapi/attach_helpers: remove useless check for leaked vbds #7035
psafont wants to merge 2 commits intomasterfrom
dev/pau/control-domain

Conversation

@psafont
Copy link
Copy Markdown
Member

@psafont psafont commented Apr 24, 2026

Looks like this mechanism was used in the past, and only one vestigial
check on VBD creation was used.

It does not make sense to create a VBD associated with a task and
immediately check whether it has leaked.

psafont added 2 commits April 24, 2026 17:14
Gate the checks done for the other_config keys task_id and related_to to
VBDs associated with control domains

Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
Looks like this mechanism was used in the past, and only one vestigial
check on VBD creation was used.

It does not make sense to create a VBD associated with a task and
immediately check whether it has leaked.

Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
Comment thread ocaml/xapi/attach_helpers.ml Outdated
let has_task = List.mem_assoc Xapi_globs.vbd_task_key other_config in
let has_related = List.mem_assoc Xapi_globs.related_to_key other_config in
if (not has_task) && not has_related then (
if (not can_leak) || ((not has_task) && not has_related) then (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If not can_leak means "not a control domain", doesn't this conflict with the comment below?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh it's all gone in the second commit...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can find this code is used on vdi clone and copy, so there was nothing to ensure this code applied to only control domains. I believe the comment to be wrong.

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