VirtualBox

Changeset 29353 in vbox


Ignore:
Timestamp:
May 11, 2010 1:42:11 PM (15 years ago)
Author:
vboxsync
Message:

Main/OVF: skip removeable media attachments on export since the image files are not exported

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r29218 r29353  
    876876    {
    877877        BuildMachineXML_IncludeSnapshots = 0x01,
    878         BuildMachineXML_WriteVboxVersionAttribute = 0x02
     878        BuildMachineXML_WriteVboxVersionAttribute = 0x02,
     879        BuildMachineXML_SkipRemovableMedia = 0x02
    879880    };
    880881    void buildMachineXML(xml::ElementNode &elmMachine, uint32_t fl);
     
    899900    void buildHardwareXML(xml::ElementNode &elmParent, const Hardware &hw, const Storage &strg);
    900901    void buildNetworkXML(NetworkAttachmentType_T mode, xml::ElementNode &elmParent, const NetworkAdapter &nic);
    901     void buildStorageControllersXML(xml::ElementNode &elmParent, const Storage &st);
     902    void buildStorageControllersXML(xml::ElementNode &elmParent, const Storage &st, bool fSkipRemovableMedia);
    902903    void buildSnapshotXML(xml::ElementNode &elmParent, const Snapshot &snap);
    903904
  • trunk/src/VBox/Main/ApplianceImplExport.cpp

    r29331 r29353  
    12971297        // write the machine config to the vbox:Machine element
    12981298        pConfig->buildMachineXML(*pelmVBoxMachine,
    1299                                  settings::MachineConfigFile::BuildMachineXML_WriteVboxVersionAttribute);
     1299                                   settings::MachineConfigFile::BuildMachineXML_WriteVboxVersionAttribute
     1300                                 | settings::MachineConfigFile::BuildMachineXML_SkipRemovableMedia);
    13001301                                        // but not BuildMachineXML_IncludeSnapshots
    13011302        delete pConfig;
  • trunk/src/VBox/Main/xml/Settings.cpp

    r29310 r29353  
    36513651 * @param elmParent
    36523652 * @param st
     3653 * @param fSkipRemovableMedia If true, DVD and floppy attachments are skipped and
     3654 *   an empty drive is always written instead. This is for the OVF export case.
     3655 *   This parameter is ignored unless the settings version is at least v1.9, which
     3656 *   is always the case when this gets called for OVF export.
    36533657 */
    36543658void MachineConfigFile::buildStorageControllersXML(xml::ElementNode &elmParent,
    3655                                                    const Storage &st)
     3659                                                   const Storage &st,
     3660                                                   bool fSkipRemovableMedia)
    36563661{
    36573662    xml::ElementNode *pelmStorageControllers = elmParent.createChild("StorageControllers");
     
    37653770            pelmDevice->setAttribute("device", att.lDevice);
    37663771
    3767             if (!att.uuid.isEmpty())
     3772            if (    !att.uuid.isEmpty()
     3773                 && (    att.deviceType == DeviceType_HardDisk
     3774                      || !fSkipRemovableMedia
     3775                    )
     3776               )
    37683777                pelmDevice->createChild("Image")->setAttribute("uuid", makeString(att.uuid));
    37693778            else if (    (m->sv >= SettingsVersion_v1_9)
     
    37983807
    37993808    buildHardwareXML(*pelmSnapshot, snap.hardware, snap.storage);
    3800     buildStorageControllersXML(*pelmSnapshot, snap.storage);
     3809    buildStorageControllersXML(*pelmSnapshot,
     3810                               snap.storage,
     3811                               false /* fSkipRemovableMedia */);
     3812                                    // we only skip removable media for OVF, but we never get here for OVF
     3813                                    // since snapshots never get written then
    38013814
    38023815    if (snap.llChildSnapshots.size())
     
    38353848 *      the OVF export case in which we don't have the settings version set in
    38363849 *      the root element.
     3850 *
     3851 *  --  BuildMachineXML_SkipRemovableMedia: If set, removable media attachments
     3852 *      (DVDs, floppies) are silently skipped. This is for the OVF export case
     3853 *      until we support copying ISO and RAW media as well.  This flas is ignored
     3854 *      unless the settings version is at least v1.9, which is always the case
     3855 *      when this gets called for OVF export.
    38373856 *
    38383857 * @param elmMachine XML <Machine> element to add attributes and elements to.
     
    38873906
    38883907    buildHardwareXML(elmMachine, hardwareMachine, storageMachine);
    3889     buildStorageControllersXML(elmMachine, storageMachine);
     3908    buildStorageControllersXML(elmMachine,
     3909                               storageMachine,
     3910                               !!(fl & BuildMachineXML_SkipRemovableMedia));
    38903911}
    38913912
Note: See TracChangeset for help on using the changeset viewer.

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