virtualbox 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +11 -5
- data/TODO.md +7 -0
- data/lib/virtualbox.rb +34 -8
- data/lib/virtualbox/abstract_model.rb +7 -8
- data/lib/virtualbox/abstract_model/attributable.rb +16 -2
- data/lib/virtualbox/abstract_model/interface_attributes.rb +10 -1
- data/lib/virtualbox/abstract_model/relatable.rb +11 -0
- data/lib/virtualbox/appliance.rb +1 -1
- data/lib/virtualbox/com.rb +13 -12
- data/lib/virtualbox/com/abstract_enum.rb +21 -5
- data/lib/virtualbox/com/abstract_interface.rb +11 -0
- data/lib/virtualbox/com/base_interface.rb +1 -32
- data/lib/virtualbox/com/{ffi/vboxxpcomc.rb → ffi.rb} +7 -0
- data/lib/virtualbox/com/ffi/interface.rb +10 -27
- data/lib/virtualbox/com/ffi/util.rb +32 -2
- data/lib/virtualbox/com/ffi_interface.rb +8 -2
- data/lib/virtualbox/com/implementer.rb +10 -0
- data/lib/virtualbox/com/implementer/base.rb +10 -3
- data/lib/virtualbox/com/implementer/ffi.rb +40 -13
- data/lib/virtualbox/com/implementer/mscom.rb +18 -1
- data/lib/virtualbox/com/interface/4.0.x/{access_mode.rb → AccessMode.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{appliance.rb → Appliance.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{audio_adapter.rb → AudioAdapter.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{audio_controller_type.rb → AudioControllerType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{audio_driver_type.rb → AudioDriverType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{auth_type.rb → AuthType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bios_boot_menu_mode.rb → BIOSBootMenuMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bios_settings.rb → BIOSSettings.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{bandwidth_control.rb → BandwidthControl.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bandwidth_group.rb → BandwidthGroup.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bandwidth_group_type.rb → BandwidthGroupType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{chipset_type.rb → ChipsetType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{cleanup_mode.rb → CleanupMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{clipboard_mode.rb → ClipboardMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{console.rb → Console.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{cpu_property_type.rb → CpuPropertyType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{dhcp_server.rb → DHCPServer.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{data_type.rb → DataType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{device_type.rb → DeviceType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{event_source.rb → EventSource.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{fault_tolerance_state.rb → FaultToleranceState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{firmware_type.rb → FirmwareType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{guest.rb → Guest.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{guest_os_type.rb → GuestOSType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{hw_virt_ex_property_type.rb → HWVirtExPropertyType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host.rb → Host.rb} +6 -6
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface.rb → HostNetworkInterface.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface_medium_type.rb → HostNetworkInterfaceMediumType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface_status.rb → HostNetworkInterfaceStatus.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface_type.rb → HostNetworkInterfaceType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_usb_device.rb → HostUSBDevice.rb} +3 -1
- data/lib/virtualbox/com/interface/4.0.x/{host_usb_device_filter.rb → HostUSBDeviceFilter.rb} +3 -1
- data/lib/virtualbox/com/interface/4.0.x/{keyboard_hid_type.rb → KeyboardHidType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{lock_type.rb → LockType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{machine.rb → Machine.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{machine_state.rb → MachineState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium.rb → Medium.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_attachment.rb → MediumAttachment.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_format.rb → MediumFormat.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_state.rb → MediumState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_type.rb → MediumType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_variant.rb → MediumVariant.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nat_alias_mode.rb → NATAliasMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nat_engine.rb → NATEngine.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nat_protocol.rb → NATProtocol.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nsiexception.rb → NSIException.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nsisupports.rb → NSISupports.rb} +3 -0
- data/lib/virtualbox/com/interface/4.0.x/{network_adapter.rb → NetworkAdapter.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{network_adapter_type.rb → NetworkAdapterType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{network_attachment_type.rb → NetworkAttachmentType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{parallel_port.rb → ParallelPort.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{pci_device_attachment.rb → PciDeviceAttachment.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{pointing_hid_type.rb → PointingHidType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{port_mode.rb → PortMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{progress.rb → Progress.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{serial_port.rb → SerialPort.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{session.rb → Session.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{session_state.rb → SessionState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{session_type.rb → SessionType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{shared_folder.rb → SharedFolder.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{snapshot.rb → Snapshot.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{storage_bus.rb → StorageBus.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{storage_controller.rb → StorageController.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{storage_controller_type.rb → StorageControllerType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{system_properties.rb → SystemProperties.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_controller.rb → USBController.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device.rb → USBDevice.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device_filter.rb → USBDeviceFilter.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device_filter_action.rb → USBDeviceFilterAction.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device_state.rb → USBDeviceState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{vrde_server.rb → VRDEServer.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{virtualbox.rb → VirtualBox.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{virtual_box_error_info.rb → VirtualBoxErrorInfo.rb} +3 -1
- data/lib/virtualbox/com/interface/4.0.x/{virtual_system_description.rb → VirtualSystemDescription.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{virtual_system_description_type.rb → VirtualSystemDescriptionType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{virtual_system_description_value_type.rb → VirtualSystemDescriptionValueType.rb} +0 -0
- data/lib/virtualbox/com/interface/{3.2.x/access_mode.rb → 4.1.x/AccessMode.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacility.rb +17 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacilityClass.rb +17 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacilityStatus.rb +19 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacilityType.rb +17 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsRunLevelType.rb +14 -0
- data/lib/virtualbox/com/interface/{3.2.x/appliance.rb → 4.1.x/Appliance.rb} +5 -4
- data/lib/virtualbox/com/interface/{3.1.x/audio_adapter.rb → 4.1.x/AudioAdapter.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/audio_controller_type.rb → 4.1.x/AudioControllerType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/audio_driver_type.rb → 4.1.x/AudioDriverType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/vrdp_auth_type.rb → 4.1.x/AuthType.rb} +3 -3
- data/lib/virtualbox/com/interface/{3.1.x/bios_boot_menu_mode.rb → 4.1.x/BIOSBootMenuMode.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/bios_settings.rb → 4.1.x/BIOSSettings.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/BandwidthControl.rb +18 -0
- data/lib/virtualbox/com/interface/4.1.x/BandwidthGroup.rb +16 -0
- data/lib/virtualbox/com/interface/4.1.x/BandwidthGroupType.rb +11 -0
- data/lib/virtualbox/com/interface/4.1.x/ChipsetType.rb +11 -0
- data/lib/virtualbox/com/interface/4.1.x/CleanupMode.rb +12 -0
- data/lib/virtualbox/com/interface/{3.2.x/clipboard_mode.rb → 4.1.x/ClipboardMode.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/CloneMode.rb +13 -0
- data/lib/virtualbox/com/interface/4.1.x/CloneOptions.rb +14 -0
- data/lib/virtualbox/com/interface/{3.1.x/console.rb → 4.1.x/Console.rb} +10 -7
- data/lib/virtualbox/com/interface/{3.2.x/cpu_property_type.rb → 4.1.x/CpuPropertyType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/dhcp_server.rb → 4.1.x/DHCPServer.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/DataType.rb +11 -0
- data/lib/virtualbox/com/interface/{3.1.x/device_type.rb → 4.1.x/DeviceType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/DirectoryCreateFlag.rb +12 -0
- data/lib/virtualbox/com/interface/4.1.x/DirectoryOpenFlag.rb +11 -0
- data/lib/virtualbox/com/interface/{3.2.x/guest.rb → 4.1.x/EventSource.rb} +4 -4
- data/lib/virtualbox/com/interface/4.1.x/ExecuteProcessFlag.rb +15 -0
- data/lib/virtualbox/com/interface/4.1.x/ExecuteProcessStatus.rb +19 -0
- data/lib/virtualbox/com/interface/4.1.x/FaultToleranceState.rb +11 -0
- data/lib/virtualbox/com/interface/{3.1.x/firmware_type.rb → 4.1.x/FirmwareType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/Guest.rb +36 -0
- data/lib/virtualbox/com/interface/4.1.x/GuestDirEntry.rb +15 -0
- data/lib/virtualbox/com/interface/4.1.x/GuestDirEntryType.rb +14 -0
- data/lib/virtualbox/com/interface/{3.2.x/guest_os_type.rb → 4.1.x/GuestOSType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/hw_virt_ex_property_type.rb → 4.1.x/HWVirtExPropertyType.rb} +4 -3
- data/lib/virtualbox/com/interface/{3.1.x/host.rb → 4.1.x/Host.rb} +8 -6
- data/lib/virtualbox/com/interface/{3.1.x/host_network_interface.rb → 4.1.x/HostNetworkInterface.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/host_network_interface_medium_type.rb → 4.1.x/HostNetworkInterfaceMediumType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/host_network_interface_status.rb → 4.1.x/HostNetworkInterfaceStatus.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/host_network_interface_type.rb → 4.1.x/HostNetworkInterfaceType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/host_usb_device.rb → 4.1.x/HostUSBDevice.rb} +4 -2
- data/lib/virtualbox/com/interface/{3.2.x/host_usb_device_filter.rb → 4.1.x/HostUSBDeviceFilter.rb} +4 -2
- data/lib/virtualbox/com/interface/4.1.x/ImportOptions.rb +12 -0
- data/lib/virtualbox/com/interface/{3.2.x/keyboard_hid_type.rb → 4.1.x/KeyboardHidType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/LockType.rb +11 -0
- data/lib/virtualbox/com/interface/{3.2.x/machine.rb → 4.1.x/Machine.rb} +34 -15
- data/lib/virtualbox/com/interface/{3.1.x/machine_state.rb → 4.1.x/MachineState.rb} +1 -1
- data/lib/virtualbox/com/interface/{3.2.x/medium.rb → 4.1.x/Medium.rb} +5 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_attachment.rb → 4.1.x/MediumAttachment.rb} +6 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_format.rb → 4.1.x/MediumFormat.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_state.rb → 4.1.x/MediumState.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/medium_type.rb → 4.1.x/MediumType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_variant.rb → 4.1.x/MediumVariant.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/nat_alias_mode.rb → 4.1.x/NATAliasMode.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/nat_engine.rb → 4.1.x/NATEngine.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/nat_protocol.rb → 4.1.x/NATProtocol.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/nsiexception.rb → 4.1.x/NSIException.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/nsisupports.rb → 4.1.x/NSISupports.rb} +4 -1
- data/lib/virtualbox/com/interface/{3.2.x/network_adapter.rb → 4.1.x/NetworkAdapter.rb} +11 -11
- data/lib/virtualbox/com/interface/4.1.x/NetworkAdapterPromiscModePolicy.rb +13 -0
- data/lib/virtualbox/com/interface/{3.1.x/network_adapter_type.rb → 4.1.x/NetworkAdapterType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/network_attachment_type.rb → 4.1.x/NetworkAttachmentType.rb} +3 -3
- data/lib/virtualbox/com/interface/{3.2.x/parallel_port.rb → 4.1.x/ParallelPort.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/PciDeviceAttachment.rb +16 -0
- data/lib/virtualbox/com/interface/{3.2.x/pointing_hid_type.rb → 4.1.x/PointingHidType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/port_mode.rb → 4.1.x/PortMode.rb} +1 -1
- data/lib/virtualbox/com/interface/4.1.x/ProcessOutputFlag.rb +12 -0
- data/lib/virtualbox/com/interface/{3.2.x/progress.rb → 4.1.x/Progress.rb} +3 -1
- data/lib/virtualbox/com/interface/{3.1.x/serial_port.rb → 4.1.x/SerialPort.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/session.rb → 4.1.x/Session.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/session_state.rb → 4.1.x/SessionState.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/session_type.rb → 4.1.x/SessionType.rb} +3 -3
- data/lib/virtualbox/com/interface/4.1.x/SettingsVersion.rb +25 -0
- data/lib/virtualbox/com/interface/{3.1.x/shared_folder.rb → 4.1.x/SharedFolder.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/snapshot.rb → 4.1.x/Snapshot.rb} +3 -2
- data/lib/virtualbox/com/interface/{3.2.x/storage_bus.rb → 4.1.x/StorageBus.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/storage_controller.rb → 4.1.x/StorageController.rb} +3 -2
- data/lib/virtualbox/com/interface/{3.2.x/storage_controller_type.rb → 4.1.x/StorageControllerType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/StorageDeviceChangedEvent.rb +14 -0
- data/lib/virtualbox/com/interface/{3.2.x/system_properties.rb → 4.1.x/SystemProperties.rb} +8 -6
- data/lib/virtualbox/com/interface/{3.2.x/usb_controller.rb → 4.1.x/USBController.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/usb_device.rb → 4.1.x/USBDevice.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/usb_device_filter.rb → 4.1.x/USBDeviceFilter.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/usb_device_filter_action.rb → 4.1.x/USBDeviceFilterAction.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/usb_device_state.rb → 4.1.x/USBDeviceState.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/VRDEServer.rb +23 -0
- data/lib/virtualbox/com/interface/{3.2.x/virtualbox.rb → 4.1.x/VirtualBox.rb} +13 -27
- data/lib/virtualbox/com/interface/{3.2.x/virtual_box_error_info.rb → 4.1.x/VirtualBoxErrorInfo.rb} +4 -2
- data/lib/virtualbox/com/interface/{3.2.x/virtual_system_description.rb → 4.1.x/VirtualSystemDescription.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/VirtualSystemDescriptionType.rb +34 -0
- data/lib/virtualbox/com/interface/{3.2.x/virtual_system_description_value_type.rb → 4.1.x/VirtualSystemDescriptionValueType.rb} +1 -1
- data/lib/virtualbox/com/util.rb +30 -8
- data/lib/virtualbox/exceptions.rb +14 -13
- data/lib/virtualbox/extra_data.rb +2 -0
- data/lib/virtualbox/hard_drive.rb +1 -1
- data/lib/virtualbox/host_network_interface.rb +1 -1
- data/lib/virtualbox/lib.rb +2 -0
- data/lib/virtualbox/medium.rb +2 -0
- data/lib/virtualbox/network_adapter.rb +6 -22
- data/lib/virtualbox/proxies.rb +6 -0
- data/lib/virtualbox/system_properties.rb +0 -1
- data/lib/virtualbox/version.rb +28 -30
- data/lib/virtualbox/vm.rb +75 -55
- data/test/test_helper.rb +2 -5
- data/test/virtualbox/abstract_model/attributable_test.rb +22 -0
- data/test/virtualbox/abstract_model/relatable_test.rb +21 -0
- data/test/virtualbox/abstract_model_test.rb +1 -8
- data/test/virtualbox/com/abstract_enum_test.rb +1 -1
- data/test/virtualbox/com/ffi/interface_test.rb +9 -6
- data/test/virtualbox/com/ffi/util_test.rb +0 -11
- data/test/virtualbox/com/implementer/ffi_test.rb +7 -21
- data/test/virtualbox/com/util_test.rb +0 -10
- data/test/virtualbox/host_network_interface_test.rb +1 -1
- data/test/virtualbox/network_adapter_test.rb +6 -32
- data/test/virtualbox/version_test.rb +1 -5
- data/test/virtualbox/vm_test.rb +11 -17
- data/virtualbox.gemspec +4 -2
- metadata +224 -250
- data/lib/virtualbox/com/ffi/interfaces.rb +0 -64
- data/lib/virtualbox/com/interface/3.1.x/access_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/appliance.rb +0 -22
- data/lib/virtualbox/com/interface/3.1.x/audio_driver_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/bios_settings.rb +0 -21
- data/lib/virtualbox/com/interface/3.1.x/clipboard_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/cpu_property_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/guest_os_type.rb +0 -23
- data/lib/virtualbox/com/interface/3.1.x/host_network_interface_status.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/host_usb_device_filter.rb +0 -13
- data/lib/virtualbox/com/interface/3.1.x/machine.rb +0 -105
- data/lib/virtualbox/com/interface/3.1.x/medium.rb +0 -50
- data/lib/virtualbox/com/interface/3.1.x/medium_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/network_adapter.rb +0 -30
- data/lib/virtualbox/com/interface/3.1.x/parallel_port.rb +0 -17
- data/lib/virtualbox/com/interface/3.1.x/progress.rb +0 -63
- data/lib/virtualbox/com/interface/3.1.x/session.rb +0 -18
- data/lib/virtualbox/com/interface/3.1.x/storage_bus.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/storage_controller.rb +0 -23
- data/lib/virtualbox/com/interface/3.1.x/storage_controller_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/system_properties.rb +0 -37
- data/lib/virtualbox/com/interface/3.1.x/usb_controller.rb +0 -20
- data/lib/virtualbox/com/interface/3.1.x/usb_device_filter_action.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/usb_device_state.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/virtual_box_error_info.rb +0 -17
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description.rb +0 -19
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description_type.rb +0 -14
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description_value_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/virtualbox.rb +0 -67
- data/lib/virtualbox/com/interface/3.1.x/vrdp_server.rb +0 -19
- data/lib/virtualbox/com/interface/3.2.x/audio_adapter.rb +0 -15
- data/lib/virtualbox/com/interface/3.2.x/audio_controller_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/bios_boot_menu_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/console.rb +0 -50
- data/lib/virtualbox/com/interface/3.2.x/device_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/dhcp_server.rb +0 -22
- data/lib/virtualbox/com/interface/3.2.x/firmware_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/host.rb +0 -43
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface.rb +0 -30
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface_medium_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/host_usb_device.rb +0 -13
- data/lib/virtualbox/com/interface/3.2.x/hw_virt_ex_property_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/machine_state.rb +0 -14
- data/lib/virtualbox/com/interface/3.2.x/medium_attachment.rb +0 -18
- data/lib/virtualbox/com/interface/3.2.x/medium_format.rb +0 -18
- data/lib/virtualbox/com/interface/3.2.x/medium_state.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/medium_variant.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/network_adapter_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/network_attachment_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/nsiexception.rb +0 -23
- data/lib/virtualbox/com/interface/3.2.x/nsisupports.rb +0 -15
- data/lib/virtualbox/com/interface/3.2.x/port_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/serial_port.rb +0 -19
- data/lib/virtualbox/com/interface/3.2.x/session_state.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/session_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/shared_folder.rb +0 -17
- data/lib/virtualbox/com/interface/3.2.x/snapshot.rb +0 -20
- data/lib/virtualbox/com/interface/3.2.x/usb_device.rb +0 -24
- data/lib/virtualbox/com/interface/3.2.x/usb_device_filter.rb +0 -23
- data/lib/virtualbox/com/interface/3.2.x/virtual_system_description_type.rb +0 -14
- data/lib/virtualbox/com/interface/3.2.x/vrdp_auth_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/vrdp_server.rb +0 -21
- data/lib/virtualbox/ext/glob_loader.rb +0 -35
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'ffi'
|
2
|
+
require 'virtualbox/ext/logger'
|
3
|
+
|
1
4
|
module VirtualBox
|
2
5
|
module COM
|
3
6
|
class FFIInterface < BaseInterface
|
@@ -72,7 +75,7 @@ module VirtualBox
|
|
72
75
|
logger.debug("FFI init: Trying version #{version}")
|
73
76
|
|
74
77
|
# Setup the FFI classes
|
75
|
-
|
78
|
+
COM::Util.set_interface_version(version)
|
76
79
|
virtualbox_klass = COM::Util.versioned_interface(:VirtualBox)
|
77
80
|
session_klass = COM::Util.versioned_interface(:Session)
|
78
81
|
|
@@ -85,9 +88,12 @@ module VirtualBox
|
|
85
88
|
@virtualbox = virtualbox_klass.new(Implementer::FFI, self, virtualbox_ptr.get_pointer(0))
|
86
89
|
@session = session_klass.new(Implementer::FFI, self, session_ptr.get_pointer(0))
|
87
90
|
|
91
|
+
# Make a call to version to verify no exceptions are raised
|
92
|
+
@virtualbox.implementer.valid? && @session.implementer.valid?
|
93
|
+
|
88
94
|
logger.debug(" -- Valid version")
|
89
95
|
true
|
90
|
-
rescue
|
96
|
+
rescue ::FFI::NullPointerError => e
|
91
97
|
logger.debug(" -- Invalid version")
|
92
98
|
false
|
93
99
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module VirtualBox
|
2
|
+
module COM
|
3
|
+
module Implementer
|
4
|
+
autoload :Base, 'virtualbox/com/implementer/base'
|
5
|
+
autoload :FFI, 'virtualbox/com/implementer/ffi'
|
6
|
+
autoload :MSCOM, 'virtualbox/com/implementer/mscom'
|
7
|
+
autoload :Nil, 'virtualbox/com/implementer/nil'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'virtualbox/ext/logger'
|
2
|
+
|
1
3
|
module VirtualBox
|
2
4
|
module COM
|
3
5
|
module Implementer
|
@@ -43,10 +45,15 @@ module VirtualBox
|
|
43
45
|
|
44
46
|
# Depending on the class type, we're either dealing with an interface
|
45
47
|
# or an enum
|
46
|
-
|
47
|
-
|
48
|
+
if interface.superclass == COM::AbstractInterface
|
49
|
+
type = :interface
|
50
|
+
c_type = :pointer
|
51
|
+
elsif interface.superclass == COM::AbstractEnum
|
52
|
+
type = :enum
|
53
|
+
c_type = :uint32
|
54
|
+
end
|
48
55
|
end
|
49
|
-
rescue NameError
|
56
|
+
rescue NameError,LoadError
|
50
57
|
# Do nothing
|
51
58
|
end
|
52
59
|
|
@@ -2,8 +2,6 @@ module VirtualBox
|
|
2
2
|
module COM
|
3
3
|
module Implementer
|
4
4
|
class FFI < Base
|
5
|
-
attr_reader :ffi_interface
|
6
|
-
|
7
5
|
# Initializes the FFI implementer which takes an {VirtualBox::COM::AbstractInterface AbstractInterface}
|
8
6
|
# instant and FFI pointer and initializes everything required to
|
9
7
|
# communicate with that interface via FFI.
|
@@ -13,7 +11,20 @@ module VirtualBox
|
|
13
11
|
def initialize(interface, lib_base, pointer)
|
14
12
|
super(interface, lib_base)
|
15
13
|
|
16
|
-
|
14
|
+
# Store the pointer which is used later to instantiate the actual
|
15
|
+
# structure. We don't instantiate here to save some CPU cycles.
|
16
|
+
@pointer = pointer
|
17
|
+
end
|
18
|
+
|
19
|
+
# This checks if the interface pointer was valid.
|
20
|
+
def valid?
|
21
|
+
!ffi_interface.nil?
|
22
|
+
end
|
23
|
+
|
24
|
+
# Instantiates the FFI class with the given pointer and caches the
|
25
|
+
# result for later.
|
26
|
+
def ffi_interface
|
27
|
+
@ffi_interface ||= ffi_class.new(@pointer)
|
17
28
|
end
|
18
29
|
|
19
30
|
# Gets the FFI struct class associated with the interface. This works
|
@@ -28,7 +39,7 @@ module VirtualBox
|
|
28
39
|
klass_name = interface.class.to_s.split("::").last
|
29
40
|
|
30
41
|
# Get the associated FFI class
|
31
|
-
COM::FFI
|
42
|
+
COM::FFI::Util.versioned_interface(klass_name)
|
32
43
|
end
|
33
44
|
|
34
45
|
# Reads a property from the interface with the given name.
|
@@ -65,7 +76,7 @@ module VirtualBox
|
|
65
76
|
formal_args = spec_to_args(spec, args)
|
66
77
|
|
67
78
|
# Call the function.
|
68
|
-
logger.debug("FFI call: #{name} #{args.inspect} #{formal_args.inspect}")
|
79
|
+
logger.debug("FFI call: #{name} #{spec.inspect} #{args.inspect} #{formal_args.inspect}")
|
69
80
|
call_and_check(name, ffi_interface.vtbl_parent, *formal_args)
|
70
81
|
|
71
82
|
# Extract the values from the formal args array, again based on the
|
@@ -114,10 +125,11 @@ module VirtualBox
|
|
114
125
|
0x80BB_0009 => Exceptions::NotSupportedException,
|
115
126
|
0x80BB_000A => Exceptions::XMLErrorException,
|
116
127
|
0x80BB_000B => Exceptions::InvalidSessionStateException,
|
117
|
-
0x80BB_000C => Exceptions::ObjectInUseException
|
128
|
+
0x80BB_000C => Exceptions::ObjectInUseException,
|
129
|
+
0x8007_0057 => Exceptions::InvalidArgException
|
118
130
|
}
|
119
131
|
|
120
|
-
map[code] || Exceptions::
|
132
|
+
map[code] || Exceptions::COMException
|
121
133
|
end
|
122
134
|
|
123
135
|
# Converts a function spec to a proper argument list with the given
|
@@ -156,9 +168,16 @@ module VirtualBox
|
|
156
168
|
# If its a regular type (int, bool, etc.) then just make it an
|
157
169
|
# array of that
|
158
170
|
if type != :interface
|
159
|
-
|
160
|
-
|
171
|
+
# Build a pointer to an array of values
|
172
|
+
result = ::FFI::MemoryPointer.new(c_type, data.length)
|
173
|
+
adder = result.method("put_#{c_type}")
|
174
|
+
data.each_with_index do |single, index|
|
175
|
+
value = []
|
176
|
+
single_type_to_arg([single], item[0], value)
|
177
|
+
adder.call(index, value.first)
|
161
178
|
end
|
179
|
+
|
180
|
+
results << result
|
162
181
|
else
|
163
182
|
# Then convert the rest into a raw MemoryPointer
|
164
183
|
array = ::FFI::MemoryPointer.new(:pointer, data.length)
|
@@ -217,14 +236,22 @@ module VirtualBox
|
|
217
236
|
# the first has the size and the second has the contents
|
218
237
|
return_values << dereference_pointer_array(formal[i+1], spec[1][0], dereference_pointer(formal[i], T_UINT32))
|
219
238
|
|
220
|
-
#
|
221
|
-
i +=
|
239
|
+
# Skip 2: size param + pointer
|
240
|
+
i += 2
|
222
241
|
else
|
223
242
|
return_values << dereference_pointer(formal[i], spec[1])
|
243
|
+
|
244
|
+
# Skip 1: Pointer
|
245
|
+
i += 1
|
224
246
|
end
|
247
|
+
elsif spec.is_a?(Array) && spec.length == 1
|
248
|
+
# This is an array argument, meaning it takes two arguments:
|
249
|
+
# one for size and one is a pointer to the array items. Therefore,
|
250
|
+
# skip two items.
|
251
|
+
i += 2
|
252
|
+
else
|
253
|
+
i += 1
|
225
254
|
end
|
226
|
-
|
227
|
-
i += 1
|
228
255
|
end
|
229
256
|
|
230
257
|
if return_values.empty?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'virtualbox/ext/platform'
|
2
|
+
|
1
3
|
module VirtualBox
|
2
4
|
module COM
|
3
5
|
module Implementer
|
@@ -12,6 +14,8 @@ module VirtualBox
|
|
12
14
|
super(interface, lib_base)
|
13
15
|
|
14
16
|
@object = object
|
17
|
+
|
18
|
+
require 'java' if Platform.jruby?
|
15
19
|
end
|
16
20
|
|
17
21
|
# Reads a property from the interface with the given name.
|
@@ -45,9 +49,22 @@ module VirtualBox
|
|
45
49
|
|
46
50
|
# Calls a function from the interface with the given name
|
47
51
|
def call_function(name, args, opts)
|
52
|
+
# This is a special exception only if we're on JRuby
|
53
|
+
jruby_exception = nil
|
54
|
+
jruby_exception = org.racob.com.ComFailException if Platform.jruby?
|
55
|
+
|
48
56
|
# Convert args to proper values to send and send em!
|
49
57
|
args = spec_to_args(opts[:spec], args)
|
50
|
-
|
58
|
+
|
59
|
+
value = nil
|
60
|
+
begin
|
61
|
+
value = @object.send(COM::FFI::Util.camelize(name.to_s), *args)
|
62
|
+
rescue jruby_exception
|
63
|
+
# JRuby exception is screwed up. We just throw a generic
|
64
|
+
# COMException and call it good.
|
65
|
+
raise Exceptions::COMException.new(:function => name,
|
66
|
+
:result_code => 0)
|
67
|
+
end
|
51
68
|
|
52
69
|
# TODO: Multiple return values
|
53
70
|
returnable_value(value, opts[:value_type])
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/virtualbox/com/interface/4.0.x/{hw_virt_ex_property_type.rb → HWVirtExPropertyType.rb}
RENAMED
File without changes
|
@@ -10,17 +10,17 @@ module VirtualBox
|
|
10
10
|
property :usb_devices, [:HostUSBDevice], :readonly => true
|
11
11
|
property :usb_device_filters, [:HostUSBDeviceFilter], :readonly => true
|
12
12
|
property :network_interfaces, [:HostNetworkInterface], :readonly => true
|
13
|
-
property :processor_count,
|
14
|
-
property :processor_online_count,
|
15
|
-
property :processor_core_count,
|
16
|
-
property :memory_size,
|
17
|
-
property :memory_available,
|
13
|
+
property :processor_count, T_UINT32, :readonly => true
|
14
|
+
property :processor_online_count, T_UINT64, :readonly => true
|
15
|
+
property :processor_core_count, T_UINT64, :readonly => true
|
16
|
+
property :memory_size, T_UINT64, :readonly => true
|
17
|
+
property :memory_available, T_UINT64, :readonly => true
|
18
18
|
property :operating_system, WSTRING, :readonly => true
|
19
19
|
property :os_version, WSTRING, :readonly => true
|
20
20
|
property :utc_time, T_INT64, :readonly => true
|
21
21
|
property :acceleration_3d_available, T_BOOL, :readonly => true
|
22
22
|
|
23
|
-
function :get_processor_speed,
|
23
|
+
function :get_processor_speed, T_UINT64, [T_UINT32]
|
24
24
|
function :get_processor_feature, T_BOOL, [T_UINT32] # TODO ENUM
|
25
25
|
function :get_processor_description, WSTRING, [T_UINT32]
|
26
26
|
function :get_processor_cpu_id_leaf, nil, [T_UINT32, T_UINT32, T_UINT32, [:out, T_UINT32], [:out, T_UINT32], [:out, T_UINT32], [:out, T_UINT32]]
|
data/lib/virtualbox/com/interface/4.0.x/{host_network_interface.rb → HostNetworkInterface.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -5,6 +5,9 @@ module VirtualBox
|
|
5
5
|
# This interface is actually only used with the FFI implementer but
|
6
6
|
# is created here to allow easier usage with the FFI abstractions.
|
7
7
|
class NSISupports < AbstractInterface
|
8
|
+
# This has no parent
|
9
|
+
parent nil
|
10
|
+
|
8
11
|
function :QueryInterface, :pointer, [:pointer]
|
9
12
|
function :AddRef, nil, []
|
10
13
|
function :Release, nil, []
|
File without changes
|
File without changes
|
data/lib/virtualbox/com/interface/4.0.x/{network_attachment_type.rb → NetworkAttachmentType.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/virtualbox/com/interface/4.0.x/{storage_controller_type.rb → StorageControllerType.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/virtualbox/com/interface/4.0.x/{usb_device_filter_action.rb → USBDeviceFilterAction.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -6,7 +6,7 @@ module VirtualBox
|
|
6
6
|
IID_STR = "D2DE270C-1D4B-4C9E-843F-BBB9B47269FF"
|
7
7
|
|
8
8
|
property :version, WSTRING, :readonly => true
|
9
|
-
property :revision,
|
9
|
+
property :revision, T_UINT64, :readonly => true
|
10
10
|
property :package_type, WSTRING, :readonly => true
|
11
11
|
property :home_folder, WSTRING, :readonly => true
|
12
12
|
property :settings_file_path, WSTRING, :readonly => true
|
data/lib/virtualbox/com/interface/4.0.x/{virtual_box_error_info.rb → VirtualBoxErrorInfo.rb}
RENAMED
@@ -5,6 +5,8 @@ module VirtualBox
|
|
5
5
|
class VirtualBoxErrorInfo < AbstractInterface
|
6
6
|
IID = "4b86d186-407e-4f9e-8be8-e50061be8725"
|
7
7
|
|
8
|
+
parent :NSIException
|
9
|
+
|
8
10
|
property :result_code, T_UINT32, :readonly => true
|
9
11
|
property :interface_i_d, WSTRING, :readonly => true
|
10
12
|
property :component, WSTRING, :readonly => true
|
@@ -14,4 +16,4 @@ module VirtualBox
|
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
17
|
-
end
|
19
|
+
end
|