Bug 1473516

Summary: Fail to start domain with 'host-model' cpu mode from managedsave state on some machines
Product: Red Hat Enterprise Linux 9 Reporter: Yanqiu Zhang <yanqzhan>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
libvirt sub component: General QA Contact: Jing Qi <jinqi>
Status: CLOSED WONTFIX Docs Contact:
Severity: unspecified    
Priority: unspecified CC: dyuan, fjin, jsuchane, lhuang, lmen, mzhan, virt-maint, xuzhang, yalzhang, yanqzhan
Version: unspecifiedKeywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-15 07:27:02 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:
Bug Depends On:    
Bug Blocks: 1199452    

Description Yanqiu Zhang 2017-07-21 04:38:19 UTC
Description of problem:
the phenom CPU model defined in QEMU contains "npt" feature while libvirt doesn't know anything about the feature. When a new domain is started, QEMU disables this feature on host, which is ignored by libvirt (it doesn't know the feature), but once restoring the domain it sees QEMU unexpectedly disabled some feature and complains about it.

Version-Release number of selected component (if applicable):
libvirt-3.2.0-14.el7_4.2.x86_64

How reproducible:
100% (on some machines)

Steps to Reproduce:
virsh # capabilities 
<capabilities>

  <host>
    <uuid>00020003-0004-0005-0006-000700080009</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Opteron_G2</model>
      <vendor>AMD</vendor>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='vme'/>
      <feature name='ht'/>
      <feature name='mmxext'/>
      <feature name='fxsr_opt'/>
      <feature name='3dnowext'/>
      <feature name='3dnow'/>
      <feature name='cmp_legacy'/>
      <feature name='extapic'/>
      <feature name='cr8legacy'/>
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
    </cpu>

1.Config domain xml as:
# virsh dumpxml avocado-vt-vm1
...
  <cpu mode='host-model' check='partial'>
    <model fallback='allow'/>
  </cpu>
...

2.Start guest, check xml:
# virsh dumpxml avocado-vt-vm1
...
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>phenom</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='cx16'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='arat'/>
    <feature policy='require' name='lahf_lm'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='cr8legacy'/>
    <feature policy='disable' name='monitor'/>
    <feature policy='disable' name='svm'/>
    <feature policy='disable' name='popcnt'/>
    <feature policy='disable' name='pdpe1gb'/>
    <feature policy='disable' name='rdtscp'/>
    <feature policy='disable' name='abm'/>
    <feature policy='disable' name='sse4a'/>
  </cpu>
...

# virsh dumpxml avocado-vt-vm1 --migratable
...
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='forbid'>phenom</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='cx16'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='arat'/>
    <feature policy='require' name='lahf_lm'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='cr8legacy'/>
    <feature policy='disable' name='monitor'/>
    <feature policy='disable' name='svm'/>
  </cpu>
...

3.Do managedsave:
# virsh managedsave avocado-vt-vm1

Domain avocado-vt-vm1 state saved by libvirt

4.Try to start the domain:
# virsh start avocado-vt-vm1 
error: Failed to start domain avocado-vt-vm1
error: operation failed: guest CPU doesn't match specification


Actual results:
As in step4, starting the domain from a managedsave state failed with error that cpu doesn't match

Expected results:
Should succeed to start the domain without error.

Additional info:
1.Also reproduces on the libvirt 3.2.0-14.
2.Not reproduce on libvirt-3.2.0-13.el7.x86_64

Comment 5 Jiri Denemark 2019-04-25 08:23:38 UTC
This bug is going to be addressed in next major release.

Comment 8 John Ferlan 2021-09-09 18:28:36 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 9 RHEL Program Management 2022-01-15 07:27:02 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.