]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Parallels: fix error with video card RAM dimension
authorAlexander Burluka <aburluka@parallels.com>
Fri, 22 Aug 2014 11:04:44 +0000 (15:04 +0400)
committerJán Tomko <jtomko@redhat.com>
Fri, 22 Aug 2014 12:31:11 +0000 (14:31 +0200)
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

index 5ccf5e4ab190e16ff1527c2561518404a6ec5c6c..5532a2a22502c68cb3e2147da5bdd5750708e2f5 100644 (file)
@@ -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,