From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 19 18:05:51 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E11E84D; Tue, 19 Aug 2014 18:05:51 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6F003D9A; Tue, 19 Aug 2014 18:05:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BA330B9A3; Tue, 19 Aug 2014 14:05:49 -0400 (EDT) From: John Baldwin To: freebsd-virtualization@freebsd.org Subject: Re: libvirt and rebooting of a bhyve VM Date: Tue, 19 Aug 2014 13:32:48 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <20140819154035.GA62903@kloomba> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201408191332.48730.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 19 Aug 2014 14:05:49 -0400 (EDT) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2014 18:05:51 -0000 On Tuesday, August 19, 2014 11:50:43 am Craig Rodrigues wrote: > On Tue, Aug 19, 2014 at 8:40 AM, Roman Bogorodskiy wrote: > > Hi Craig, > > > > Unfortunately, I'm not sure how to get the reboot working. Moreover, I > > get the same behaviour when starting bhyve manually -- when I do a > > reboot, bhyve(8) exits as soon as the system is ready to restart. > > > > So looks like that's a default bhyve behaviour or I'm missing something? > > Well, if you look at /usr/share/examples/bhyve/vmrun.sh, you > will see that byvectl --destroy --vm=xx ; bhyveload; bhyve > is run in a loop. That loop only terminates of bhyve returns non-zero. > > I don't think that this is a very good API, but that's what we have for now. > > If there was some way to detect of the bhyve process exited due to > ACPI shutdown or normal reboot, that would be helpful. That would > help people writing scripts around bhyve. The exit code is different. An ACPI shutdown uses an exit code of 1 whereas a reboot uses an exit code of 0 IIRC. -- John Baldwin