target/s390x/kvm/pv: Provide some more useful information if decryption fails
authorThomas Huth <thuth@redhat.com>
Wed, 10 Jan 2024 14:29:16 +0000 (15:29 +0100)
committerThomas Huth <thuth@redhat.com>
Thu, 11 Jan 2024 13:12:59 +0000 (14:12 +0100)
commit7af51621b16ae86646cc2dc9dee30de8176ff761
tree05bc405132e559d935c53e0aeee280a348e4fe01
parentcdd30f369a21def5cfdd610753d319c29f75a0a8
target/s390x/kvm/pv: Provide some more useful information if decryption fails

It's a common scenario to copy guest images from one host to another
to run the guest on the other machine. This (of course) does not work
with "secure execution" guests since they are encrypted with one certain
host key. However, if you still (accidentally) do it, you only get a
very user-unfriendly error message that looks like this:

 qemu-system-s390x: KVM PV command 2 (KVM_PV_SET_SEC_PARMS) failed:
  header rc 108 rrc 5 IOCTL rc: -22

Let's provide at least a somewhat nicer hint to the users so that they
are able to figure out what might have gone wrong.

Buglink: https://issues.redhat.com/browse/RHEL-18212
Message-ID: <20240110142916.850605-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/s390x/ipl.c
hw/s390x/ipl.h
hw/s390x/s390-virtio-ccw.c
target/s390x/kvm/pv.c
target/s390x/kvm/pv.h