[PATCH v3 06/14] parallels: fill adapter model in virDomainNetDef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We handle this parameter for VMs while defining
domains, so let's get this property from PCS and
set corresponding field of virDomainNetDef in
prlsdkLoadDomains function.

Signed-off-by: Dmitry Guryanov <dguryanov@xxxxxxxxxxxxx>
---
 src/parallels/parallels_sdk.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 888a3eb..50b8a72 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -754,6 +754,31 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt)
 
     }
 
+    if (!isCt) {
+        PRL_VM_NET_ADAPTER_TYPE type;
+        pret = PrlVmDevNet_GetAdapterType(netAdapter, &type);
+        prlsdkCheckRetGoto(pret, cleanup);
+
+        switch (type) {
+        case PNT_RTL:
+            if (VIR_STRDUP(net->model, "rtl8139") < 0)
+                goto cleanup;
+            break;
+        case PNT_E1000:
+            if (VIR_STRDUP(net->model, "e1000") < 0)
+                goto cleanup;
+            break;
+        case PNT_VIRTIO:
+            if (VIR_STRDUP(net->model, "virtio") < 0)
+                goto cleanup;
+            break;
+        default:
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("Unknown adapter type: %X"), type);
+            goto cleanup;
+        }
+    }
+
     pret = PrlVmDev_IsConnected(netAdapter, &isConnected);
     prlsdkCheckRetGoto(pret, cleanup);
 
-- 
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]