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

build: avoid uninitialized variable warning

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