1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-16 03:24:31 +03:00

bhyve: silent destroy command errors on cleanup

When virBhyveProcessStart() fails, it tries to unload
a guest that could have been already loaded using
bhyveload(8) to make sure not to leave it hanging in memory.

However, we could fail before loading a VM into memory,
so 'bhyvectl --destroy' command will fail and print
an error message that looks confusing to users.

So ignore errors when running this in cleanup.
This commit is contained in:
Roman Bogorodskiy 2014-06-13 22:51:18 +04:00
parent 5c1f82efae
commit f477f555f0

View File

@ -189,12 +189,13 @@ virBhyveProcessStart(virConnectPtr conn,
cleanup:
if (ret < 0) {
int exitstatus; /* Needed to avoid logging non-zero status */
virCommandPtr destroy_cmd;
if ((destroy_cmd = virBhyveProcessBuildDestroyCmd(driver,
vm->def)) != NULL) {
virCommandSetOutputFD(load_cmd, &logfd);
virCommandSetErrorFD(load_cmd, &logfd);
ignore_value(virCommandRun(destroy_cmd, NULL));
ignore_value(virCommandRun(destroy_cmd, &exitstatus));
virCommandFree(destroy_cmd);
}