svn commit: r241490 - projects/bhyve/usr.sbin/bhyve

Neel Natu neel at FreeBSD.org
Fri Oct 12 18:49:08 UTC 2012


Author: neel
Date: Fri Oct 12 18:49:07 2012
New Revision: 241490
URL: http://svn.freebsd.org/changeset/base/241490

Log:
  Deal with transient EBUSY error return from vm_run() by retrying the operation.

Modified:
  projects/bhyve/usr.sbin/bhyve/fbsdrun.c

Modified: projects/bhyve/usr.sbin/bhyve/fbsdrun.c
==============================================================================
--- projects/bhyve/usr.sbin/bhyve/fbsdrun.c	Fri Oct 12 18:32:44 2012	(r241489)
+++ projects/bhyve/usr.sbin/bhyve/fbsdrun.c	Fri Oct 12 18:49:07 2012	(r241490)
@@ -516,8 +516,19 @@ vm_loop(struct vmctx *ctx, int vcpu, uin
 
 	while (1) {
 		error = vm_run(ctx, vcpu, rip, &vmexit[vcpu]);
-		if (error != 0)
-			break;
+		if (error != 0) {
+			/*
+			 * It is possible that 'vmmctl' or some other process
+			 * has transitioned the vcpu to CANNOT_RUN state right
+			 * before we tried to transition it to RUNNING.
+			 *
+			 * This is expected to be temporary so just retry.
+			 */
+			if (errno == EBUSY)
+				continue;
+			else
+				break;
+		}
 
 		prevcpu = vcpu;
                 rc = (*handler[vmexit[vcpu].exitcode])(ctx, &vmexit[vcpu],


More information about the svn-src-projects mailing list