VirtualBox

Ticket #9039 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 weeks ago

controlvm subcommand to control clipboard mode

Reported by: liucougar Owned by:
Priority: major Component: clipboard
Version: VirtualBox 4.0.8 Keywords:
Cc: Guest type: Windows
Host type: Linux

Description (last modified by frank) (diff)

it's possible to modify clipboard mode when a VM is not running via modifyvm (though I could not find UI controls to change this)

but it's not possible to modify clipboard mode while a VM is running. the attached patch introduces "controlvm clipboard" command to add this feature

Attachments

control_clipboard.patch Download (7.1 KB) - added by liucougar 3 years ago.
proposed patch to add controlvm clipboard sub command

Change History

Changed 3 years ago by liucougar

proposed patch to add controlvm clipboard sub command

comment:1 Changed 3 years ago by liucougar

the title should starts with [PATCH], but it seems I could not modify it after creation

comment:2 Changed 3 years ago by Technologov

Interesting...

-Technologov

comment:3 Changed 3 years ago by liucougar

the patch is under MIT license

let me know if you need anything else before you can look at the patch

comment:4 Changed 3 years ago by liucougar

how this is useful

I am using multiple virtualbox VMs to run automated web 2.0 application functional tests. some of these tests actually uses clipboard (copy/paste), so shared clipboard would mess up all these tests.

review from klaus-vb on IRC

[12:51] <klaus-vb> liucougar: the idea is perfect, the implementation is not... this can be (and should be) done from IMachine::clipboardMode, like all other runtime editable settings.

[13:06] <klaus-vb> liucougar: nope... we don't have such duplicate user-visble APIs. we relay operations from IMachine to the VM through the not publicly accessible IInternalSessionControl interface. a very simple example is cpuexecutioncap. there we actually have the logic hooked up to event delivery. the other samples are harder to understand, as they are in other interfaces, such as INetworkAdapter or...
[13:06] <klaus-vb> ...IVRDEServer...
[13:08] <liucougar> klaus-vb: ok, I see, will take a look at cpuexecutioncap, and follow it

[13:08] <klaus-vb> ah, actually misread the code for cpuexecutioncap. that one really is 100% what you should do. in the VM there will be an internal method of the Guest class which is called from the new IInternalSessionControl method.
[13:10] <klaus-vb> we follow this approach for a good reason: often when we implement a new setting it's only changeable when the vm is not running. later we realize that it's possible to also handle it at runtime, and then our "don't modify public api" policy would get in the way if we'd follow your idea.
[13:11] <klaus-vb> messing with the tiny details of existing api methods and completely changing the internal apis is perfectly fine with any release.
[13:11] <klaus-vb> adding a new method would mean your change would only be acceptable for 4.1.0 or 4.2.0.
[13:12] <liucougar> klaus-vb: the new API you are talking about is IGuest::SetClipboardMode, right?
[13:12] <liucougar> new method
[13:12] <klaus-vb> correct. that would be the new public method.

comment:5 Changed 3 weeks ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)

This was actually implemented long time ago.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use