Changeset 51889 in vbox
- Timestamp:
- Jul 6, 2014 7:40:14 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
-
VBoxManage.cpp (modified) (1 diff)
-
VBoxManage.h (modified) (2 diffs)
-
VBoxManageDisk.cpp (modified) (1 diff)
-
VBoxManageHelp.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r49621 r51889 480 480 { "unregistervm", USAGE_UNREGISTERVM, handleUnregisterVM }, 481 481 { "clonevm", USAGE_CLONEVM, handleCloneVM }, 482 { "hdproperty", USAGE_HDPROPERTY, handleMediumProperty }, 482 483 { "createhd", USAGE_CREATEHD, handleCreateHardDisk }, 483 484 { "createvdi", USAGE_CREATEHD, handleCreateHardDisk }, /* backward compatibility */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r49621 r51889 104 104 #define USAGE_REPAIRHD RT_BIT_64(58) 105 105 #define USAGE_NATNETWORK RT_BIT_64(59) 106 #define USAGE_HDPROPERTY RT_BIT_64(60) 106 107 #define USAGE_ALL (~(uint64_t)0) 107 108 /** @} */ … … 260 261 int handleModifyHardDisk(HandlerArg *a); 261 262 int handleCloneHardDisk(HandlerArg *a); 263 int handleMediumProperty(HandlerArg *a); 262 264 RTEXITCODE handleConvertFromRaw(int argc, char *argv[]); 263 265 HRESULT showMediumInfo(const ComPtr<IVirtualBox> &pVirtualBox, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r49039 r51889 1352 1352 return SUCCEEDED(rc) ? 0 : 1; 1353 1353 } 1354 1355 int handleMediumProperty(HandlerArg *a) 1356 { 1357 HRESULT rc = S_OK; 1358 const char *pszAction = NULL; 1359 const char *pszFilenameOrUuid = NULL; 1360 const char *pszProperty = NULL; 1361 ComPtr<IMedium> pMedium; 1362 1363 if (a->argc == 0) 1364 return errorSyntax(USAGE_HDPROPERTY, "Missing action"); 1365 1366 pszAction = a->argv[0]; 1367 if ( RTStrICmp(pszAction, "set") 1368 && RTStrICmp(pszAction, "get") 1369 && RTStrICmp(pszAction, "delete")) 1370 return errorSyntax(USAGE_HDPROPERTY, "Invalid action given: %s", pszAction); 1371 1372 if ( ( !RTStrICmp(pszAction, "set") 1373 && a->argc != 4) 1374 || ( RTStrICmp(pszAction, "set") 1375 && a->argc != 3)) 1376 return errorSyntax(USAGE_HDPROPERTY, "Invalid number of arguments given for action: %s", pszAction); 1377 1378 pszFilenameOrUuid = a->argv[1]; 1379 pszProperty = a->argv[2]; 1380 1381 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, 1382 AccessMode_ReadWrite, pMedium, 1383 false /* fForceNewUuidOnOpen */, false /* fSilent */); 1384 if (SUCCEEDED(rc) && !pMedium.isNull()) 1385 { 1386 if (!RTStrICmp(pszAction, "set")) 1387 { 1388 const char *pszValue = a->argv[3]; 1389 CHECK_ERROR(pMedium, SetProperty(Bstr(pszProperty).raw(), Bstr(pszValue).raw())); 1390 } 1391 else if (!RTStrICmp(pszAction, "get")) 1392 { 1393 Bstr strVal; 1394 CHECK_ERROR(pMedium, GetProperty(Bstr(pszProperty).raw(), strVal.asOutParam())); 1395 if (SUCCEEDED(rc)) 1396 RTPrintf("%s=%ls\n", pszProperty, strVal.raw()); 1397 } 1398 else if (!RTStrICmp(pszAction, "delete")) 1399 { 1400 /** @todo */ 1401 } 1402 } 1403 1404 return SUCCEEDED(rc) ? 0 : 1; 1405 } 1406 1354 1407 #endif /* !VBOX_ONLY_DOCS */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r50996 r51889 615 615 "\n", SEP); 616 616 617 if (fCategory & USAGE_HDPROPERTY) 618 RTStrmPrintf(pStrm, 619 "%s hdproperty %s set <uuid|filename>\n" 620 " <property> <value>\n" 621 "\n" 622 " get <uuid|filename>\n" 623 " <property>\n" 624 "\n" 625 " delete <uuid|filename>\n" 626 " <property>\n" 627 "\n", SEP); 628 617 629 if (fCategory & USAGE_CONVERTFROMRAW) 618 630 RTStrmPrintf(pStrm,
Note:
See TracChangeset
for help on using the changeset viewer.

