Bug 896604 - libvirt: qemu, qxl device: support ram_size parameter
libvirt: qemu, qxl device: support ram_size parameter
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
urgent Severity urgent
: rc
: ---
Assigned To: Eric Blake
Virtualization Bugs
: FutureFeature, ZStream
Depends On: 921128
Blocks: 896690 894350 915352
  Show dependency treegraph
 
Reported: 2013-01-17 10:34 EST by Alon Levy
Modified: 2013-11-21 03:40 EST (History)
14 users (show)

See Also:
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.
Story Points: ---
Clone Of:
: 921128 (view as bug list)
Environment:
Last Closed: 2013-11-21 03:40:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alon Levy 2013-01-17 10:34:27 EST
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 09:41:56 EST
v2 is awaiting review here: https://www.redhat.com/archives/libvir-list/2013-January/msg01367.html

Thanks,
Alon
Comment 3 Eric Blake 2013-01-22 16:59:30 EST
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".
    
    <video>
      <model type='qxl' ram='65536' vram='65536' heads='1'/>
    </video>
    
    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
    
    or
    
    -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 17:04:14 EST
I'll cover the backport
Comment 5 Eric Blake 2013-01-22 18:35:10 EST
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 09:06:06 EST
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 17:09:34 EST
Although the bulk of this patch is picked up by rebasing, we need a RHEL-only patch to round it out:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-March/msg00031.html
Comment 14 Eric Blake 2013-03-13 10:08:46 EDT
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-13 21:59:45 EDT
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2013-March/msg00708.html
Comment 16 Eric Blake 2013-03-14 14:59:19 EDT
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-0.12.1.2-rhel62-beta-device:
    Likewise.
Comment 18 CongDong 2013-07-10 02:47:11 EDT
I can reproduce this bug:
Version:
libvirt-0.10.2-18.el6.x86_64
Steps:
1.prepare a guest with qxl video device.
# virsh dumpxml test
...
    <video>
      <model type='qxl' vram='65536' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
...
2. try to add paremeter "ram='65536'" to the video model.

Result:
step1:
there is no ram in qxl video paremeters.

step2:
can't add ram to the xml

Verify:
Version:
libvirt-0.10.2-19.el6.x86_64
Steps:
As the steps above.

Result:
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 03:40:40 EST
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.

http://rhn.redhat.com/errata/RHBA-2013-1581.html

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