mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
Vbox call OpenHardDisk with "" instead of NULL
* src/vbox/vbox_tmpl.c: UTF-16 fixed version of Florian Vichot initial patch
This commit is contained in:
parent
1caa19cb06
commit
d9e66a62b4
@ -3184,7 +3184,8 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
|
|||||||
if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE) {
|
if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE) {
|
||||||
IHardDisk *hardDisk = NULL;
|
IHardDisk *hardDisk = NULL;
|
||||||
PRUnichar *hddfileUtf16 = NULL;
|
PRUnichar *hddfileUtf16 = NULL;
|
||||||
vboxIID *hdduuid = NULL;
|
vboxIID *hdduuid = NULL;
|
||||||
|
PRUnichar *hddEmpty = NULL;
|
||||||
/* Current Limitation: Harddisk can't be connected to
|
/* Current Limitation: Harddisk can't be connected to
|
||||||
* Secondary Master as Secondary Master is always used
|
* Secondary Master as Secondary Master is always used
|
||||||
* for CD/DVD Drive, so don't connect the harddisk if it
|
* for CD/DVD Drive, so don't connect the harddisk if it
|
||||||
@ -3192,6 +3193,7 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
data->pFuncs->pfnUtf8ToUtf16(def->disks[i]->src, &hddfileUtf16);
|
data->pFuncs->pfnUtf8ToUtf16(def->disks[i]->src, &hddfileUtf16);
|
||||||
|
data->pFuncs->pfnUtf8ToUtf16("", &hddEmpty);
|
||||||
|
|
||||||
data->vboxObj->vtbl->FindHardDisk(data->vboxObj, hddfileUtf16, &hardDisk);
|
data->vboxObj->vtbl->FindHardDisk(data->vboxObj, hddfileUtf16, &hardDisk);
|
||||||
|
|
||||||
@ -3206,9 +3208,9 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
|
|||||||
hddfileUtf16,
|
hddfileUtf16,
|
||||||
AccessMode_ReadWrite,
|
AccessMode_ReadWrite,
|
||||||
0,
|
0,
|
||||||
NULL,
|
hddEmpty,
|
||||||
0,
|
0,
|
||||||
NULL,
|
hddEmpty,
|
||||||
&hardDisk);
|
&hardDisk);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -3271,6 +3273,7 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
|
|||||||
hardDisk->vtbl->imedium.nsisupports.Release((nsISupports *)hardDisk);
|
hardDisk->vtbl->imedium.nsisupports.Release((nsISupports *)hardDisk);
|
||||||
}
|
}
|
||||||
vboxIIDUnalloc(hdduuid);
|
vboxIIDUnalloc(hdduuid);
|
||||||
|
data->pFuncs->pfnUtf16Free(hddEmpty);
|
||||||
data->pFuncs->pfnUtf16Free(hddfileUtf16);
|
data->pFuncs->pfnUtf16Free(hddfileUtf16);
|
||||||
} else if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_BLOCK) {
|
} else if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_BLOCK) {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user