Re: [PATCH v4 6/6] qemu-command: introduce new vgamem attribute for QXL video device

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

 



On 11/24/2014 06:04 PM, Peter Krempa wrote:
On 11/24/14 16:04, Pavel Hrdina wrote:
Add attribute to set vgamem_mb parameter of QXL device for QEMU. This
value sets the size of VGA framebuffer for QXL device. Default value in
QEMU is 8MB so reuse it also in libvirt to not break things.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
  docs/formatdomain.html.in                          |  5 ++++-
  docs/schemas/domaincommon.rng                      |  5 +++++
  src/conf/domain_conf.c                             | 26 ++++++++++++++++++++++
  src/conf/domain_conf.h                             |  1 +
  src/qemu/qemu_command.c                            | 22 ++++++++++++++++--
  src/qemu/qemu_domain.c                             | 18 +++++++++++++++
  .../qemuxml2argv-graphics-spice-compression.xml    |  4 ++--
  .../qemuxml2argv-graphics-spice-qxl-vga.xml        |  4 ++--
  .../qemuxml2argv-graphics-spice.xml                |  4 ++--
  .../qemuxml2argv-pcihole64-q35.xml                 |  2 +-
  tests/qemuxml2argvdata/qemuxml2argv-q35.xml        |  2 +-
  .../qemuxml2argv-serial-spiceport.xml              |  2 +-
  .../qemuxml2argv-video-qxl-device-vgamem.args      |  4 ++--
  .../qemuxml2argv-video-qxl-sec-device-vgamem.args  |  6 ++---
  tests/qemuxml2argvtest.c                           |  6 +++--
  tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml    |  2 +-
  16 files changed, 93 insertions(+), 20 deletions(-)


diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 01bf39b..49aa446 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1176,6 +1176,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
          goto cleanup;
      }

+    if (dev->type == VIR_DOMAIN_DEVICE_VIDEO &&
+        dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
+        if (dev->data.video->vgamem) {
+            if (dev->data.video->vgamem < 1024) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("value for 'vgamem' must be at least 1 MiB"));

I'd add "(1024 KiB)".

+                goto cleanup;
+            }
+            if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("value for 'vgamem' must be power of two"));
+                goto cleanup;
+            }
+        } else {
+            dev->data.video->vgamem = 8 * 1024;
+        }
+    }
+
      ret = 0;


Looks good. ACK.

Peter



I've updated all patches according your comments and pushed it, thanks
for the review.

Pavel.

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