From owner-svn-src-projects@FreeBSD.ORG Fri Oct 12 18:49:08 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEDAEDB8; Fri, 12 Oct 2012 18:49:08 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 985A28FC19; Fri, 12 Oct 2012 18:49:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9CIn8bO056990; Fri, 12 Oct 2012 18:49:08 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9CIn8h9056988; Fri, 12 Oct 2012 18:49:08 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201210121849.q9CIn8h9056988@svn.freebsd.org> From: Neel Natu Date: Fri, 12 Oct 2012 18:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r241490 - projects/bhyve/usr.sbin/bhyve X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 18:49:08 -0000 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],