VirtualBox

Opened 13 years ago

Closed 11 years ago

#9039 closed enhancement (fixed)

controlvm subcommand to control clipboard mode

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

Description (last modified by Frank Mehnert)

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 (1)

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

Download all attachments as: .zip

Change History (6)

by liucougar, 13 years ago

Attachment: control_clipboard.patch added

proposed patch to add controlvm clipboard sub command

comment:1 by liucougar, 13 years ago

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

comment:2 by Technologov, 13 years ago

Interesting...

-Technologov

comment:3 by liucougar, 13 years ago

the patch is under MIT license

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

comment:4 by liucougar, 13 years ago

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 by Frank Mehnert, 11 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

This was actually implemented long time ago.

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette