diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 52ad3e3714210f751ab2accbd88e6f67e5df4b6d..10340ee436eb3c28d1e195a9a36d3ca69c0c6925 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -460,7 +460,6 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, * vm0 */ size_t i; - bool add_lpc = false; int nusbcontrollers = 0; unsigned int nvcpus = virDomainDefGetVcpus(def); @@ -553,7 +552,6 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, if ((bhyveDriverGetCaps(conn) & BHYVE_CAP_LPC_BOOTROM)) { virCommandAddArg(cmd, "-l"); virCommandAddArgFormat(cmd, "bootrom,%s", def->os.loader->path); - add_lpc = true; } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Installed bhyve binary does not support " @@ -617,7 +615,6 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, if (bhyveBuildGraphicsArgStr(def, def->graphics[0], def->videos[0], conn, cmd, dryRun) < 0) goto error; - add_lpc = true; } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Multiple graphics devices are not supported")); @@ -625,7 +622,7 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, } } - if (add_lpc || def->nserials) + if (bhyveDomainDefNeedsISAController(def)) bhyveBuildLPCArgStr(def, cmd); if (bhyveBuildConsoleArgStr(def, cmd) < 0) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 79cf103d28368da1551bef42862e2b92d94547d3..67cd6cc0394d614c66efe5d2f09dfd75bd9e59a5 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -61,6 +61,21 @@ virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks = { .free = bhyveDomainObjPrivateFree, }; +bool +bhyveDomainDefNeedsISAController(virDomainDefPtr def) +{ + if (def->os.bootloader == NULL && def->os.loader) + return true; + + if (def->nserials) + return true; + + if (def->ngraphics && def->nvideos) + return true; + + return false; +} + static int bhyveDomainDefPostParse(virDomainDefPtr def, virCapsPtr caps ATTRIBUTE_UNUSED, diff --git a/src/bhyve/bhyve_domain.h b/src/bhyve/bhyve_domain.h index 5f94038e89aae497c8c0fc129127fb12a08bd804..03a2b369d9c34f7e29268544767653457b378029 100644 --- a/src/bhyve/bhyve_domain.h +++ b/src/bhyve/bhyve_domain.h @@ -41,4 +41,6 @@ extern virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks; extern virDomainDefParserConfig virBhyveDriverDomainDefParserConfig; extern virDomainXMLNamespace virBhyveDriverDomainXMLNamespace; +bool bhyveDomainDefNeedsISAController(virDomainDefPtr def); + #endif /* LIBVIRT_BHYVE_DOMAIN_H */