]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
Exit with a user-friendly message instead of tripping an assert
authorngie <ngie@FreeBSD.org>
Thu, 22 Oct 2015 08:37:11 +0000 (08:37 +0000)
committerngie <ngie@FreeBSD.org>
Thu, 22 Oct 2015 08:37:11 +0000 (08:37 +0000)
if vm_activate_cpu(..) fails when called from fbsdrun_addcpu(..)

MFC after: 1 week
PR: 203884
Reviewed by: grehan
Submitted by: William Orr <will@worrbase.com>

usr.sbin/bhyve/bhyverun.c

index bc49c57769875e42b816ed9dc91397afdb08ca16..4fd9c358f82a3d394c6fcb20686775fe3b7c3a5c 100644 (file)
@@ -261,7 +261,8 @@ fbsdrun_addcpu(struct vmctx *ctx, int fromcpu, int newcpu, uint64_t rip)
         * with vm_suspend().
         */
        error = vm_activate_cpu(ctx, newcpu);
-       assert(error == 0);
+       if (error != 0)
+               err(EX_OSERR, "could not activate CPU %d", newcpu);
 
        CPU_SET_ATOMIC(newcpu, &cpumask);