diff options
author | neel <neel@FreeBSD.org> | 2012-10-12 18:49:07 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2012-10-12 18:49:07 +0000 |
commit | 4650e5d7766fa77e268a3c84cc8bd08857bb0287 (patch) | |
tree | 52ec880494be654ccb2787dc8c5cd9bdf5c0acd1 /usr.sbin/bhyve | |
parent | e3e8a520e280f32230da3ddfa4c5260fea0e15a1 (diff) | |
download | FreeBSD-src-4650e5d7766fa77e268a3c84cc8bd08857bb0287.zip FreeBSD-src-4650e5d7766fa77e268a3c84cc8bd08857bb0287.tar.gz |
Deal with transient EBUSY error return from vm_run() by retrying the operation.
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r-- | usr.sbin/bhyve/fbsdrun.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/fbsdrun.c b/usr.sbin/bhyve/fbsdrun.c index b8bebba..1d59425 100644 --- a/usr.sbin/bhyve/fbsdrun.c +++ b/usr.sbin/bhyve/fbsdrun.c @@ -516,8 +516,19 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip) 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], |