VirtualBox

Changeset 5894 in vbox


Ignore:
Timestamp:
Nov 30, 2007 2:52:59 PM (17 years ago)
Author:
vboxsync
Message:

Started solaris raw HDD support (untested, disabled).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvHostRawDisk.cpp

    r4071 r5894  
    3838#include <linux/hdreg.h>
    3939#include <linux/fs.h>
    40 #endif /* !RT_OS_WINDOWS && !RT_OS_LINUX */
     40#elif RT_OS_SOLARIS
     41#include <sys/types.h>
     42#include <sys/stat.h>
     43#include <sys/dkio.h>
     44#include <stropts.h>
     45#include <errno.h>
     46#endif /* !RT_OS_WINDOWS && !RT_OS_LINUX && !RT_OS_SOLARIS */
    4147
    4248#include "Builtins.h"
     
    379385                rc = RTErrConvertFromErrno(errno);
    380386        }
     387#elif defined(RT_OS_SOLARIS)
     388        struct stat DevStat;
     389        if (!fstat(pThis->HostDiskFile, &DevStat) && S_ISBLK(DevStat.st_mode))
     390        {
     391            struct dk_geom DriveGeo;
     392            if (!ioctl(pThis->HostDiskFile, DKIOCGGEOM, &DriveGeo))
     393            {
     394                pThis->cCylinders = DriveGeo.dkg_ncyl;
     395                pThis->cHeads = DriveGeo.dkg_nhead;
     396                pThis->cSectors = DriveGeo.dkg_nsect;
     397                if (!pThis->cbSize)
     398                {
     399                    struct dk_minfo DriveInfo;
     400                    if (!ioctl(pThis->HostDiskFile, DKIOCGMEDIAINFO, &DriveInfo))
     401                        pThis->cbSize = (uint64_t)DriveInfo.dki_lbsize * DriveInfo.dki_capacity;
     402                    else
     403                        rc = RTErrConvertFromErrno(errno);
     404                }
     405            }
     406            else
     407                rc = RTErrConvertFromErrno(errno);
     408        }
    381409#else
    382410        /** @todo add further host OS geometry detection mechanisms. */
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