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: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
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;