Changeset 23223 in vbox for trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp
- Timestamp:
- Sep 22, 2009 3:50:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp
r21878 r23223 295 295 * Create a virtual harddisk 296 296 */ 297 nsCOMPtr<I HardDisk> hardDisk = 0;297 nsCOMPtr<IMedium> hardDisk = 0; 298 298 rc = virtualBox->CreateHardDisk(NS_LITERAL_STRING("VDI").get(), 299 299 NS_LITERAL_STRING("TestHardDisk.vdi").get(), … … 312 312 nsCOMPtr <IProgress> progress; 313 313 rc = hardDisk->CreateBaseStorage(100, // size in megabytes 314 HardDiskVariant_Standard,314 MediumVariant_Standard, 315 315 getter_AddRefs(progress)); // optional progress object 316 316 if (NS_FAILED(rc)) … … 342 342 nsXPIDLString vdiUUID; 343 343 hardDisk->GetId(getter_Copies(vdiUUID)); 344 rc = machine->AttachHardDisk(vdiUUID, 345 NS_LITERAL_STRING("IDE").get(), // controler identifier 346 0, // channel number on the controller 347 0); // device number on the controller 344 rc = machine->AttachDevice(NS_LITERAL_STRING("IDE").get(), // controler identifier 345 0, // channel number on the controller 346 0, // device number on the controller 347 DeviceType_HardDisk, 348 vdiUUID); 348 349 if (NS_FAILED(rc)) 349 350 { … … 360 361 * as the boot device. 361 362 */ 362 nsCOMPtr<I DVDImage> dvdImage;363 364 rc = virtualBox->OpenDVDImage(NS_LITERAL_STRING("/home/ achimha/isoimages/winnt4ger.iso").get(),363 nsCOMPtr<IMedium> dvdImage; 364 365 rc = virtualBox->OpenDVDImage(NS_LITERAL_STRING("/home/vbox/isos/winnt4ger.iso").get(), 365 366 nsnull, /* NULL UUID, i.e. a new one will be created */ 366 367 getter_AddRefs(dvdImage)); … … 376 377 nsXPIDLString isoUUID; 377 378 dvdImage->GetId(getter_Copies(isoUUID)); 378 nsCOMPtr<IDVDDrive> dvdDrive; 379 machine->GetDVDDrive(getter_AddRefs(dvdDrive)); 380 rc = dvdDrive->MountImage(isoUUID); 379 rc = machine->MountMedium(NS_LITERAL_STRING("IDE").get(), // controler identifier 380 2, // channel number on the controller 381 0, // device number on the controller 382 isoUUID); 381 383 if (NS_FAILED(rc)) 382 384 {
Note:
See TracChangeset
for help on using the changeset viewer.