Bug 1402690

Summary: maxvcpus failed with unable to find emulator error
Product: Red Hat Enterprise Linux 7 Reporter: Wayne Sun <gsun>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.4CC: abologna, dzheng, jdenemar, pkrempa, rbalakri
Target Milestone: rc   
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-3.0.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 17:19:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wayne Sun 2016-12-08 07:22:27 UTC
Description of problem:
both maxvcpus and domcapabilites failed on ppc host

Version-Release number of selected component (if applicable):
libvirt-2.5.0-1.el7.ppc64le
qemu-kvm-rhev-2.6.0-29.el7.ppc64le
kernel-3.10.0-529.el7.ppc64le

How reproducible:
always

Steps to Reproduce:
1. run maxvcpus and domcapabilites
# virsh maxvcpus
error: invalid argument: unable to find any emulator to serve 'ppc64le' architecture

# virsh domcapabilities
error: failed to get emulator capabilities
error: invalid argument: unable to find any emulator to serve 'ppc64le' architecture


2.
3.

Actual results:
fail

Expected results:
success

Additional info:

Comment 2 Peter Krempa 2016-12-09 14:59:26 UTC
Fixed upstream:

commit bd4ae4f5e881276b05e48fbd55a29c57cf1a25ff
Author: Peter Krempa <pkrempa>
Date:   Thu Dec 8 09:36:43 2016 +0100

    virsh: maxvcpus: Always fall back to the old command if domain caps fail
    
    1ec22be5 added code that detects the maximum cpu count according to
    domain capabilities. The code fell back to the old command only if the
    API was not supported. If the API fails for other reasons the command
    would fail. There's no point in not trying the old API in such case.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1402690

Comment 4 Dan Zheng 2017-03-06 08:58:48 UTC
Test packages:

libvirt-3.1.0-1.el7.ppc64le
qemu-kvm-rhev-2.8.0-5.el7.ppc64le
kernel-3.10.0-578.el7.ppc64le

Steps:
# virsh maxvcpus
80

# virsh maxvcpus kvm
80

# virsh maxvcpus qemu
255

# virsh domcapabilities
<domainCapabilities>
  <path>/usr/libexec/qemu-kvm</path>
  <domain>kvm</domain>
  <machine>pseries-rhel7.4.0</machine>
  <arch>ppc64le</arch>
  <vcpu max='80'/>
  <os supported='yes'>
    <loader supported='yes'>
      <enum name='type'>
        <value>rom</value>
        <value>pflash</value>
      </enum>
      <enum name='readonly'>
        <value>yes</value>
        <value>no</value>
      </enum>
    </loader>
  </os>
  <cpu>
    <mode name='host-passthrough' supported='yes'/>
    <mode name='host-model' supported='yes'>
      <model fallback='allow'>POWER8</model>
      <vendor>IBM</vendor>
    </mode>
    <mode name='custom' supported='yes'>
      <model usable='unknown'>POWER8</model>
      <model usable='unknown'>POWER7</model>
      <model usable='unknown'>POWER8</model>
    </mode>
  </cpu>
  <devices>
    <disk supported='yes'>
      <enum name='diskDevice'>
        <value>disk</value>
        <value>cdrom</value>
        <value>lun</value>
      </enum>
      <enum name='bus'>
        <value>ide</value>
        <value>scsi</value>
        <value>virtio</value>
        <value>usb</value>
      </enum>
    </disk>
    <graphics supported='yes'>
      <enum name='type'>
        <value>sdl</value>
        <value>vnc</value>
      </enum>
    </graphics>
    <video supported='yes'>
      <enum name='modelType'>
        <value>vga</value>
        <value>virtio</value>
      </enum>
    </video>
    <hostdev supported='yes'>
      <enum name='mode'>
        <value>subsystem</value>
      </enum>
      <enum name='startupPolicy'>
        <value>default</value>
        <value>mandatory</value>
        <value>requisite</value>
        <value>optional</value>
      </enum>
      <enum name='subsysType'>
        <value>usb</value>
        <value>pci</value>
        <value>scsi</value>
      </enum>
      <enum name='capsType'/>
      <enum name='pciBackend'>
        <value>default</value>
        <value>vfio</value>
      </enum>
    </hostdev>
  </devices>
  <features>
    <gic supported='no'/>
  </features>
</domainCapabilities>

Also try other options like:
# virsh domcapabilities --virttype kvm
# virsh domcapabilities --emulatorbin /usr/libexec/qemu-kvm
# virsh domcapabilities --arch ppc64le
# virsh domcapabilities --arch ppc64
# virsh domcapabilities --machine pseries
# virsh domcapabilities --machine pseries-rhel7.3.0
# virsh domcapabilities --machine pseries-rhel7.4.0

All are pass.

Comment 5 errata-xmlrpc 2017-08-01 17:19:14 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.

https://access.redhat.com/errata/RHEA-2017:1846

Comment 6 errata-xmlrpc 2017-08-01 23:59:00 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.

https://access.redhat.com/errata/RHEA-2017:1846