VirtualBox

Changeset 86125 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 14, 2020 5:55:07 PM (4 years ago)
Author:
vboxsync
Message:

Main: bugref:9623: Restricted the scope of the multi attaching the same image twice by DVD only.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r85908 r86125  
    35163516
    35173517    if (    (pAttachTemp = i_findAttachment(*mMediumAttachments.data(), medium))
    3518          && !medium.isNull() && medium->i_getType() != MediumType_Readonly
    3519          &&  medium->i_getDeviceType() != DeviceType_DVD
     3518         && !medium.isNull()
     3519         && (   medium->i_getType() != MediumType_Readonly
     3520             || medium->i_getDeviceType() != DeviceType_DVD)
    35203521       )
    35213522        return setError(VBOX_E_OBJECT_IN_USE,
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r86052 r86125  
    43414341    {
    43424342        AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS);
    4343         fDvd = m->type == MediumType_Readonly || m->devType == DeviceType_DVD;
     4343        /*
     4344         *  Check the medium is DVD and readonly. It's for the case if DVD
     4345         *  will be able to be writable sometime in the future.
     4346         */
     4347        fDvd = m->type == MediumType_Readonly && m->devType == DeviceType_DVD;
    43444348    }
    43454349
     
    43504354    if (aSnapshotId.isZero())
    43514355    {
    4352         // Allow MediumType_Readonly mediums and DVD in particular to be attached twice.
     4356        // Allow DVD having MediumType_Readonly to be attached twice.
    43534357        // (the medium already had been added to back reference)
    43544358        if (fDvd)
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