VirtualBox

Changeset 63001 in vbox


Ignore:
Timestamp:
Aug 4, 2016 4:17:22 PM (8 years ago)
Author:
vboxsync
Message:

ValidationKit/testdriver/vboxwrappers.py: Make it possible to specify medium variant flags when creating a hard disk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r62484 r63001  
    17951795        return fRc;
    17961796
    1797     def createBaseHd(self, sHd, sFmt = "VDI", cb = 10*1024*1024*1024):
     1797    def createBaseHd(self, sHd, sFmt = "VDI", cb = 10*1024*1024*1024, tMediumVariant = None):
    17981798        """
    17991799        Creates a base HD.
    18001800        Returns Medium object on success and None on failure.  Error information is logged.
    18011801        """
     1802        if tMediumVariant is None:
     1803            tMediumVariant = (vboxcon.MediumVariant_Standard, );
     1804
    18021805        try:
    18031806            if self.fpApiVer >= 5.0:
     
    18051808            else:
    18061809                oHd = self.oVBox.createHardDisk(sFmt, sHd);
    1807             oProgressXpcom = oHd.createBaseStorage(cb, (vboxcon.MediumVariant_Standard, ))
     1810            oProgressXpcom = oHd.createBaseStorage(cb, tMediumVariant);
    18081811            oProgress = ProgressWrapper(oProgressXpcom, self.oVBoxMgr, self.oTstDrv, 'create base disk %s' % (sHd));
    18091812            oProgress.wait();
     
    18361839
    18371840    def createAndAttachHd(self, sHd, sFmt = "VDI", sController = "IDE Controller", cb = 10*1024*1024*1024, \
    1838                           iPort = 0, iDevice = 0, fImmutable = True):
     1841                          iPort = 0, iDevice = 0, fImmutable = True, tMediumVariant = None):
    18391842        """
    18401843        Creates and attaches a HD to a VM.
     
    18441847            return False;
    18451848
    1846         oHd = self.createBaseHd(sHd, sFmt, cb)
     1849        oHd = self.createBaseHd(sHd, sFmt, cb, tMediumVariant);
    18471850        if oHd is None:
    18481851            return False;
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