-
Notifications
You must be signed in to change notification settings - Fork 292
Add pool-level field to limit VNC console access to one session per VM/host #6647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/limit-vnc-console
Are you sure you want to change the base?
Add pool-level field to limit VNC console access to one session per VM/host #6647
Conversation
a6d9ab5
to
df2787b
Compare
df2787b
to
aa00d9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase to update the commits before merge, thank you
ca81f54
to
881a2f7
Compare
Squashed the commits. |
Remove duplicated sign-off in commit message. |
This change introduces a new pool-level parameter that restricts VNC console access to a single active session per VM/host. This prevents multiple users from simultaneously connecting to the same VM console, preventing one user 'watching' another user operating a session. When the `limit_console_sessions` is true. - Enforced a single active VNC console connection per VM/host - Disable connection to websocket Signed-off-by: Stephen Cheng <[email protected]>
881a2f7
to
ee86ee9
Compare
Signed-off-by: Stephen Cheng <[email protected]>
Fixed comments and tested. |
ocaml/xapi/console.ml
Outdated
active_connections := VMSet.remove vm_id !active_connections | ||
) | ||
|
||
let try_add vm_id = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try_add
and remove
are too specific for the internal implementation.
How about try_acquire
and release
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we use map
instead of set
to record the connection count, it seems try_add
is better.
Changed remove
to drop
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use a Hashtbl which is stateful that does not require the update-and-assign? But I'm fine using Map because it is most similar to Set and code changes will be smaller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Hashtbl and Map are both fine. I considered Hashtbl. The reason I chose Map is that Map is immutable, which is more Ocaml style.
Signed-off-by: Stephen Cheng <[email protected]>
Hi @robhoes |
Signed-off-by: Stephen Cheng <[email protected]>
First commit:
Introduces a new pool-level parameter that restricts VNC console access
to a single active session per VM/host.
This prevents multiple users from simultaneously connecting to the same VM console,
preventing one user 'watching' another user operating a session.
Second commit:
When the
limit_console_sessions
is true.Tested:
true
Only one console can be connected:
false
Both consoles can be connected: