VBoxManageModifyVM.cpp revision 67ee25dd0b63a61dc35a35d0aade75ca6cd06350
3184fc1a3e65025cd55704cdb1629f4ab1f3ccd2vboxsync * VBoxManage - Implementation of modifyvm command.
6eb6d0439d67fd4833f1d058b63bc9a56277b0b2vboxsync * Copyright (C) 2006-2012 Oracle Corporation
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * available from http://www.virtualbox.org. This file is free software;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * you can redistribute it and/or modify it under the terms of the GNU
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * General Public License (GPL) as published by the Free Software
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync/*******************************************************************************
be6a7ee8f237a71cf075c128e8e391e6c3654687vboxsync* Header Files *
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync*******************************************************************************/
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync#endif /* !VBOX_ONLY_DOCS */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsyncusing namespace com;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync/** @todo refine this after HDD changes; MSC 8.0/64 has trouble with handleModifyVM. */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync MODIFYVM_VRDPVIDEOCHANNELQUALITY, /* VRDE: deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--ostype", MODIFYVM_OSTYPE, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--memory", MODIFYVM_MEMORY, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--pagefusion", MODIFYVM_PAGEFUSION, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--firmware", MODIFYVM_FIRMWARE, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--acpi", MODIFYVM_ACPI, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--ioapic", MODIFYVM_IOAPIC, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--pae", MODIFYVM_PAE, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--synthcpu", MODIFYVM_SYNTHCPU, RTGETOPT_REQ_BOOL_ONOFF },
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--hwvirtex", MODIFYVM_HWVIRTEX, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--hwvirtexexcl", MODIFYVM_HWVIRTEXEXCLUSIVE, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nestedpaging", MODIFYVM_NESTEDPAGING, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--largepages", MODIFYVM_LARGEPAGES, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vtxvpid", MODIFYVM_VTXVPID, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--cpuidset", MODIFYVM_SETCPUID, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX},
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--cpuidremove", MODIFYVM_DELCPUID, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX},
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--cpuidremoveall", MODIFYVM_DELALLCPUID, RTGETOPT_REQ_NOTHING},
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--cpuhotplug", MODIFYVM_CPUHOTPLUG, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--plugcpu", MODIFYVM_PLUGCPU, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--unplugcpu", MODIFYVM_UNPLUGCPU, RTGETOPT_REQ_UINT32 },
1d5386c32e68116bca5e054dbef008b1f516bb25vboxsync { "--cpuexecutioncap", MODIFYVM_CPU_EXECTUION_CAP, RTGETOPT_REQ_UINT32 },
1d5386c32e68116bca5e054dbef008b1f516bb25vboxsync { "--rtcuseutc", MODIFYVM_RTCUSEUTC, RTGETOPT_REQ_BOOL_ONOFF },
1d5386c32e68116bca5e054dbef008b1f516bb25vboxsync { "--monitorcount", MODIFYVM_MONITORCOUNT, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--accelerate3d", MODIFYVM_ACCELERATE3D, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--accelerate2dvideo", MODIFYVM_ACCELERATE2DVIDEO, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--bioslogofadein", MODIFYVM_BIOSLOGOFADEIN, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--bioslogofadeout", MODIFYVM_BIOSLOGOFADEOUT, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--bioslogodisplaytime", MODIFYVM_BIOSLOGODISPLAYTIME, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--bioslogoimagepath", MODIFYVM_BIOSLOGOIMAGEPATH, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--biosbootmenu", MODIFYVM_BIOSBOOTMENU, RTGETOPT_REQ_STRING },
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--biossystemtimeoffset", MODIFYVM_BIOSSYSTEMTIMEOFFSET, RTGETOPT_REQ_INT64 },
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--biospxedebug", MODIFYVM_BIOSPXEDEBUG, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--boot", MODIFYVM_BOOT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--idecontroller", MODIFYVM_IDECONTROLLER, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--sataideemulation", MODIFYVM_SATAIDEEMULATION, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--sataportcount", MODIFYVM_SATAPORTCOUNT, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--sataport", MODIFYVM_SATAPORT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--scsiport", MODIFYVM_SCSIPORT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--scsitype", MODIFYVM_SCSITYPE, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--dvdpassthrough", MODIFYVM_DVDPASSTHROUGH, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--floppy", MODIFYVM_FLOPPY, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nictracefile", MODIFYVM_NICTRACEFILE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nictrace", MODIFYVM_NICTRACE, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nicproperty", MODIFYVM_NICPROPERTY, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--nictype", MODIFYVM_NICTYPE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nicspeed", MODIFYVM_NICSPEED, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nicbootprio", MODIFYVM_NICBOOTPRIO, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX },
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--nicpromisc", MODIFYVM_NICPROMISC, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nicbandwidthgroup", MODIFYVM_NICBWGROUP, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nic", MODIFYVM_NIC, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--cableconnected", MODIFYVM_CABLECONNECTED, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--bridgeadapter", MODIFYVM_BRIDGEADAPTER, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--hostonlyadapter", MODIFYVM_HOSTONLYADAPTER, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--intnet", MODIFYVM_INTNET, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--natnet", MODIFYVM_NATNET, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nicgenericdrv", MODIFYVM_GENERICDRV, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--natbindip", MODIFYVM_NATBINDIP, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--natsettings", MODIFYVM_NATSETTINGS, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--natpf", MODIFYVM_NATPF, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nataliasmode", MODIFYVM_NATALIASMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nattftpprefix", MODIFYVM_NATTFTPPREFIX, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nattftpfile", MODIFYVM_NATTFTPFILE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--nattftpserver", MODIFYVM_NATTFTPSERVER, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--natdnspassdomain", MODIFYVM_NATDNSPASSDOMAIN, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--natdnsproxy", MODIFYVM_NATDNSPROXY, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--natdnshostresolver", MODIFYVM_NATDNSHOSTRESOLVER, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--macaddress", MODIFYVM_MACADDRESS, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--mouse", MODIFYVM_HIDPTR, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--keyboard", MODIFYVM_HIDKBD, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--lptmode", MODIFYVM_LPTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--lpt", MODIFYVM_LPT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--guestmemoryballoon", MODIFYVM_GUESTMEMORYBALLOON, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--audiocontroller", MODIFYVM_AUDIOCONTROLLER, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--audio", MODIFYVM_AUDIO, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--clipboard", MODIFYVM_CLIPBOARD, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdpport", MODIFYVM_VRDPPORT, RTGETOPT_REQ_STRING }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdpaddress", MODIFYVM_VRDPADDRESS, RTGETOPT_REQ_STRING }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdpauthtype", MODIFYVM_VRDPAUTHTYPE, RTGETOPT_REQ_STRING }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdpmulticon", MODIFYVM_VRDPMULTICON, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdpreusecon", MODIFYVM_VRDPREUSECON, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdpvideochannel", MODIFYVM_VRDPVIDEOCHANNEL, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdpvideochannelquality", MODIFYVM_VRDPVIDEOCHANNELQUALITY, RTGETOPT_REQ_STRING }, /* deprecated */
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--vrdp", MODIFYVM_VRDP, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdeproperty", MODIFYVM_VRDEPROPERTY, RTGETOPT_REQ_STRING },
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--vrdeport", MODIFYVM_VRDEPORT, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdeaddress", MODIFYVM_VRDEADDRESS, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdeauthtype", MODIFYVM_VRDEAUTHTYPE, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdeauthlibrary", MODIFYVM_VRDEAUTHLIBRARY, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdemulticon", MODIFYVM_VRDEMULTICON, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdereusecon", MODIFYVM_VRDEREUSECON, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdevideochannel", MODIFYVM_VRDEVIDEOCHANNEL, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdevideochannelquality", MODIFYVM_VRDEVIDEOCHANNELQUALITY, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrdeextpack", MODIFYVM_VRDE_EXTPACK, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--vrde", MODIFYVM_VRDE, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--usbehci", MODIFYVM_USBEHCI, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--usb", MODIFYVM_USB, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--snapshotfolder", MODIFYVM_SNAPSHOTFOLDER, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--teleporter", MODIFYVM_TELEPORTER_ENABLED, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--teleporterenabled", MODIFYVM_TELEPORTER_ENABLED, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--teleporterport", MODIFYVM_TELEPORTER_PORT, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--teleporteraddress", MODIFYVM_TELEPORTER_ADDRESS, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--teleporterpassword", MODIFYVM_TELEPORTER_PASSWORD, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--hardwareuuid", MODIFYVM_HARDWARE_UUID, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--hpet", MODIFYVM_HPET, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--iocache", MODIFYVM_IOCACHE, RTGETOPT_REQ_BOOL_ONOFF },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--iocachesize", MODIFYVM_IOCACHESIZE, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--faulttolerance", MODIFYVM_FAULT_TOLERANCE, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--faulttoleranceaddress", MODIFYVM_FAULT_TOLERANCE_ADDRESS, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--faulttoleranceport", MODIFYVM_FAULT_TOLERANCE_PORT, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--faulttolerancepassword", MODIFYVM_FAULT_TOLERANCE_PASSWORD, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--faulttolerancesyncinterval", MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL, RTGETOPT_REQ_UINT32 },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--chipset", MODIFYVM_CHIPSET, RTGETOPT_REQ_STRING },
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync { "--pciattach", MODIFYVM_ATTACH_PCI, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync { "--pcidetach", MODIFYVM_DETACH_PCI, RTGETOPT_REQ_STRING },
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsyncstatic void vrdeWarningDeprecatedOption(const char *pszOption)
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync RTStrmPrintf(g_pStdErr, "Warning: '--vrdp%s' is deprecated. Use '--vrde%s'.\n", pszOption, pszOption);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync/** Parse PCI address in format 01:02.03 and convert it to the numeric representation. */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = RTStrToUInt8Ex(pszNext, &pszNext, 16, &aVals[0]);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync if (RT_FAILURE(rc) || pszNext == NULL || *pszNext != ':')
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = RTStrToUInt8Ex(pszNext+1, &pszNext, 16, &aVals[1]);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync if (RT_FAILURE(rc) || pszNext == NULL || *pszNext != '.')
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = RTStrToUInt8Ex(pszNext+1, &pszNext, 16, &aVals[2]);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync return (aVals[0] << 8) | (aVals[1] << 3) | (aVals[2] << 0);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* VM ID + at least one parameter. Parameter arguments are checked
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * individually. */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync return errorSyntax(USAGE_MODIFYVM, "Not enough parameters");
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* try to find the given machine */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* Get the number of network adapters */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync ULONG NetworkAdapterCount = getMaxNics(a->virtualBox, machine);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* open a session for the VM */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Write), 1);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* get the mutable session machine */
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync a->session->COMGETTER(Machine)(machine.asOutParam());
1041613dd6ee5da259fa80b5555bb556f4dd8aafvboxsync machine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync RTGetOptInit(&GetOptState, a->argc, a->argv, g_aModifyVMOptions,
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync RT_ELEMENTS(g_aModifyVMOptions), 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(Name)(Bstr(ValueUnion.psz).raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(a->virtualBox, GetGuestOSType(Bstr(ValueUnion.psz).raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid guest OS type '%s'", Utf8Str(ValueUnion.psz).c_str());
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(MemorySize)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(PageFusionEnabled)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(VRAMSize)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI64));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFIDUAL));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_BIOS));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid --firmware argument '%s'", ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(ACPIEnabled)(ValueUnion.f));
be6a7ee8f237a71cf075c128e8e391e6c3654687vboxsync CHECK_ERROR(biosSettings, COMSETTER(IOAPICEnabled)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetCPUProperty(CPUPropertyType_PAE, ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetCPUProperty(CPUPropertyType_Synthetic, ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Enabled, ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Exclusive, ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync for (unsigned i = 0 ; i < 4 ; i++)
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync int vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync "Missing or Invalid argument to '%s'",
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetCPUIDLeaf(id, aValue[0], aValue[1], aValue[2], aValue[3]));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, RemoveCPUIDLeaf(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_LargePages, ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_VPID, ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(CPUCount)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(RTCUseUTC)(ValueUnion.f));
be6a7ee8f237a71cf075c128e8e391e6c3654687vboxsync CHECK_ERROR(machine, COMSETTER(CPUHotPlugEnabled)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, HotUnplugCPU(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(CPUExecutionCap)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(MonitorCount)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(Accelerate3DEnabled)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMSETTER(Accelerate2DVideoEnabled)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoFadeIn)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoFadeOut)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoDisplayTime)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoImagePath)(Bstr(ValueUnion.psz).raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_Disabled));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MenuOnly));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync else if (!strcmp(ValueUnion.psz, "messageandmenu"))
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MessageAndMenu));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid --biosbootmenu argument '%s'", ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(TimeOffset)(ValueUnion.i64));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(biosSettings, COMSETTER(PXEDebugEnabled)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Null));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Floppy));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_DVD));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_HardDisk));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Network));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync return errorArgument("Invalid boot device '%s'", ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync machine->DetachDevice(bstrController.raw(), u1, u2);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = findOrOpenMedium(a, ValueUnion.psz, DeviceType_HardDisk,
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, AttachDevice(bstrController.raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, GetStorageControllerByName(Bstr("IDE Controller").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_PIIX3));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_PIIX4));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_ICH6));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid --idecontroller argument '%s'", ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(SataCtl, SetIDEEmulationPort(GetOptState.uIndex, ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(SataCtl, COMSETTER(PortCount)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync if (!strcmp(ValueUnion.psz, "on") || !strcmp(ValueUnion.psz, "enable"))
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, AddStorageController(Bstr("SATA").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_IntelAhci));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable"))
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, RemoveStorageController(Bstr("SATA").raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync return errorArgument("Invalid --usb argument '%s'", ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, DetachDevice(Bstr("BusLogic").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = findOrOpenMedium(a, ValueUnion.psz, DeviceType_HardDisk,
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = machine->RemoveStorageController(Bstr("BusLogic").raw());
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic").raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = machine->RemoveStorageController(Bstr("LsiLogic").raw());
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, RemoveStorageController(Bstr("BusLogic").raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync return errorArgument("Invalid --scsitype argument '%s'", ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync if (!strcmp(ValueUnion.psz, "on") || !strcmp(ValueUnion.psz, "enable"))
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, AddStorageController(Bstr("BusLogic").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable"))
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = machine->RemoveStorageController(Bstr("BusLogic").raw());
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic").raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, PassthroughDevice(Bstr("IDE Controller").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* unmount? */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* nothing to do, NULL object will cause unmount */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* host drive? */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = host->FindHostDVDDrive(Bstr(ValueUnion.psz + 5).raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* 2nd try: try with the real name, important on Linux+libhal */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync if (RT_FAILURE(RTPathReal(ValueUnion.psz + 5, szPathReal, sizeof(szPathReal))))
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid host DVD drive name \"%s\"", ValueUnion.psz + 5);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = host->FindHostDVDDrive(Bstr(szPathReal).raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid host DVD drive name \"%s\"", ValueUnion.psz + 5);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = findOrOpenMedium(a, ValueUnion.psz, DeviceType_DVD,
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, MountMedium(Bstr("IDE Controller").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync machine->GetMediumAttachment(Bstr("Floppy Controller").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* disable? */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* disable the controller */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, DetachDevice(Bstr("Floppy Controller").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* enable the controller */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, AttachDevice(Bstr("Floppy Controller").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* unmount? */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* nothing to do, NULL object will cause unmount */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* host drive? */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = host->FindHostFloppyDrive(Bstr(ValueUnion.psz + 5).raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid host floppy drive name \"%s\"", ValueUnion.psz + 5);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync rc = findOrOpenMedium(a, ValueUnion.psz, DeviceType_Floppy,
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, MountMedium(Bstr("Floppy Controller").raw(),
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(TraceFile)(Bstr(ValueUnion.psz).raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(TraceEnabled)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* Parse 'name=value' */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, SetProperty(bstrName.raw(), bstrValue.raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid --nicproperty%d argument '%s'", GetOptState.uIndex, ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync RTStrmPrintf(g_pStdErr, "Error: Failed to allocate memory for --nicproperty%d '%s'\n", GetOptState.uIndex, ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_Am79C970A));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_Am79C973));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82540EM));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82543GC));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82545EM));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_Virtio));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync#endif /* VBOX_WITH_VIRTIO */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid NIC type '%s' specified for NIC %u", ValueUnion.psz, GetOptState.uIndex);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(LineSpeed)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* Somewhat arbitrary limitation - we can pass a list of up to 4 PCI devices
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * to the PXE ROM, hence only boot priorities 1-4 are allowed (in addition to
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync * 0 for the default lowest priority).
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid boot priority '%u' specfied for NIC %u", ValueUnion.u32, GetOptState.uIndex);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(BootPriority)(ValueUnion.u32));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync NetworkAdapterPromiscModePolicy_T enmPromiscModePolicy;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_Deny;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_AllowNetwork;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_AllowAll;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Unknown promiscuous mode policy '%s'", ValueUnion.psz);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(PromiscModePolicy)(enmPromiscModePolicy));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* Just remove the bandwidth group. */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(machine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(bwCtrl, GetBandwidthGroup(Bstr(ValueUnion.psz).raw(), bwGroup.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(BandwidthGroup)(bwGroup));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Null));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_NAT));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync || !strcmp(ValueUnion.psz, "hostif")) /* backward compatibility */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Bridged));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Internal));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_HostOnly));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Generic));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync errorArgument("Invalid type '%s' specfied for NIC %u", ValueUnion.psz, GetOptState.uIndex);
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(CableConnected)(ValueUnion.f));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync /* remove it? */
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(BridgedInterface)(Bstr().raw()));
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync CHECK_ERROR(nic, COMSETTER(BridgedInterface)(Bstr(ValueUnion.psz).raw()));
case MODIFYVM_HOSTONLYADAPTER:
case MODIFYVM_INTNET:
case MODIFYVM_GENERICDRV:
case MODIFYVM_NATNET:
case MODIFYVM_NATBINDIP:
if (*ch == 0) \
ch++; \
ch++; \
case MODIFYVM_NATSETTINGS:
char *strMtu;
char *strSockSnd;
char *strSockRcv;
char *strTcpSnd;
char *strTcpRcv;
CHECK_ERROR(driver, SetNetworkSettings(RTStrToUInt32(strMtu), RTStrToUInt32(strSockSnd), RTStrToUInt32(strSockRcv),
case MODIFYVM_NATPF:
char *strName;
char *strProto;
char *strHostIp;
char *strHostPort;
char *strGuestIp;
char *strGuestPort;
int vrc;
case MODIFYVM_NATALIASMODE:
aliasMode = 0;
while(token)
token++;
case MODIFYVM_NATTFTPPREFIX:
case MODIFYVM_NATTFTPFILE:
case MODIFYVM_NATTFTPSERVER:
case MODIFYVM_NATDNSPROXY:
case MODIFYVM_MACADDRESS:
case MODIFYVM_HIDPTR:
bool fEnableUsb = false;
fEnableUsb = true;
fEnableUsb = true;
if (fEnableUsb)
fEnabled = false;
if (!fEnabled)
case MODIFYVM_HIDKBD:
bool fEnableUsb = false;
fEnableUsb = true;
if (fEnableUsb)
fEnabled = false;
if (!fEnabled)
case MODIFYVM_UARTMODE:
case MODIFYVM_UART:
case MODIFYVM_LPTMODE:
case MODIFYVM_LPT:
case MODIFYVM_AUDIOCONTROLLER:
case MODIFYVM_AUDIO:
#ifdef RT_OS_WINDOWS
#ifdef VBOX_WITH_WINMM
#ifdef RT_OS_LINUX
# ifdef VBOX_WITH_ALSA
# ifdef VBOX_WITH_PULSE
#ifdef RT_OS_SOLARIS
#ifdef RT_OS_FREEBSD
# ifdef VBOX_WITH_PULSE
#ifdef RT_OS_DARWIN
case MODIFYVM_CLIPBOARD:
case MODIFYVM_VRDE_EXTPACK:
if (vrdeServer)
case MODIFYVM_VRDEPROPERTY:
if (vrdeServer)
if (pszProperty)
if (pDelimiter)
RTStrmPrintf(g_pStdErr, "Error: Failed to allocate memory for VRDE property '%s'\n", ValueUnion.psz);
case MODIFYVM_VRDPPORT:
case MODIFYVM_VRDEPORT:
case MODIFYVM_VRDPADDRESS:
case MODIFYVM_VRDEADDRESS:
case MODIFYVM_VRDPAUTHTYPE:
case MODIFYVM_VRDEAUTHTYPE:
case MODIFYVM_VRDEAUTHLIBRARY:
if (vrdeServer)
case MODIFYVM_VRDPMULTICON:
case MODIFYVM_VRDEMULTICON:
case MODIFYVM_VRDPREUSECON:
case MODIFYVM_VRDEREUSECON:
case MODIFYVM_VRDP:
case MODIFYVM_VRDE:
case MODIFYVM_USBEHCI:
case MODIFYVM_USB:
case MODIFYVM_SNAPSHOTFOLDER:
case MODIFYVM_TELEPORTER_PORT:
case MODIFYVM_FAULT_TOLERANCE:
case MODIFYVM_HARDWARE_UUID:
case MODIFYVM_HPET:
case MODIFYVM_IOCACHE:
case MODIFYVM_IOCACHESIZE:
case MODIFYVM_CHIPSET:
if (!fIoApic)
#ifdef VBOX_WITH_PCI_PASSTHROUGH
case MODIFYVM_ATTACH_PCI:
errorArgument("Invalid --pciattach argument '%s' (valid: 'HB:HD.HF@GB:GD.GF' or just 'HB:HD.HF')", ValueUnion.psz);
case MODIFYVM_DETACH_PCI: