Skip to content

seat: preserve current VT on transient update failures and fix errno semantics for free-VT lookup#4

Closed
Copilot wants to merge 3 commits into
dde/0.9.3from
copilot/fix-code-for-comments
Closed

seat: preserve current VT on transient update failures and fix errno semantics for free-VT lookup#4
Copilot wants to merge 3 commits into
dde/0.9.3from
copilot/fix-code-for-comments

Conversation

Copy link
Copy Markdown

Copilot AI commented Jun 2, 2026

This PR addresses the remaining review feedback in thread pullrequestreview-4409920047 for the new control-socket VT APIs. The updates are scoped to seatd/seat.c and align behavior with existing VT-state assumptions.

  • Keep cur_vt stable on VT refresh failures

    • In seat_update_vt(), failures from terminal_open(0) or invalid results from terminal_current_vt() no longer overwrite seat->cur_vt.
    • Errors are still propagated via -1/errno, but transient query failures no longer corrupt seat state used by VT signal paths.
  • Preserve accurate errno behavior in seat_find_available_vt()

    • errno is now restored only on failure (vt == -1), not unconditionally.
    • This avoids success paths returning with stale non-zero errno.

Example of the errno behavior fix:

int vt = terminal_find_available(tty0fd);
int saved_errno = errno;
close(tty0fd);
if (vt == -1) {
	errno = saved_errno;
}
return vt;

@deepin-ci-robot
Copy link
Copy Markdown

Hi @Copilot. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

JiDe Zhang and others added 2 commits June 2, 2026 13:16
Add active-vt, free-vt, and switch-vt control operations so DDM can stop issuing VT ioctls directly.

添加 active-vt、free-vt 和 switch-vt control 操作,使DDM不再直接发起VT ioctl。

Reuse the existing seat VT state machine for grouped and unmanaged switches.

复用现有 seat VT 状态机处理 grouped 与非托管切换。

Log: 为control socket补齐VT管理能力

Influence: DDM可通过dde-seatd统一查询和切换VT,减少双写状态机。
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Copilot

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI changed the title [WIP] Fix code for all comments in review thread seat: preserve current VT on transient update failures and fix errno semantics for free-VT lookup Jun 2, 2026
Copilot finished work on behalf of zccrs June 2, 2026 13:17
Copilot AI requested a review from zccrs June 2, 2026 13:17
@zccrs
Copy link
Copy Markdown
Member

zccrs commented Jun 3, 2026

用不到了

@zccrs zccrs closed this Jun 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

CLA Assistant Lite bot:
提交邮箱中包含我们的合作伙伴,但您似乎并非合作伙伴的成员或对接人,请联系相关对接人将您添加至组织之中,或由其重新发起 Pull Request。
The commit email domain belongs to one of our partners, but it seems you are not yet a member of the current organization, please contact the contact person to add you to the organization or let them submit the Pull Request.

JiDe Zhang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants