VirtualBox

Changeset 29873 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
May 28, 2010 5:14:53 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62118
Message:

OVF: fix incorrect disk UUIDs in machine XML on export

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r28800 r29873  
    10111011AttributeNode* ElementNode::setAttribute(const char *pcszName, const char *pcszValue)
    10121012{
     1013    AttributeNode *pattrReturn;
    10131014    Data::AttributesMap::const_iterator it;
    10141015
     
    10241025        // store
    10251026        m->attribs[pcszKey] = pNew;
     1027        pattrReturn = pNew.get();
    10261028    }
    10271029    else
    10281030    {
    1029         // @todo
    1030         throw LogicError("Attribute exists");
    1031     }
    1032 
    1033     return NULL;
     1031        // overwrite existing libxml attribute node
     1032        xmlAttrPtr plibAttr = xmlSetProp(m_plibNode, (xmlChar*)pcszName, (xmlChar*)pcszValue);
     1033
     1034        // and fix our existing C++ side around it
     1035        boost::shared_ptr<AttributeNode> pattr = it->second;
     1036        pattr->m_plibAttr = plibAttr;       // in case the xmlAttrPtr is different, I'm not sure
     1037
     1038        pattrReturn = pattr.get();
     1039    }
     1040
     1041    return pattrReturn;
    10341042
    10351043}
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