Bug 1660711 - [POWER]The cpu fallback changed after restart libvirtd
Summary: [POWER]The cpu fallback changed after restart libvirtd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: ppc64le
OS: Linux
medium
medium
Target Milestone: rc
: 8.3
Assignee: Daniel Henrique Barboza (IBM)
QA Contact: Dan Zheng
URL:
Whiteboard:
Depends On:
Blocks: 1701800
TreeView+ depends on / blocked
 
Reported: 2018-12-19 03:29 UTC by Junxiang Li
Modified: 2020-11-17 17:45 UTC (History)
11 users (show)

Fixed In Version: libvirt-6.4.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1701800 (view as bug list)
Environment:
Last Closed: 2020-11-17 17:44:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Junxiang Li 2018-12-19 03:29:14 UTC
Description of problem:
The cpu model fallback changed after restart libvirtd

Version-Release number of selected component (if applicable):
# rpm -q qemu-kvm libvirt
qemu-kvm-2.12.0-44.module+el8+2259+6d80f0a6.ppc64le
libvirt-4.5.0-14.module+el8+2210+474b8474.ppc64le

How reproducible:
100%

Steps to Reproduce:
1.
Prepare a guest with the cpu model element.
<cpu mode='host-model' check='partial'>
    <model fallback='forbid'>power9</model>
</cpu>
2.
Start the guest and check the guest xml
virsh start test
virsh dumpxml test
The fallback is forbid now
3.
Restart libvirtd and check the guest xml
systemctl restart libvirtd
virsh dumpxml test
The fallback is changed to allow now

Actual results:
The fallback is changed

Expected results:
The fallback should not be changed

Additional info:
Could  be reproduced on POWER8/9, could not be reproduced on x86_64

Comment 1 Daniel Henrique Barboza (IBM) 2020-05-22 20:02:04 UTC
This bug happens due to an unintended side-effect of the fix for https://bugzilla.redhat.com/show_bug.cgi?id=1532980.

Starting on Libvirt 2.3, guests being launched with 'host-mode' will get their cpu->mode
converted from 'host-model' to 'custom' after launch. This caused problems with guests
created in Libvirt < 2.3, with fallback set to 'forbid', after a Libvirt update. Daemon
restart would convert the 'host-model' to 'custom', but the fallback set to 'forbid'
would make the translation fail, causing the problem described in 1532980. The fix
was to ignore the user defined 'fallback' setting, changing it to ALLOW in these
circumstances.

All other guest arch works this way, except for pSeries. pSeries operates
with 'host-model' regardless of Libvirt version due to specific compat mode
mechanics, never translating it to 'custom'. This means that we do no good 
changing 'fallback' to ALLOW for pSeries, being better of leaving the
user choice untouched.

The fix was posted in the ML:

https://www.redhat.com/archives/libvir-list/2020-May/msg01053.html

Comment 2 Daniel Henrique Barboza (IBM) 2020-05-25 22:17:35 UTC
Fix is available upstream:

commit 9665b27dba9f41fc51c6d2863eb017cadd760ccc
Author: Daniel Henrique Barboza <danielhb413>
Date:   Mon May 25 09:39:45 2020 -0300

    qemuProcessRefreshCPU: skip 'host-model' logic for pSeries guests

v6.3.0-169-g9665b27dba

Comment 3 Daniel Henrique Barboza (IBM) 2020-06-04 23:28:49 UTC
Andrea, do you know if 6.4.0 will be rebased into RHEL-AV 8.3?

Comment 4 Andrea Bolognani 2020-06-05 08:42:22 UTC
(In reply to dbarboza from comment #3)
> Andrea, do you know if 6.4.0 will be rebased into RHEL-AV 8.3?

Yes, and it looks like Jirka took care of that already :)

Comment 7 Dan Zheng 2020-06-23 07:03:41 UTC
Test package:
libvirt-6.4.0-1.module+el8.3.0+6881+88468c00.ppc64le
qemu-kvm-5.0.0-0.el8.dwg202005221156.ppc64le

1.
a> Edit guest with 
<cpu mode='host-model'>
    <model fallback='forbid'>power9</model>
</cpu>

b> Start the guest
c> Restart libvirtd
d> Dumpxml guest
  <cpu mode='host-model' check='partial'>
    <model fallback='forbid'>power9</model>
  </cpu>

There is no change for 'fallback' now.

2. 
a> Edit guest with below and save.
<cpu>
    <model>power9</model>
</cpu>
b> Edit guest again and some default values are automatically filled in.
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='allow'>power9</model>
  </cpu>
Change fallback to 'forbid'.

c> Start guest and dumpxml
  <cpu mode='host-model' check='partial'>
    <model fallback='forbid'>power9</model>
  </cpu>

Comment 11 errata-xmlrpc 2020-11-17 17:44:45 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 (virt:8.3 bug fix and enhancement update), 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/RHBA-2020:5137


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