Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ components:
type: boolean
description: Whether to disable audio pass-through to the host
default: false
noClipboard:
type: boolean
description: Whether to disable clipboard sharing between host and guest
default: false
username:
type: string
description: SSH username to use when connecting to a VM
Expand Down
3 changes: 3 additions & 0 deletions internal/command/create/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var netBridged string
var headless bool
var nested bool
var noAudio bool
var noClipboard bool
var suspendable bool
var username string
var password string
Expand Down Expand Up @@ -72,6 +73,7 @@ func newCreateVMCommand() *cobra.Command {
command.Flags().BoolVar(&headless, "headless", true, "whether to run without graphics")
command.Flags().BoolVar(&nested, "nested", false, "enable nested virtualization")
command.Flags().BoolVar(&noAudio, "no-audio", false, "disable audio pass-through to the host")
command.Flags().BoolVar(&noClipboard, "no-clipboard", false, "disable clipboard sharing between host and guest")
command.Flags().BoolVar(&suspendable, "suspendable", false, "treat the VM as suspendable, "+
"disabling certain devices for suspendability support and issuing \"tart suspend\" instead of \"tart stop\" "+
"when VM's specification is updated, thus preserving the VM's state between specification generations")
Expand Down Expand Up @@ -159,6 +161,7 @@ func runCreateVM(cmd *cobra.Command, args []string) error {
Headless: headless,
Nested: nested,
NoAudio: noAudio,
NoClipboard: noClipboard,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject noClipboard for the Vetu runtime

With --runtime vetu --no-clipboard, this value is accepted by VM.Validate() and persisted, but the Vetu runner invokes only vetu run <id> and never consumes NoClipboard; therefore the request succeeds while the requested setting has no effect. Since only the Tart runner implements this option, reject it for RuntimeVetu as is already done for other Tart-only fields, or implement the equivalent Vetu behavior.

Useful? React with 👍 / 👎.

Username: username,
Password: password,
RandomSerial: randomSerial,
Expand Down
1 change: 1 addition & 0 deletions internal/command/get/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func runGetVM(cmd *cobra.Command, args []string) error {
table.AddRow("Headless mode", vm.Headless)
table.AddRow("Nested virtualization", vm.Nested)
table.AddRow("Audio disabled", vm.NoAudio)
table.AddRow("Clipboard sharing disabled", vm.NoClipboard)
table.AddRow("Status", vm.Status)
table.AddRow("Status message", vm.StatusMessage)
table.AddRow("Assigned worker", nonEmptyOrNone(vm.Worker))
Expand Down
4 changes: 4 additions & 0 deletions internal/worker/vmmanager/tart/tart.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ func (vm *VM) run(ctx context.Context, eventStreamer *client.EventStreamer) {
runArgs = append(runArgs, "--no-audio")
}

if vm.resource.NoClipboard {
runArgs = append(runArgs, "--no-clipboard")
}

if vm.resource.Suspendable {
runArgs = append(runArgs, "--suspendable")
}
Expand Down
1 change: 1 addition & 0 deletions pkg/resource/v1/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type VM struct {
Headless bool `json:"headless,omitempty"`
Nested bool `json:"nested,omitempty"`
NoAudio bool `json:"noAudio,omitempty"`
NoClipboard bool `json:"noClipboard,omitempty"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Put noClipboard in the mutable VM specification

When a client reads a running VM, changes noClipboard, and calls VMs.Update/PUT /vms/{name}, updateVMSpec compares and copies only the embedded VMSpec. Because this field is declared outside that struct, the controller returns the unchanged resource without incrementing Generation, so the worker never restarts Tart with the new setting. This is especially misleading because the OpenAPI schema exposes noClipboard as part of the request's VMSpec; include it in the Go VMSpec as well.

Useful? React with 👍 / 👎.


VMSpec
VMSpecReadOnly
Expand Down