VirtualBox

Changeset 34779 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 7, 2010 1:53:04 PM (14 years ago)
Author:
vboxsync
Message:

Main/Medium: do not allow changing the medium type of an already attached medium to immutable.

File:
1 edited

Legend:

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

    r34734 r34779  
    16451645                        m->strLocationFull.c_str());
    16461646
    1647     /* cannot change the type of a medium being in use by more than one VM */
    1648     if (m->backRefs.size() > 1)
     1647    /* Cannot change the type of a medium being in use by more than one VM.
     1648     * If the change is to Immutable then it must not be attached to any VM,
     1649     * otherwise assumptions elsewhere are violated and the VM becomes
     1650     * inaccessible. Attaching an immutable medium triggers the diff creation,
     1651     * and this is vital for the correct operation. */
     1652    if (   m->backRefs.size() > 1
     1653        || (aType == MediumType_Immutable && m->backRefs.size() > 0))
    16491654        return setError(VBOX_E_INVALID_OBJECT_STATE,
    16501655                        tr("Cannot change the type of medium '%s' because it is attached to %d virtual machines"),
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