Changeset 60068 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Mar 16, 2016 7:43:56 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r60067 r60068 159 159 { "convertfromraw", USAGE_CONVERTFROMRAW, VBMG_CMD_TODO, handleConvertFromRaw, VBMG_CMD_F_NO_COM }, 160 160 { "convertdd", USAGE_CONVERTFROMRAW, VBMG_CMD_TODO, handleConvertFromRaw, VBMG_CMD_F_NO_COM }, 161 { "usbdevsource", USAGE_USBDEVSOURCE, VBMG_CMD_TODO, handleUSBDevSource, 0 }162 161 }; 163 162 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r60067 r60068 112 112 #define USAGE_ENCRYPTMEDIUM RT_BIT_64(61) 113 113 #define USAGE_MEDIUMENCCHKPWD RT_BIT_64(62) 114 #define USAGE_USBDEVSOURCE RT_BIT_64(63)115 114 #define USAGE_ALL (~(uint64_t)0) 116 115 /** @} */ … … 309 308 /* VBoxManageUSB.cpp */ 310 309 RTEXITCODE handleUSBFilter(HandlerArg *a); 311 RTEXITCODE handleUSBDevSource(HandlerArg *a);312 310 313 311 /* VBoxManageHostonly.cpp */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r60067 r60068 1380 1380 } 1381 1381 1382 if (fCategory & USAGE_USBDEVSOURCE)1383 {1384 RTStrmPrintf(pStrm,1385 "%s usbdevsource %s add <source name>\n"1386 " --backend <backend>\n"1387 " --address <address>\n"1388 "%s usbdevsource %s remove <source name>\n"1389 "\n", SEP, SEP);1390 }1391 1392 1382 #ifndef VBOX_ONLY_DOCS /* Converted to man page, not needed. */ 1393 1383 if (fCategory == USAGE_ALL) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageUSB.cpp
r60067 r60068 547 547 return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 548 548 } 549 550 RTEXITCODE handleUSBDevSource(HandlerArg *a)551 {552 HRESULT rc = S_OK;553 554 /* at least: 0: command, 1: source id */555 if (a->argc < 2)556 return errorSyntax(USAGE_USBDEVSOURCE, "Not enough parameters");557 558 ComPtr<IHost> host;559 if (!strcmp(a->argv[0], "add"))560 {561 Bstr strBackend;562 Bstr strAddress;563 if (a->argc != 6)564 return errorSyntax(USAGE_USBDEVSOURCE, "Invalid number of parameters");565 566 for (int i = 2; i < a->argc; i++)567 {568 if (!strcmp(a->argv[i], "--backend"))569 {570 i++;571 strBackend = a->argv[i];572 }573 else if (!strcmp(a->argv[i], "--address"))574 {575 i++;576 strAddress = a->argv[i];577 }578 else579 return errorSyntax(USAGE_USBDEVSOURCE, "Parameter \"%s\" is invalid", a->argv[i]);580 }581 582 SafeArray<BSTR> usbSourcePropNames;583 SafeArray<BSTR> usbSourcePropValues;584 585 CHECK_ERROR_RET(a->virtualBox, COMGETTER(Host)(host.asOutParam()), RTEXITCODE_FAILURE);586 CHECK_ERROR_RET(host, AddUSBDeviceSource(strBackend.raw(), Bstr(a->argv[1]).raw(), strAddress.raw(),587 ComSafeArrayAsInParam(usbSourcePropNames), ComSafeArrayAsInParam(usbSourcePropValues)),588 RTEXITCODE_FAILURE);589 }590 else if (!strcmp(a->argv[0], "remove"))591 {592 CHECK_ERROR_RET(a->virtualBox, COMGETTER(Host)(host.asOutParam()), RTEXITCODE_FAILURE);593 CHECK_ERROR_RET(host, RemoveUSBDeviceSource(Bstr(a->argv[1]).raw()), RTEXITCODE_FAILURE);594 }595 596 return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;597 }598 599 549 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.