coverity: fix coverity issues related to confidential guest reset
PATCH 1/1 coverity: fix coverity issues related to confidential guest reset
Fix issues reported by Peter.
Reported-by Peter Maydell <[email protected]>
Signed-off-by Ani Sinha <[email protected]>
--- system/runstate.c | 5 ++++- target/i386/sev.c | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-)
system/runstate.c +4 -1
@@ -512,9 +512,12 @@ void qemu_system_reset(ShutdownCause reason)ResetType type;AccelClass *ac =ACCEL_GET_CLASS (current_accel ());bool guest_state_rebuilt = false; +bool force_vmfd_change = false;int ret; mc = current_machine ?MACHINE_GET_CLASS (current_machine) :NULL ; + force_vmfd_change = current_machine ? + current_machine->new_accel_vmfd_on_reset : false;cpu_synchronize_all_states ();
@@ -528,7 +531,7 @@ void qemu_system_reset(ShutdownCause reason)if ((reason ==SHUTDOWN_CAUSE_GUEST_RESET || reason ==SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET ) && - (current_machine->new_accel_vmfd_on_reset || !cpus_are_resettable ())) { + (force_vmfd_change || !cpus_are_resettable ())) {if (ac->rebuild_guest) { ret = ac->rebuild_guest (current_machine);if (ret <0 ) {
target/i386/sev.c +0 -4
@@ -2011,10 +2011,6 @@ static void sev_handle_reset(Object *obj, ResetType type)SevCommonState *sev_common =SEV_COMMON (MACHINE (qdev_get_machine ())->cgs);SevCommonStateClass *klass =SEV_COMMON_GET_CLASS (sev_common); -if (!sev_common) { -return ; - } -if (!runstate_is_running ()) {return ; }
Signature · 1 line
2.42.0
Quoted 6 lines · Ani Sinha
Date: Wed, 11 Mar 2026 09:16:53 +0530
From: Ani Sinha <[email protected]>
Subject: [PATCH] coverity: fix coverity issues related to confidential
guest reset
X-Mailer: git-send-email 2.42.0
Quoted 8 lines
Fix issues reported by Peter.
Reported-by Peter Maydell <[email protected]>Signed-off-by Ani Sinha <[email protected]>--- system/runstate.c | 5 ++++- target/i386/sev.c | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-)
It's better to add Fixes tag or links.
Otherwise,
Reviewed-by Zhao Liu <[email protected]>