Since net->model is not defined for containers we shouldn't touch it
Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
src/parallels/parallels_sdk.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/parallels/parallels_sdk.c
b/src/parallels/parallels_sdk.c
index 59ca62e..988bcc6 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -2728,7 +2728,8 @@ static const char *
prlsdkFormatMac(virMacAddrPtr mac, char *macstr)
static int prlsdkAddNet(PRL_HANDLE sdkdom,
parallelsConnPtr privconn,
- virDomainNetDefPtr net)
+ virDomainNetDefPtr net,
+ bool isCt)
{
PRL_RESULT pret;
PRL_HANDLE sdknet = PRL_INVALID_HANDLE;
@@ -2760,19 +2761,21 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
pret = PrlVmDevNet_SetMacAddress(sdknet, macstr);
prlsdkCheckRetGoto(pret, cleanup);
- if (STREQ(net->model, "rtl8139")) {
- pret = PrlVmDevNet_SetAdapterType(sdknet, PNT_RTL);
- } else if (STREQ(net->model, "e1000")) {
- pret = PrlVmDevNet_SetAdapterType(sdknet, PNT_E1000);
- } else if (STREQ(net->model, "virtio")) {
- pret = PrlVmDevNet_SetAdapterType(sdknet, PNT_VIRTIO);
- } else {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ if (!isCt) {
+ if (STREQ(net->model, "rtl8139")) {
+ pret = PrlVmDevNet_SetAdapterType(sdknet, PNT_RTL);
+ } else if (STREQ(net->model, "e1000")) {
+ pret = PrlVmDevNet_SetAdapterType(sdknet, PNT_E1000);
+ } else if (STREQ(net->model, "virtio")) {
+ pret = PrlVmDevNet_SetAdapterType(sdknet, PNT_VIRTIO);
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Specified network adapter model is not "
"supported by Parallels Cloud Server."));
- goto cleanup;
+ goto cleanup;
+ }
+ prlsdkCheckRetGoto(pret, cleanup);
}