Bug 896604 - libvirt: qemu, qxl device: support ram_size parameter
Summary: libvirt: qemu, qxl device: support ram_size parameter
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
Depends On: 921128
Blocks: 896690 894350 915352
TreeView+ depends on / blocked
Reported: 2013-01-17 15:34 UTC by Alon Levy
Modified: 2013-11-21 08:40 UTC (History)
14 users (show)

Fixed In Version: libvirt-0.10.2-19.el6
Doc Type: Enhancement
Doc Text:
Feature: Libvirt must expose ram_size settings to qxl device. Reason: When using multiple heads in one PCI device, the device needs more RAM assigned. Result (if any): Libvirt can drive multi-head QXL.
Clone Of:
: 921128 (view as bug list)
Last Closed: 2013-11-21 08:40:40 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1581 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2013-11-21 01:11:35 UTC

Description Alon Levy 2013-01-17 15:34:27 UTC
Add support for a ram_size parameter similar to the current support for vram_size.

Rationale: To allow a compatible performance of a single pci device using the new multiple monitor support to the old multiple pci card solution, we need to be able to set the memory of the ram bar to larger then the default size. We can already do the same to the vram bar (second bar) because the support was added by:

2011-03-06  Osier Yang  <jyang@redhat.com>

        qemu: Support vram for video of qxl type

related: #894350 PRD32 - [RFE] qxl device should support multiple monitors

Comment 2 Alon Levy 2013-01-22 14:41:56 UTC
v2 is awaiting review here: https://www.redhat.com/archives/libvir-list/2013-January/msg01367.html


Comment 3 Eric Blake 2013-01-22 21:59:30 UTC
Fixed upstream with:
commit 55bfd020d8d9de40977832c4762728090df2bee3
Author: Alon Levy <alevy@redhat.com>
Date:   Fri Jan 18 20:36:36 2013 +0200

    qemu: Support ram bar size for qxl devices
    Adds a "ram" attribute globally to the video.model element, that changes
    the resulting qemu command line only if video.type == "qxl".
      <model type='qxl' ram='65536' vram='65536' heads='1'/>
    That attribute gets a default value of 64*1024. The schema is unchanged
    for other video element types.
    The resulting qemu command line change is the addition of
    -global qxl-vga.ram_size=<ram>*1024
    -global qxl.ram_size=<ram>*1024
    For the main and secondary qxl devices respectively.
    The default for the qxl ram bar is 64*1024 kilobytes (the same as the
    default qxl vram bar size).

Comment 4 Eric Blake 2013-01-22 22:04:14 UTC
I'll cover the backport

Comment 5 Eric Blake 2013-01-22 23:35:10 UTC
It turns out that backporting just this patch in isolation doesn't make sense; I'm instead working on backporting all the patches related to multi-monitor qxl support:
632c60e qemu: Detect VGA_QXL capability correctly
ed6fc41 tests: add one -device video device testcase
aa51202 qemu: use newer -device video device in qemu commandline
09938bb conf: add optional attribte primary to video <model> element
4c993d8 qemu: add qemu vga devices caps and one cap to mark them usable

Comment 8 Eric Blake 2013-01-23 14:06:06 UTC
Hmm, the upstream patches set a capability based solely on a version check:

+    if (version >= 1002000)
+        qemuCapsSet(caps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);

This series may need to include a RHEL-specific patch that scrapes some additional string out of -help output in order to set that capability even when targeting RHEL's 0.12.x version number.

Comment 13 Eric Blake 2013-03-06 22:09:34 UTC
Although the bulk of this patch is picked up by rebasing, we need a RHEL-only patch to round it out:

Comment 14 Eric Blake 2013-03-13 14:08:46 UTC
Moving back to assigned - based on discussion on 915352, upstream libvirt should be probing for qxl-vga.surfaces instead of a hard-coded version check for 1.2; we should backport that patch instead of a RHEL-specific patch.  Meanwhile, I will clone this back to qemu, to make sure RHEL qemu exposes qxl-vga.surfaces.

Comment 15 Eric Blake 2013-03-14 01:59:45 UTC
Upstream patch proposed:

Comment 16 Eric Blake 2013-03-14 18:59:19 UTC
Back in POST; next rebase will pick up:

commit 5ac846e42e5b7e0475f6aa9cc1e0b0c8dac84d44
Author: Eric Blake <eblake@redhat.com>
Date:   Wed Mar 13 18:41:22 2013 -0600

    qemu: detect multi-head qxl via more than version check
    Multi-head QXL support is so useful that distros have started to
    backport it to qemu earlier than 1.2.  After discussion with
    Alon Levy, we determined that the existence of the qxl-vga.surfaces
    property is a reliable indicator of whether '-device qxl-vga' works,
    or whether we have to stick to the older '-vga qxl'.  I'm leaving
    in the existing check for QEMU_CAPS_DEVICE_VIDEO_PRIMARY tied to
    qemu 1.2 and newer (in case qemu is built without qxl support),
    but for those distros that backport qxl, this additional capability
    check will allow the correct command line for both RHEL 6.3 (which
    lacks the feature) and RHEL 6.4 (where qemu still claims to be
    version 0.12.2.x, but has backported multi-head qxl).
    * src/qemu/qemu_capabilities.c (virQEMUCapsObjectPropsQxlVga): New
    property test.
    (virQEMUCapsExtractDeviceStr): Probe for backport of new
    capability to qemu earlier than 1.2.
    * tests/qemuhelpdata/qemu-kvm-1.2.0-device: Update test.
    * tests/qemuhelpdata/qemu-1.2.0-device: Likewise.
    * tests/qemuhelpdata/qemu-kvm-

Comment 18 CongDong 2013-07-10 06:47:11 UTC
I can reproduce this bug:
1.prepare a guest with qxl video device.
# virsh dumpxml test
      <model type='qxl' vram='65536' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
2. try to add paremeter "ram='65536'" to the video model.

there is no ram in qxl video paremeters.

can't add ram to the xml

As the steps above.

1.step1. the xml have the ram patemeter in the qxl model.
2. can change the size of ram

As the result , change to VERIFIED

Comment 20 errata-xmlrpc 2013-11-21 08:40:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.