VirtualBox

Changeset 35536 in vbox for trunk


Ignore:
Timestamp:
Jan 13, 2011 3:12:10 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69420
Message:

Main-OVF: ignore unknown resource types which are declared not required

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ovfreader.h

    r35043 r35536  
    217217    iprt::MiniString strOtherResourceType;
    218218    iprt::MiniString strResourceSubType;
     219    bool fResourceRequired;
    219220
    220221    iprt::MiniString strHostResource;   // "Abstractly specifies how a device shall connect to a resource on the deployment platform.
  • trunk/src/VBox/Main/xml/ovfreader.cpp

    r34501 r35536  
    423423                        pelmItemChild->copyValue(ulType);
    424424                        i.resourceType = (ResourceType_T)ulType;
     425                        i.fResourceRequired = true;
     426                        const char *pcszAttValue;
     427                        if (pelmItem->getAttributeValue("required", pcszAttValue))
     428                        {
     429                            if (!strcmp(pcszAttValue, "false"))
     430                                i.fResourceRequired = false;
     431                        }
    425432                    }
    426433                    else if (!strcmp(pcszItemChildName, "OtherResourceType"))
     
    691698
    692699                    default:
    693                         throw OVFLogicError(N_("Error reading \"%s\": Unknown resource type %d in hardware item, line %d"),
    694                                             m_strPath.c_str(),
    695                                             i.resourceType,
    696                                             i.ulLineNumber);
     700                    {
     701                        /* If this unknown resource type isn't required, we simply skip it. */
     702                        if (i.fResourceRequired)
     703                        {
     704                            throw OVFLogicError(N_("Error reading \"%s\": Unknown resource type %d in hardware item, line %d"),
     705                                                m_strPath.c_str(),
     706                                                i.resourceType,
     707                                                i.ulLineNumber);
     708                        }
     709                    }
    697710                } // end switch
    698711            }
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