提交 2ce55fe7 编写于 作者: E Eric Blake

build: avoid uninitialized variable warning

* src/vbox/vbox_tmpl.c (vboxAttachDrives): Capture return value.
上级 84768912
...@@ -3795,26 +3795,28 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine) ...@@ -3795,26 +3795,28 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
VBOX_UTF8_TO_UTF16("", &mediumEmpty); VBOX_UTF8_TO_UTF16("", &mediumEmpty);
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) { if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
data->vboxObj->vtbl->OpenHardDisk(data->vboxObj, rc = data->vboxObj->vtbl->OpenHardDisk(data->vboxObj,
mediumFileUtf16, mediumFileUtf16,
AccessMode_ReadWrite, AccessMode_ReadWrite,
false, false,
mediumEmpty, mediumEmpty,
false, false,
mediumEmpty, mediumEmpty,
&medium); &medium);
} else if (def->disks[i]->device == } else if (def->disks[i]->device ==
VIR_DOMAIN_DISK_DEVICE_CDROM) { VIR_DOMAIN_DISK_DEVICE_CDROM) {
data->vboxObj->vtbl->OpenDVDImage(data->vboxObj, rc = data->vboxObj->vtbl->OpenDVDImage(data->vboxObj,
mediumFileUtf16, mediumFileUtf16,
mediumEmpty, mediumEmpty,
&medium); &medium);
} else if (def->disks[i]->device == } else if (def->disks[i]->device ==
VIR_DOMAIN_DISK_DEVICE_FLOPPY) { VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
data->vboxObj->vtbl->OpenFloppyImage(data->vboxObj, rc = data->vboxObj->vtbl->OpenFloppyImage(data->vboxObj,
mediumFileUtf16, mediumFileUtf16,
mediumEmpty, mediumEmpty,
&medium); &medium);
} else {
rc = 0;
} }
VBOX_UTF16_FREE(mediumEmpty); VBOX_UTF16_FREE(mediumEmpty);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册