Changeset 47918 in vbox
- Timestamp:
- Aug 20, 2013 2:09:48 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 88225
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r47906 r47918 166 166 " [--groups <group>, ...]\n" 167 167 " [--ostype <ostype>]\n" 168 " [--iconfile <filename>]\n" 168 169 " [--memory <memorysize in MB>]\n" 169 170 " [--pagefusion on|off]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r47908 r47918 51 51 MODIFYVM_DESCRIPTION, 52 52 MODIFYVM_OSTYPE, 53 MODIFYVM_ICONFILE, 53 54 MODIFYVM_MEMORY, 54 55 MODIFYVM_PAGEFUSION, … … 212 213 { "--description", MODIFYVM_DESCRIPTION, RTGETOPT_REQ_STRING }, 213 214 { "--ostype", MODIFYVM_OSTYPE, RTGETOPT_REQ_STRING }, 215 { "--iconfile", MODIFYVM_ICONFILE, RTGETOPT_REQ_STRING }, 214 216 { "--memory", MODIFYVM_MEMORY, RTGETOPT_REQ_UINT32 }, 215 217 { "--pagefusion", MODIFYVM_PAGEFUSION, RTGETOPT_REQ_BOOL_ONOFF }, … … 503 505 else 504 506 { 505 errorArgument("Invalid guest OS type '%s'", Utf8Str(ValueUnion.psz).c_str());507 errorArgument("Invalid guest OS type '%s'", ValueUnion.psz); 506 508 rc = E_FAIL; 507 509 } 510 break; 511 } 512 513 case MODIFYVM_ICONFILE: 514 { 515 RTFILE iconFile; 516 int vrc = RTFileOpen(&iconFile, ValueUnion.psz, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE); 517 if (RT_FAILURE(vrc)) 518 { 519 RTMsgError("Cannot open file \"%s\": %Rrc", ValueUnion.psz, vrc); 520 rc = E_FAIL; 521 break; 522 } 523 uint64_t cbSize; 524 vrc = RTFileGetSize(iconFile, &cbSize); 525 if (RT_FAILURE(vrc)) 526 { 527 RTMsgError("Cannot get size of file \"%s\": %Rrc", ValueUnion.psz, vrc); 528 rc = E_FAIL; 529 break; 530 } 531 if (cbSize > _256K) 532 { 533 RTMsgError("File \"%s\" is bigger than 256KByte", ValueUnion.psz); 534 rc = E_FAIL; 535 break; 536 } 537 SafeArray<BYTE> icon(cbSize); 538 rc = RTFileRead(iconFile, icon.raw(), cbSize, NULL); 539 if (RT_FAILURE(vrc)) 540 { 541 RTMsgError("Cannot read contents of file \"%s\": %Rrc", ValueUnion.psz, vrc); 542 rc = E_FAIL; 543 break; 544 } 545 RTFileClose(iconFile); 546 CHECK_ERROR(machine, COMSETTER(Icon)(ComSafeArrayAsInParam(icon))); 508 547 break; 509 548 }
Note:
See TracChangeset
for help on using the changeset viewer.