VirtualBox

Changeset 28888 in vbox


Ignore:
Timestamp:
Apr 29, 2010 11:50:05 AM (15 years ago)
Author:
vboxsync
Message:

Main/Medium: new stub medium type "Shareable", plus assorted frontend changes to prepare its use.

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r28800 r28888  
    109109    else if (!RTStrICmp(psz, "writethrough"))
    110110        DiskType = MediumType_Writethrough;
     111    else if (!RTStrICmp(psz, "shareable"))
     112        DiskType = MediumType_Shareable;
    111113    else
    112114        rc = VERR_PARSE_ERROR;
     
    12311233                typeStr = "writethrough";
    12321234                break;
     1235            case MediumType_Shareable:
     1236                typeStr = "shareable";
     1237                break;
    12331238        }
    12341239        RTPrintf("Type:                 %s\n", typeStr);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    r28800 r28888  
    124124            case MediumType_Writethrough:
    125125                typeStr = "writethrough";
     126                break;
     127            case MediumType_Shareable:
     128                typeStr = "shareable";
    126129                break;
    127130        }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r28854 r28888  
    30633063    mDiskTypes [KMediumType_Immutable] =        tr ("Immutable", "DiskType");
    30643064    mDiskTypes [KMediumType_Writethrough] =     tr ("Writethrough", "DiskType");
     3065    mDiskTypes [KMediumType_Shareable] =        tr ("Shareable", "DiskType");
    30653066    mDiskTypes_Differencing =                   tr ("Differencing", "DiskType");
    30663067
  • trunk/src/VBox/Main/MediumImpl.cpp

    r28874 r28888  
    13831383    }
    13841384
     1385    /** @todo implement this case later */
     1386    CheckComArgExpr(aType, aType != MediumType_Shareable);
     1387
    13851388    if (m->type == aType)
    13861389    {
     
    13951398                        m->strLocationFull.raw());
    13961399
    1397     /* cannot change the type of a hard disk being in use */
    1398     if (m->backRefs.size() != 0)
     1400    /* cannot change the type of a hard disk being in use by more than one VM */
     1401    if (m->backRefs.size() > 1)
    13991402        return setError(E_FAIL,
    14001403                        tr("Cannot change the type of hard disk '%s' because it is attached to %d virtual machines"),
     
    14121415        }
    14131416        case MediumType_Writethrough:
    1414         {
    1415             /* cannot change to writethrough if there are children */
     1417        case MediumType_Shareable:
     1418        {
     1419            /* cannot change to writethrough or shareable if there are children */
    14161420            if (getChildren().size() != 0)
    14171421                return setError(E_FAIL,
     
    29342938        }
    29352939        case MediumType_Immutable:
    2936         {
    29372940            return true;
    2938         }
    29392941        case MediumType_Writethrough:
    2940         {
     2942        case MediumType_Shareable:
    29412943            return false;
    2942         }
    29432944        default:
    29442945            break;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r28835 r28888  
    91379137  <enum
    91389138    name="MediumType"
    9139     uuid="11f6f7a5-0327-409a-9d42-7db6a0cec578"
     9139    uuid="46bf1fd4-ad86-4ded-8c49-28bd2d148e5a"
    91409140   >
    91419141    <desc>
     
    91609160        Write through medium (attached directly, ignored when
    91619161        taking snapshots).
     9162      </desc>
     9163    </const>
     9164    <const name="Shareable"         value="3">
     9165      <desc>
     9166        Allow using this medium concurrently by several machines.
     9167        <note>This is a stub value. Not usable until this note is removed.</note>
    91629168      </desc>
    91639169    </const>
  • trunk/src/VBox/Main/xml/Settings.cpp

    r28867 r28888  
    921921            else if (strType == "WRITETHROUGH")
    922922                med.hdType = MediumType_Writethrough;
     923            else if (strType == "SHAREABLE")
     924            {
     925                /// @todo remove check once the medium type is implemented
     926                throw ConfigFileError(this, &elmMedium, N_("HardDisk/@type attribute of Shareable is not implemented yet"));
     927                med.hdType = MediumType_Shareable;
     928            }
    923929            else
    924930                throw ConfigFileError(this, &elmMedium, N_("HardDisk/@type attribute must be one of Normal, Immutable or Writethrough"));
     
    11781184            mdm.hdType == MediumType_Normal ? "Normal" :
    11791185            mdm.hdType == MediumType_Immutable ? "Immutable" :
    1180             /*mdm.hdType == MediumType_Writethrough ?*/ "Writethrough";
     1186            mdm.hdType == MediumType_Writethrough ? "Writethrough" :
     1187            mdm.hdType == MediumType_Shareable ? "Shareable" : "INVALID";
    11811188        pelmHardDisk->setAttribute("type", pcszType);
    11821189    }
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