mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
s390x/pv: Fix spurious warning with asynchronous teardown
Kernel commit 292a7d6fca33 ("KVM: s390: pv: fix asynchronous teardown
for small VMs") causes the KVM_PV_ASYNC_CLEANUP_PREPARE ioctl to fail
if the VM is not larger than 2GiB. QEMU would attempt it and fail,
print an error message, and then proceed with a normal teardown.
Avoid attempting to use asynchronous teardown altogether when the VM is
not larger than 2 GiB. This will avoid triggering the error message and
also avoid pointless overhead; normal teardown is fast enough for small
VMs.
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Fixes: c3a073c610
("s390x/pv: Add support for asynchronous teardown for reboot")
Link: https://lore.kernel.org/all/20230421085036.52511-2-imbrenda@linux.ibm.com/
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-Id: <20230510105531.30623-2-imbrenda@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[thuth: Fix inline function parameter in pv.h]
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
80bd81cadd
commit
88693ab2a5
3 changed files with 12 additions and 6 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <linux/kvm.h>
|
||||
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/kvm.h"
|
||||
|
@ -115,7 +116,7 @@ static void *s390_pv_do_unprot_async_fn(void *p)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool s390_pv_vm_try_disable_async(void)
|
||||
bool s390_pv_vm_try_disable_async(S390CcwMachineState *ms)
|
||||
{
|
||||
/*
|
||||
* t is only needed to create the thread; once qemu_thread_create
|
||||
|
@ -123,7 +124,12 @@ bool s390_pv_vm_try_disable_async(void)
|
|||
*/
|
||||
QemuThread t;
|
||||
|
||||
if (!kvm_check_extension(kvm_state, KVM_CAP_S390_PROTECTED_ASYNC_DISABLE)) {
|
||||
/*
|
||||
* If the feature is not present or if the VM is not larger than 2 GiB,
|
||||
* KVM_PV_ASYNC_CLEANUP_PREPARE fill fail; no point in attempting it.
|
||||
*/
|
||||
if ((MACHINE(ms)->maxram_size <= 2 * GiB) ||
|
||||
!kvm_check_extension(kvm_state, KVM_CAP_S390_PROTECTED_ASYNC_DISABLE)) {
|
||||
return false;
|
||||
}
|
||||
if (s390_pv_cmd(KVM_PV_ASYNC_CLEANUP_PREPARE, NULL) != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue