Cole Robinson wrote:
On 04/24/2016 02:11 PM, Roman Bogorodskiy wrote:
> Bhyve supports ACPI shutdown by issuing SIGTERM signal to the bhyve
> process. Add the bhyveDomainShutdown() function and
> virBhyveProcessShutdown() helper function that just sends SIGTERM to
> VM's bhyve process. If a guest supports ACPI shutdown then process
> will be terminated and this event will be noticed by the bhyve monitor
> code that will handle setting proper status and clean up VM's resources.
>
> Also, remove usage of virProcessKillPainfully() from domainDestroy.
> First, it sends SIGTERM to the process that actually triggers ACPI reset
do you mean 'ACPI shutdown' here? That's what it says in the below comments
Oops, yes, I was talking about "ACPI shutdown".
> and that's not we want to do. Second, we're doing
bhyvectl --destroy
> later and it kills bhyve process, so there's no need to manually kill
> it.
This seems like two distinct changes, please send as two patches and I'll review
Will do.
One general comment: what handles the equivalent of bhyveNetCleanup
for
graceful VM shutdown? The bhyve process itself?
No, bhyve process does not do cleanup. It works this way:
* We send SIGTERM to the bhyve process
- If the guest does not support ACPI shutdown, nothing happens (VM
remains running like nothing has happened).
- If the guest does support ACPI shutdown, it takes some time for it
to shut itself down, then the corresponding bhyve process exits,
however, the vmm node stays.
Then code in bhyve_monitor.c notices that the bhyve process gone
way and calls virBhyveProcessStop() which runs bhyvectl --destroy
to cleanup the vmm node and calls bhyveNetCleanup() to cleanup
networking.
Roman Bogorodskiy