Re: [PATCH] kvm-unit-tests : The first version of VMX nested test case

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

 



On Tue, Jul 16, 2013 at 12:28:05PM +0200, Paolo Bonzini wrote:
> > +void vmx_exit(void)
> > +{
> > +	test_vmxoff();
> > +	printf("\nSUMMARY: %d tests, %d failures\n", tests, fails);
> > +	exit(fails ? -1 : 0);
> > +}
> 
> Can you try to jump back to main, and do test_vmxoff there?  This will
> avoid having to write our tests in callback style, which is a pain.
> Basically something similar to setjmp/longjmp.  In main:
> 
> 	if (setjmp(jmpbuf) == 0) {
> 		vmx_run();
> 		/* Should not reach here */
> 		report("test vmlaunch", 0);
> 	}
> 	test_vmxoff();
> 
> exit:
> 	printf("\nSUMMARY: %d tests, %d failures\n", tests, fails);
> 	return fails ? 1 : 0;
> 
> In vmx_handler:
> 
> 	case VMX_HLT:
> 		printf("\nVM exit.\n");
> 		longjmp(jmpbuf, 1);
> 
Why not just make vmexit occur after vmlaunch/vmresume like KVM does. It
will make code much more straightforward and easer to follow.

--
			Gleb.
--
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