[PATCH] vbox: Use correct VRAM size unit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



VirtualBox uses megabyte, libvirt uses kilobyte.
---
 src/vbox/vbox_tmpl.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index f45e8ed..5ac94c3 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2225,7 +2225,7 @@ static char *vboxDomainDumpXML(virDomainPtr dom, int flags) {
                 if (VIR_ALLOC_N(def->videos, def->nvideos) >= 0) {
                     if (VIR_ALLOC(def->videos[0]) >= 0) {
                         /* the default is: vram is 8MB, One monitor, 3dAccel Off */
-                        PRUint32 VRAMSize          = 8 * 1024;
+                        PRUint32 VRAMSize          = 8;
                         PRUint32 monitorCount      = 1;
                         PRBool accelerate3DEnabled = PR_FALSE;
                         PRBool accelerate2DEnabled = PR_FALSE;
@@ -2238,7 +2238,7 @@ static char *vboxDomainDumpXML(virDomainPtr dom, int flags) {
 #endif /* VBOX_API_VERSION >= 3001 */
 
                         def->videos[0]->type            = VIR_DOMAIN_VIDEO_TYPE_VBOX;
-                        def->videos[0]->vram            = VRAMSize;
+                        def->videos[0]->vram            = VRAMSize * 1024;
                         def->videos[0]->heads           = monitorCount;
                         if (VIR_ALLOC(def->videos[0]->accel) >= 0) {
                             def->videos[0]->accel->support3d = accelerate3DEnabled;
@@ -4397,7 +4397,7 @@ vboxAttachVideo(virDomainDefPtr def, IMachine *machine)
 {
     if ((def->nvideos == 1) &&
         (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VBOX)) {
-        machine->vtbl->SetVRAMSize(machine, def->videos[0]->vram);
+        machine->vtbl->SetVRAMSize(machine, def->videos[0]->vram / 1024);
         machine->vtbl->SetMonitorCount(machine, def->videos[0]->heads);
         if (def->videos[0]->accel) {
             machine->vtbl->SetAccelerate3DEnabled(machine,
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]