提交 de3fe191 编写于 作者: R Roman Bogorodskiy

bhyve: fix crash on missing interface model

The bhyve driver crashes in bhyveBuildNetArgStr() when
network interface model is not defined. As it has to be provided
explicitly, add a check to report an error if it's missing.
Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 1b6ff36c
......@@ -56,6 +56,12 @@ bhyveBuildNetArgStr(virConnectPtr conn,
int ret = -1;
virDomainNetType actualType = virDomainNetGetActualType(net);
if (net->model == NULL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("NIC model must be specified"));
return -1;
}
if (STREQ(net->model, "virtio")) {
if (VIR_STRDUP(nic_model, "virtio-net") < 0)
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册