Changeset 33361 in vbox
- Timestamp:
- Oct 22, 2010 2:59:04 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
r33357 r33361 105 105 { "--type", 'T', RTGETOPT_REQ_UINT32 }, // deprecated 106 106 { "-type", 'T', RTGETOPT_REQ_UINT32 }, // deprecated 107 { "--controller", 'C', RTGETOPT_REQ_STRING }, 107 // { "--controller", 'C', RTGETOPT_REQ_STRING }, 108 { "--disk", 'D', RTGETOPT_REQ_STRING }, 108 109 }; 109 110 … … 207 208 return errorSyntax(USAGE_IMPORTAPPLIANCE, "Option \"%s\" requires preceding --unit argument.", GetState.pDef->pszLong); 208 209 mapArgsMapsPerVsys[ulCurVsys][Utf8StrFmt("controller%u", ulCurUnit)] = ValueUnion.psz; 210 break; 211 212 case 'D': // --disk 213 if (ulCurVsys == (uint32_t)-1) 214 return errorSyntax(USAGE_IMPORTAPPLIANCE, "Option \"%s\" requires preceding --vsys argument.", GetState.pDef->pszLong); 215 if (ulCurUnit == (uint32_t)-1) 216 return errorSyntax(USAGE_IMPORTAPPLIANCE, "Option \"%s\" requires preceding --unit argument.", GetState.pDef->pszLong); 217 mapArgsMapsPerVsys[ulCurVsys][Utf8StrFmt("disk%u", ulCurUnit)] = ValueUnion.psz; 209 218 break; 210 219 … … 592 601 else 593 602 { 594 Utf8StrFmt strTypeArg(" controller%u", a);603 Utf8StrFmt strTypeArg("disk%u", a); 595 604 if (findArgValue(strOverride, pmapArgs, strTypeArg)) 596 605 { 597 // strOverride now has the controller index as a number, but we 598 // need a "controller=X" format string 599 strOverride = Utf8StrFmt("controller=%s", strOverride.c_str()); 600 Bstr bstrExtraConfigValue = strOverride; 601 bstrExtraConfigValue.detachTo(&aExtraConfigValues[a]); 606 RTUUID uuid; 607 /* Check if this is a uuid. If so, don't touch. */ 608 int vrc = RTUuidFromStr(&uuid, strOverride.c_str()); 609 if (vrc != VINF_SUCCESS) 610 { 611 /* Make the path absolute. */ 612 if (!RTPathStartsWithRoot(strOverride.c_str())) 613 { 614 char pszPwd[RTPATH_MAX]; 615 vrc = RTPathGetCurrent(pszPwd, RTPATH_MAX); 616 if (RT_SUCCESS(vrc)) 617 strOverride = Utf8Str(pszPwd).append(RTPATH_SLASH).append(strOverride); 618 } 619 } 620 bstrFinalValue = strOverride; 602 621 RTPrintf("%2u: Hard disk image: source image=%ls, target path=%ls, %ls\n", 603 622 a, 604 623 aOvfValues[a], 605 aVboxValues[a],624 bstrFinalValue.raw(), 606 625 aExtraConfigValues[a]); 607 626 } 627 // Utf8StrFmt strTypeArg("controller%u", a); 628 // if (findArgValue(strOverride, pmapArgs, strTypeArg)) 629 // { 630 // strOverride now has the controller index as a number, but we 631 // need a "controller=X" format string 632 // strOverride = Utf8StrFmt("controller=%s", strOverride.c_str()); 633 // Bstr bstrExtraConfigValue = strOverride; 634 // bstrExtraConfigValue.detachTo(&aExtraConfigValues[a]); 635 // RTPrintf("%2u: Hard disk image: source image=%ls, target path=%ls, %ls\n", 636 // a, 637 // aOvfValues[a], 638 // aVboxValues[a], 639 // aExtraConfigValues[a]); 640 // } 608 641 else 609 642 RTPrintf("%2u: Hard disk image: source image=%ls, target path=%ls, %ls"
Note:
See TracChangeset
for help on using the changeset viewer.