[PATCH v2 2/3] qemuMonitorJSONBuildChrChardevReconnect: Unify with qemuBuildChrChardevReconnectStr

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

 



When formatting the commandline we explicitly set the reconnect timeout
to 0 when it's disabled even when that's the default. Do the same in
the monitor/hotplug code.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_json.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 0c66086598..508d56994c 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6602,10 +6602,22 @@ static int
 qemuMonitorJSONBuildChrChardevReconnect(virJSONValue *object,
                                         const virDomainChrSourceReconnectDef *def)
 {
-    if (def->enabled != VIR_TRISTATE_BOOL_YES)
+    int timeout = 0;
+
+    switch (def->enabled) {
+    case VIR_TRISTATE_BOOL_ABSENT:
+    case VIR_TRISTATE_BOOL_LAST:
         return 0;

-    return virJSONValueObjectAppendNumberUint(object, "reconnect", def->timeout);
+    case VIR_TRISTATE_BOOL_YES:
+        timeout = def->timeout;
+        break;
+
+    case VIR_TRISTATE_BOOL_NO:
+        break;
+    }
+
+    return virJSONValueObjectAppendNumberUint(object, "reconnect", timeout);
 }

 static virJSONValue *
-- 
2.31.1




[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]

  Powered by Linux