[PATCH 2/5] Parallels: fix error with video card RAM dimension

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

 



Libvirt measures vram in Kbytes, not in bytes, so calculation
of Mbytes was incorrect. PCS server can take vram argument
with units, so I added K postfix to make params a little bit clearer.
---
 src/parallels/parallels_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 6534fdb..3806e5e 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -1628,13 +1628,13 @@ parallelsApplyVideoParams(parallelsDomObjPtr pdom,
     }
 
     if (old->vram != new->vram) {
-        if (new->vram % (1 << 20) != 0) {
+        if (new->vram % (1 << 10) != 0) {
             virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
                        _("Video RAM size should be multiple of 1Mb."));
             return -1;
         }
 
-        snprintf(str_vram, 31, "%d", new->vram >> 20);
+        snprintf(str_vram, 31, "%dK", new->vram);
         str_vram[31] = '\0';
 
         if (parallelsCmdRun(PRLCTL, "set", pdom->uuid,
-- 
1.9.1

--
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]