提交 d9e66a62 编写于 作者: P Pritesh Kothari 提交者: Daniel Veillard

Vbox call OpenHardDisk with "" instead of NULL

* src/vbox/vbox_tmpl.c: UTF-16 fixed version of Florian Vichot initial
  patch
上级 1caa19cb
...@@ -3184,7 +3184,8 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) {
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册