Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2012 18:49:08 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r241490 - projects/bhyve/usr.sbin/bhyve
Message-ID:  <201210121849.q9CIn8h9056988@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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],



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210121849.q9CIn8h9056988>