VirtualBox

Changeset 4339 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 24, 2007 10:19:27 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23879
Message:

Main: Support combined dec/hex representation for selected attributes in XML.

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HardDiskImpl.cpp

    r4071 r4339  
    32243224    else
    32253225        CFGLDRDeleteAttribute (aStorageNode, "port");
    3226     /* lun (optional) */
     3226    /* lun (optional, force 0x format to coform to XML Schema!) */
    32273227    if (mLun != 0)
    3228         CFGLDRSetUInt64 (aStorageNode, "lun", mLun);
     3228        CFGLDRSetUInt64Ex (aStorageNode, "lun", mLun, 16);
    32293229    else
    32303230        CFGLDRDeleteAttribute (aStorageNode, "lun");
  • trunk/src/VBox/Main/ParallelPortImpl.cpp

    r4324 r4339  
    288288    ComAssertRCRet (vrc, E_FAIL);
    289289
    290     CFGLDRSetUInt32 (portNode, "slot",    mData->mSlot);
    291     CFGLDRSetBool   (portNode, "enabled", !!mData->mEnabled);
    292     CFGLDRSetUInt32 (portNode, "IOBase",  mData->mIOBase);
    293     CFGLDRSetUInt32 (portNode, "IRQ",     mData->mIRQ);
    294     CFGLDRSetBSTR   (portNode, "path",    mData->mPath);
     290    CFGLDRSetUInt32   (portNode, "slot",    mData->mSlot);
     291    CFGLDRSetBool     (portNode, "enabled", !!mData->mEnabled);
     292    CFGLDRSetUInt32Ex (portNode, "IOBase",  mData->mIOBase, 16);
     293    CFGLDRSetUInt32   (portNode, "IRQ",     mData->mIRQ);
     294    CFGLDRSetBSTR     (portNode, "path",    mData->mPath);
    295295
    296296    return S_OK;
     
    374374STDMETHODIMP ParallelPort::COMSETTER(IRQ)(ULONG aIRQ)
    375375{
     376    /* check IRQ limits
     377     * (when changing this, make sure it corresponds to XML schema */
     378    if (aIRQ > 255)
     379        return setError (E_INVALIDARG,
     380            tr ("Invalid IRQ number: %lu (must be in range [0, %lu])"),
     381                aIRQ, 255);
     382
    376383    AutoCaller autoCaller (this);
    377384    CheckComRCReturnRC (autoCaller.rc());
     
    421428STDMETHODIMP ParallelPort::COMSETTER(IOBase)(ULONG aIOBase)
    422429{
     430    /* check IOBase limits
     431     * (when changing this, make sure it corresponds to XML schema */
     432    if (aIOBase > 0xFFFF)
     433        return setError (E_INVALIDARG,
     434            tr ("Invalid I/O port base address: %lu (must be in range [0, 0x%X])"),
     435                aIOBase, 0, 0xFFFF);
     436
    423437    AutoCaller autoCaller (this);
    424438    CheckComRCReturnRC (autoCaller.rc());
  • trunk/src/VBox/Main/SerialPortImpl.cpp

    r4324 r4339  
    315315            break;
    316316    }
    317     CFGLDRSetUInt32 (portNode, "slot",    mData->mSlot);
    318     CFGLDRSetBool   (portNode, "enabled", !!mData->mEnabled);
    319     CFGLDRSetUInt32 (portNode, "IOBase",  mData->mIOBase);
    320     CFGLDRSetUInt32 (portNode, "IRQ",     mData->mIRQ);
    321     CFGLDRSetString (portNode, "hostMode", mode);
     317    CFGLDRSetUInt32   (portNode, "slot",     mData->mSlot);
     318    CFGLDRSetBool     (portNode, "enabled", !!mData->mEnabled);
     319    CFGLDRSetUInt32Ex (portNode, "IOBase",   mData->mIOBase, 16);
     320    CFGLDRSetUInt32   (portNode, "IRQ",      mData->mIRQ);
     321    CFGLDRSetString   (portNode, "hostMode", mode);
    322322    if (mData->mHostMode != PortMode_DisconnectedPort)
    323323    {
     
    459459STDMETHODIMP SerialPort::COMSETTER(IRQ)(ULONG aIRQ)
    460460{
     461    /* check IRQ limits
     462     * (when changing this, make sure it corresponds to XML schema */
     463    if (aIRQ > 255)
     464        return setError (E_INVALIDARG,
     465            tr ("Invalid IRQ number: %lu (must be in range [0, %lu])"),
     466                aIRQ, 255);
     467
    461468    AutoCaller autoCaller (this);
    462469    CheckComRCReturnRC (autoCaller.rc());
     
    506513STDMETHODIMP SerialPort::COMSETTER(IOBase)(ULONG aIOBase)
    507514{
     515    /* check IOBase limits
     516     * (when changing this, make sure it corresponds to XML schema */
     517    if (aIOBase > 0xFFFF)
     518        return setError (E_INVALIDARG,
     519            tr ("Invalid I/O port base address: %lu (must be in range [0, 0x%X])"),
     520                aIOBase, 0, 0xFFFF);
     521
    508522    AutoCaller autoCaller (this);
    509523    CheckComRCReturnRC (autoCaller.rc());
  • trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd

    r4324 r4339  
    5050</xsd:simpleType>
    5151
    52 <xsd:simpleType name="TUInt64">
     52<xsd:simpleType name="TUInt8">
     53  <xsd:union>
     54    <xsd:simpleType>
     55      <xsd:restriction base="xsd:unsignedByte">
     56      </xsd:restriction>
     57    </xsd:simpleType>
     58    <xsd:simpleType>
     59      <xsd:restriction base="xsd:string">
     60        <xsd:pattern value="0[xX][A-Fa-f0-9]{1,2}"/>
     61      </xsd:restriction>
     62    </xsd:simpleType>
     63  </xsd:union>
     64</xsd:simpleType>
     65
     66<xsd:simpleType name="TUInt16">
     67  <xsd:union>
     68    <xsd:simpleType>
     69      <xsd:restriction base="xsd:unsignedShort">
     70      </xsd:restriction>
     71    </xsd:simpleType>
     72    <xsd:simpleType>
     73      <xsd:restriction base="xsd:string">
     74        <xsd:pattern value="0[xX][A-Fa-f0-9]{1,4}"/>
     75      </xsd:restriction>
     76    </xsd:simpleType>
     77  </xsd:union>
     78</xsd:simpleType>
     79
     80<xsd:simpleType name="TUInt64Hex">
    5381  <xsd:restriction base="xsd:string">
    5482    <xsd:pattern value="0x[A-Fa-f0-9]{1,16}"/>
     
    211239          <xsd:attribute name="port" type="xsd:unsignedShort" default="0"/>
    212240          <xsd:attribute name="target" type="xsd:token" use="required"/>
    213           <xsd:attribute name="lun" type="TUInt64" default="0x0"/>
     241          <xsd:attribute name="lun" type="TUInt64Hex" default="0x0"/>
    214242          <xsd:attribute name="userName" type="xsd:token"/>
    215243          <xsd:attribute name="password" type="xsd:token"/>
     
    478506<xsd:complexType name="TUSBController">
    479507  <xsd:sequence>
    480     <xsd:element name="Device" minOccurs="0" maxOccurs="unbounded">
    481       <xsd:complexType>
    482         <xsd:attribute name="vendorid" type="xsd:unsignedShort" use="required"/>
    483         <xsd:attribute name="productid" type="xsd:unsignedShort" use="required"/>
    484         <xsd:attribute name="revision" type="xsd:unsignedShort" use="required"/>
    485         <xsd:attribute name="serialhash" type="TUInt64" use="required"/>
    486         <xsd:attribute name="manufacturer" type="xsd:string"/>
    487         <xsd:attribute name="product" type="xsd:string"/>
    488         <xsd:attribute name="serialnumber" type="xsd:string"/>
    489         <xsd:attribute name="comment" type="xsd:string"/>
    490       </xsd:complexType>
    491     </xsd:element>
    492508    <xsd:element name="DeviceFilter" type="TUSBDeviceFilter"
    493509                 minOccurs="0" maxOccurs="unbounded"/>
     
    529545  </xsd:attribute>
    530546  <xsd:attribute name="enabled" type="xsd:boolean" use="required"/>
    531   <xsd:attribute name="IRQ" type="xsd:unsignedInt" use="required"/>
    532   <xsd:attribute name="IOBase" type="xsd:unsignedInt" use="required"/>
     547  <xsd:attribute name="IRQ" type="TUInt8" use="required"/>
     548  <xsd:attribute name="IOBase" type="TUInt16" use="required"/>
    533549  <xsd:attribute name="hostMode" type="TPortMode" use="required"/>
    534550  <xsd:attribute name="path" type="TLocalFile"/>
     
    559575  </xsd:attribute>
    560576  <xsd:attribute name="enabled" type="xsd:boolean" use="required"/>
    561   <xsd:attribute name="IRQ" type="xsd:unsignedInt" use="required"/>
    562   <xsd:attribute name="IOBase" type="xsd:unsignedInt" use="required"/>
     577  <xsd:attribute name="IRQ" type="TUInt8" use="required"/>
     578  <xsd:attribute name="IOBase" type="TUInt16" use="required"/>
    563579  <xsd:attribute name="path" type="TLocalFile"/>
    564580</xsd:complexType>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette