Bug 1191229 - RFE: test: Allow passing in custom capabilities XML to the test driver
Summary: RFE: test: Allow passing in custom capabilities XML to the test driver
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-10 18:47 UTC by Christy Norman
Modified: 2020-11-03 17:13 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-03 17:13:10 UTC
Embargoed:


Attachments (Terms of Use)
reproducer (503 bytes, text/plain)
2015-02-10 18:47 UTC, Christy Norman
no flags Details
entire output of capabilities from test and regular driver connections (10.23 KB, text/plain)
2015-02-10 18:48 UTC, Christy Norman
no flags Details
cpuinfo output (3.77 KB, text/plain)
2015-02-10 18:48 UTC, Christy Norman
no flags Details

Description Christy Norman 2015-02-10 18:47:15 UTC
Created attachment 990197 [details]
reproducer

Description of problem:

The test driver capabilities on my system are 

<capabilities>

  <host>
    <cpu>
      <arch>i686</arch>
      <features>
        <pae/>
        <nonpae/>
      </features>
    </cpu>
  ...
  </host>

  ...
  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/bin/test-hv</emulator>
      <domain type='test'>
      </domain>
    </arch>
    <features>
      <pae/>
      <nonpae/>
    </features>
  </guest>

But for the regular driver are:

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>


Version-Release number of selected component (if applicable):

libvirt-python-1.2.9-1.fc21.x86_64
libvirt-1.2.9.1-2.fc21.x86_64
libvirt-daemon-driver-qemu-1.2.9.1-2.fc21.x86_64
qemu-img-2.1.3-1.fc21.x86_64
qemu-kvm-2.1.3-1.fc21.x86_64
qemu-guest-agent-2.1.3-1.fc21.x86_64
qemu-system-x86-2.1.3-1.fc21.x86_64
qemu-common-2.1.3-1.fc21.x86_64

How reproducible:
Consistently. ]
Including a reproducer.

Steps to Reproduce:
See reproducer, or, using kimchi, run the feature test failing at https://github.com/kimchi-project/kimchi/issues/591#issuecomment-73494807

This only fails on my laptop, which is unfortunate for me. Including cpuinfo.

Note: I also installed a fresh Fedora 21 VM on my system to make sure I didn't have a package out of whack somewhere, and was able to reproduce the issue there.

Actual results:
Unable to create test guest with same arch as host.

Expected results:
Able to create guest.

Additional info:
attaching cpuinfo

Comment 1 Christy Norman 2015-02-10 18:48:07 UTC
Created attachment 990198 [details]
entire output of capabilities from test and regular driver connections

Comment 2 Christy Norman 2015-02-10 18:48:28 UTC
Created attachment 990199 [details]
cpuinfo output

Comment 3 Christy Norman 2015-02-10 18:50:19 UTC
The error message:

libvirt: Domain Config error : internal error: No guest options available for arch 'x86_64'

Comment 4 Cole Robinson 2015-04-02 18:00:57 UTC
Yeah this is a long standing problem with the test driver.

Libvirt allows passing in custom XML for all sorts of objects like domains, storage, etc. See virt-manager's testdriver file: https://git.fedorahosted.org/cgit/virt-manager.git/tree/tests/testdriver.xml

But it doesn't allow registering arbitrary capabilities XML. That's because internally libvirt doesn't have a parser for capabilities XML, it's write-only. And there's not a ton of incentive to write a parser for the XML, it would probably be 1000 lines of code that would only be useful for the testdriver

In virt-manager we hack around around this by letting our test infrastructure advertise arbitrary capabilities XML, but at VM define time we sanitize the arch to i686 and domain type to 'test', so the test driver doesn't complain. This works fairly well and we have a large battery of tests for our non-x86 generation, it's useful for virt-manager UI testing, etc.

See _sanitize_xml here:
https://git.fedorahosted.org/cgit/virt-manager.git/tree/virtinst/connection.py

But it's still a valid request for libvirt to allow passing capabilities XML to the test driver, just not sure if it will ever be implemented unless someone scratches their itch.

Comment 5 Daniel Berrangé 2020-11-03 17:13:10 UTC
Thank you for reporting this issue to the libvirt project. Unfortunately we have been unable to resolve this issue due to insufficient maintainer capacity and it will now be closed. This is not a reflection on the possible validity of the issue, merely the lack of resources to investigate and address it, for which we apologise. If you none the less feel the issue is still important, you may choose to report it again at the new project issue tracker https://gitlab.com/libvirt/libvirt/-/issues The project also welcomes contribution from anyone who believes they can provide a solution.


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