示例#1
0
 public VirtualCdDrive(string file, ushort busnum, ushort devnum, DiskBusType busType, CdDeviceType cdType)
 {
     this.FileName = file;
     this.busnum = busnum;
     this.devnum = devnum;
     this.busType = busType;
     this.cdType = cdType;
 }
示例#2
0
        private void LoadDisks(DiskBusType busType)
        {
            for (ushort i = 0; i < 2; i++) {
                for (ushort j = 0; j < 6; j++) {
                    string basekey = String.Format ("{0}{1}:{2}.", busType == DiskBusType.Ide ? "ide" : "scsi",
                                                    i, j);

                    if (this[basekey + "present"] != null && this[basekey + "present"] == "TRUE") {
                        string diskFile = this[basekey + "fileName"];
                        if (diskFile != null && diskFile != "auto detect" && !Path.IsPathRooted (diskFile)) {
                            diskFile = Path.Combine (Path.GetDirectoryName (file), diskFile);
                        }

                        ScsiDeviceType scsiType = OperatingSystem.SuggestedScsiDeviceType;
                        if (this[basekey + "virtualDev"] != null) {
                            scsiType = Utility.ParseScsiDeviceType (this[basekey + "virtualDev"]);
                        }

                        string devtype = this[basekey + "deviceType"];
                        if (devtype == null || devtype == "disk") {
                            VirtualHardDisk disk = new VirtualHardDisk (diskFile,
                                                                        i, j, busType);
                            disk.ScsiDeviceType = scsiType;
                            hardDisks.Add (disk);
                        } else {
                            VirtualCdDrive drive = new VirtualCdDrive (diskFile, i, j, busType,
                                                                       Utility.ParseCdDeviceType (devtype));
                            drive.ScsiDeviceType = scsiType;
                            cds.Add (drive);
                        }
                    }
                }
            }
        }
示例#3
0
 private string GetDiskBaseKey(DiskBusType busType, int busnum, int devnum)
 {
     if (busType == DiskBusType.Ide) {
         return String.Format ("ide{0}:{1}.", busnum, devnum);
     } else {
         return String.Format ("scsi{0}:{1}.", busnum, devnum);
     }
 }
示例#4
0
 public VirtualHardDisk(ushort busnum, ushort devnum, DiskBusType busType, long capacity)
 {
     this.busnum = busnum;
     this.devnum = devnum;
     this.busType = busType;
     this.capacity = capacity;
 }
示例#5
0
        public VirtualHardDisk(string file, ushort busnum, ushort devnum, DiskBusType busType)
        {
            this.FileName = file;
            this.busnum = busnum;
            this.devnum = devnum;
            this.busType = busType;

            ReadDescriptor ();
        }