diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index e1bbd7668af4489fe46a1e514622d449fae0398d..3a56345a9292e301b5e35a602c06966c3b87f946 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -1999,20 +1999,22 @@ xenFormatSxprNet(virConnectPtr conn, 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) diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index d65e97aa9a11870165fe29a754fc676dda0ff10f..93a26f90d136610fe91112c06436a6152c21c678 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -1381,20 +1381,21 @@ static int xenFormatXMNet(virConnectPtr conn, 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)