From d9e66a62b471a24d2ddd991bc67c9760a4ad88bb Mon Sep 17 00:00:00 2001 From: Pritesh Kothari Date: Tue, 29 Sep 2009 15:17:51 +0200 Subject: [PATCH] Vbox call OpenHardDisk with "" instead of NULL * src/vbox/vbox_tmpl.c: UTF-16 fixed version of Florian Vichot initial patch --- src/vbox/vbox_tmpl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index c02b18c983..bab3ce40d9 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -3184,7 +3184,8 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) { if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_FILE) { IHardDisk *hardDisk = NULL; PRUnichar *hddfileUtf16 = NULL; - vboxIID *hdduuid = NULL; + vboxIID *hdduuid = NULL; + PRUnichar *hddEmpty = NULL; /* Current Limitation: Harddisk can't be connected to * Secondary Master as Secondary Master is always used * 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("", &hddEmpty); data->vboxObj->vtbl->FindHardDisk(data->vboxObj, hddfileUtf16, &hardDisk); @@ -3206,9 +3208,9 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) { hddfileUtf16, AccessMode_ReadWrite, 0, - NULL, + hddEmpty, 0, - NULL, + hddEmpty, &hardDisk); #endif } @@ -3271,6 +3273,7 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) { hardDisk->vtbl->imedium.nsisupports.Release((nsISupports *)hardDisk); } vboxIIDUnalloc(hdduuid); + data->pFuncs->pfnUtf16Free(hddEmpty); data->pFuncs->pfnUtf16Free(hddfileUtf16); } else if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_BLOCK) { } -- GitLab