if (def->model != NULL)
virBufferEscapeSexpr(buf, "(model '%s')", def->model);
}
- else if (def->model == NULL) {
- /*
- * apparently (type ioemu) breaks paravirt drivers on HVM so skip
- * this from XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
- */
- if (xendConfigVersion <= XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU)
- virBufferAddLit(buf, "(type ioemu)");
- }
- else if (STREQ(def->model, "netfront")) {
- virBufferAddLit(buf, "(type netfront)");
- }
else {
- virBufferEscapeSexpr(buf, "(model '%s')", def->model);
- virBufferAddLit(buf, "(type ioemu)");
+ if (def->model != NULL && STREQ(def->model, "netfront")) {
+ virBufferAddLit(buf, "(type netfront)");
+ }
+ else {
+ if (def->model != NULL) {
+ virBufferEscapeSexpr(buf, "(model '%s')", def->model);
+ }
+ /*
+ * apparently (type ioemu) breaks paravirt drivers on HVM so skip
+ * this from XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
+ */
+ if (xendConfigVersion <= XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU) {
+ virBufferAddLit(buf, "(type ioemu)");
+ }
+ }
}
if (!isAttach)
if (net->model != NULL)
virBufferAsprintf(&buf, ",model=%s", net->model);
}
- else if (net->model == NULL) {
- /*
- * apparently type ioemu breaks paravirt drivers on HVM so skip this
- * from XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
- */
- if (xendConfigVersion <= XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU)
- virBufferAddLit(&buf, ",type=ioemu");
- }
- else if (STREQ(net->model, "netfront")) {
- virBufferAddLit(&buf, ",type=netfront");
- }
else {
- virBufferAsprintf(&buf, ",model=%s", net->model);
- virBufferAddLit(&buf, ",type=ioemu");
+ if (net->model != NULL && STREQ(net->model, "netfront")) {
+ virBufferAddLit(&buf, ",type=netfront");
+ }
+ else {
+ if (net->model != NULL)
+ virBufferAsprintf(&buf, ",model=%s", net->model);
+
+ /*
+ * apparently type ioemu breaks paravirt drivers on HVM so skip this
+ * from XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
+ */
+ if (xendConfigVersion <= XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU)
+ virBufferAddLit(&buf, ",type=ioemu");
+ }
}
if (net->ifname)