- Timestamp:
- Mar 9, 2009 2:16:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r17573 r17576 2564 2564 Utf8Str strDescription; // results in <rasd:Description>...</rasd:Description> block 2565 2565 Utf8Str strCaption; // results in <rasd:Caption>...</rasd:Caption> block 2566 2566 2567 int32_t lVirtualQuantity = -1; 2567 uint64_t uTemp; 2568 Utf8Str strAllocationUnits; 2569 2568 2570 bool fAutomaticAllocation = false; 2569 2571 Utf8Str strConnection; // results in <rasd:Connection>...</rasd:Connection> block 2572 2573 uint64_t uTemp; 2570 2574 2571 2575 switch (desc.type) … … 2599 2603 desc.strVbox.toInt(uTemp); 2600 2604 lVirtualQuantity = (int32_t)(uTemp / _1M); 2605 strAllocationUnits = "MegaBytes"; 2601 2606 break; 2602 2607 … … 2680 2685 pItem = pelmVirtualHardwareSection->createChild("Item"); 2681 2686 2687 if (!strAllocationUnits.isEmpty()) 2688 pItem->createChild("rasd:AllocationUnits")->addContent(strAllocationUnits); 2689 2682 2690 if (fAutomaticAllocation) 2683 2691 pItem->createChild("rasd:AutomaticAllocation")->addContent("true"); 2684 2692 2685 if ( strDescription.length())2686 pItem->createChild("rasd:Description")->addContent(strDescription .c_str());2687 if ( strCaption.length())2688 pItem->createChild("rasd:Caption")->addContent(strCaption .c_str());2689 2690 if ( strConnection.length())2691 pItem->createChild("rasd:Connection")->addContent(strConnection .c_str());2693 if (!strDescription.isEmpty()) 2694 pItem->createChild("rasd:Description")->addContent(strDescription); 2695 if (!strCaption.isEmpty()) 2696 pItem->createChild("rasd:Caption")->addContent(strCaption); 2697 2698 if (!strConnection.isEmpty()) 2699 pItem->createChild("rasd:Connection")->addContent(strConnection); 2692 2700 2693 2701 // <rasd:InstanceID>1</rasd:InstanceID> 2694 pItem->createChild("rasd:InstanceID")->addContent(Utf8StrFmt("%d", ulInstanceID) .c_str());2702 pItem->createChild("rasd:InstanceID")->addContent(Utf8StrFmt("%d", ulInstanceID)); 2695 2703 ++ulInstanceID; 2696 2704 2697 2705 // <rasd:ResourceType>3</rasd:ResourceType> 2698 pItem->createChild("rasd:ResourceType")->addContent(Utf8StrFmt("%d", type) .c_str());2706 pItem->createChild("rasd:ResourceType")->addContent(Utf8StrFmt("%d", type)); 2699 2707 2700 2708 // <rasd:VirtualQuantity>1</rasd:VirtualQuantity> 2701 2709 if (lVirtualQuantity != -1) 2702 pItem->createChild("rasd:VirtualQuantity")->addContent(Utf8StrFmt("%d", lVirtualQuantity) .c_str());2710 pItem->createChild("rasd:VirtualQuantity")->addContent(Utf8StrFmt("%d", lVirtualQuantity)); 2703 2711 2704 2712 }
Note:
See TracChangeset
for help on using the changeset viewer.