QEMU 3.10からバージョン4.2.1へのアップグレードにより既存のKVMゲストがOracle Linux 7で起動できなくなる

KVMホストをQEMUバージョン3.10からバージョン4.2.1にアップグレードしようとすると、libvirtサーバー・エラーが発生し、既存のKVMゲストがOracle Linux 7ホストで起動できなくなる場合があります。

次のようなエラーが表示されます。

Upgrade qemu-3.1.0-7.el7.x86_64 to qemu-4.2.1-4.el7.x86_64, kvm can not be
started, got below libvirt service error:

Dec 21 15:10:48 ca-ex05db01.us.oracle.com libvirtd[23588]: Unable to read
from monitor: Connection reset by peer
Dec 21 15:10:48 ca-ex05db01.us.oracle.com libvirtd[23588]: internal error:
qemu unexpectedly closed the monitor: 2020-12-21T23:10:48.306929Z
qemu-system-x86_64: We need to set caching-mode=on for intel-iommu to enable
device assignment with IOMMU protection.
Dec 21 15:10:52 ca-ex05db01.us.oracle.com libvirtd[23588]: internal error:
Failed to autostart VM 'ca-ex05db01vm01.us.oracle.com': internal error: qemu
unexpectedly closed the monitor: 2020-12-21T23:10:48.306929Z
qemu-system-x86_64: We need to set caching-mode=on for intel-iommu to enable
device assignment with IOMMU protection.
Dec 21 15:10:52 ca-ex05db01.us.oracle.com libvirtd[23588]: nl_recv returned
with error: No buffer space available

この問題を回避して、KVMゲストが更新されたqemuバージョンを実行できるようにするには、各KVMゲストのXMLファイルを編集し、各ドライバのサブ要素のiommuセクションにcaching_mode='on'パラメータを追加します(次の例を参照)。

<iommu model='intel'>
      <driver aw_bits='48' caching_mode='on'/>
    </iommu>

(バグID 32312933)