On 09/13/2017 02:33 AM, ZhiPeng Lu wrote:
The patch passes the reconnect timeout to QEMU by monitor on chardev
hotplug.
Signed-off-by: ZhiPeng Lu <lu.zhipeng(a)zte.com.cn>
---
v1->v2:
- Fix syntax errors about Curly brackets
---
src/qemu/qemu_monitor_json.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index df5fb7c..290a037 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6444,6 +6444,17 @@ int qemuMonitorJSONGetTPMTypes(qemuMonitorPtr mon,
return qemuMonitorJSONGetStringArray(mon, "query-tpm-types", tpmtypes);
}
+static int
+qemuMonitorJSONBuildChrChardevReconnect(virJSONValuePtr object,
+ const virDomainChrSourceReconnectDef *def)
+{
+ int ret = 0;
+
+ if (def->enabled == VIR_TRISTATE_BOOL_YES)
+ ret = virJSONValueObjectAppendNumberUint(object, "reconnect",
def->timeout);
+ return ret;
+}
Or even better, without the @ret variable:
if (!enabled)
return 0;
return virJSONValueAppend()
ACKed and pushed.
Michal