diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 3e8ff237e1f217ae67ab141ee6b6f39ddffac8b4..b5cd2e49c83e1d13855e0dcd50d84da05a15a666 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -3795,26 +3795,28 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine) VBOX_UTF8_TO_UTF16("", &mediumEmpty); if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) { - data->vboxObj->vtbl->OpenHardDisk(data->vboxObj, - mediumFileUtf16, - AccessMode_ReadWrite, - false, - mediumEmpty, - false, - mediumEmpty, - &medium); + rc = data->vboxObj->vtbl->OpenHardDisk(data->vboxObj, + mediumFileUtf16, + AccessMode_ReadWrite, + false, + mediumEmpty, + false, + mediumEmpty, + &medium); } else if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM) { - data->vboxObj->vtbl->OpenDVDImage(data->vboxObj, - mediumFileUtf16, - mediumEmpty, - &medium); + rc = data->vboxObj->vtbl->OpenDVDImage(data->vboxObj, + mediumFileUtf16, + mediumEmpty, + &medium); } else if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) { - data->vboxObj->vtbl->OpenFloppyImage(data->vboxObj, - mediumFileUtf16, - mediumEmpty, - &medium); + rc = data->vboxObj->vtbl->OpenFloppyImage(data->vboxObj, + mediumFileUtf16, + mediumEmpty, + &medium); + } else { + rc = 0; } VBOX_UTF16_FREE(mediumEmpty);