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

[libvirt] [PATCH 1/2] vz: add mode of unix socket serial device to xml dump



Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy virtuozzo com>
---
 src/vz/vz_sdk.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 7eb78ca..d5e0746 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -888,6 +888,7 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr)
     PRL_UINT32 serialPortIndex;
     PRL_UINT32 emulatedType;
     char *friendlyName = NULL;
+    PRL_SERIAL_PORT_SOCKET_OPERATION_MODE socket_mode;
 
     chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
     chr->targetTypeAttr = false;
@@ -902,6 +903,9 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr)
                                                  serialPort)))
         goto error;
 
+    pret = PrlVmDevSerial_GetSocketMode(serialPort, &socket_mode);
+    prlsdkCheckRetGoto(pret, error);
+
     switch (emulatedType) {
     case PDT_USE_OUTPUT_FILE:
         chr->source.type = VIR_DOMAIN_CHR_TYPE_FILE;
@@ -910,6 +914,7 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr)
     case PDT_USE_SERIAL_PORT_SOCKET_MODE:
         chr->source.type = VIR_DOMAIN_CHR_TYPE_UNIX;
         chr->source.data.nix.path = friendlyName;
+        chr->source.data.nix.listen = socket_mode == PSP_SERIAL_SOCKET_SERVER;
         break;
     case PDT_USE_REAL_DEVICE:
         chr->source.type = VIR_DOMAIN_CHR_TYPE_DEV;
-- 
1.8.3.1


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