[PATCH kvm-unit-tests] vmx: always do vmxoff, even if test init function failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Otherwise, the next test breaks with "vmxon failed".

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 x86/vmx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/x86/vmx.c b/x86/vmx.c
index 5bb5969..2d601cc 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -868,7 +868,7 @@ static int test_run(struct vmx_test *test)
 	/* Directly call test->init is ok here, init_vmcs has done
 	   vmcs init, vmclear and vmptrld*/
 	if (test->init && test->init(test->vmcs) != VMX_TEST_START)
-		return 0;
+		goto out;
 	test->exits = 0;
 	current = test;
 	regs = test->guest_regs;
@@ -876,6 +876,7 @@ static int test_run(struct vmx_test *test)
 	launched = 0;
 	printf("\nTest suite: %s\n", test->name);
 	vmx_run();
+out:
 	if (vmx_off()) {
 		printf("%s : vmxoff failed.\n", __func__);
 		return 1;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux