From nobody Sun Apr 28 00:59:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1505182817073913.4900488076529; Mon, 11 Sep 2017 19:20:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 59643285A0; Tue, 12 Sep 2017 02:20:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39B786BC13; Tue, 12 Sep 2017 02:20:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F3207180610F; Tue, 12 Sep 2017 02:20:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8C27fN7013722 for ; Mon, 11 Sep 2017 22:07:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 113CE6E8C9; Tue, 12 Sep 2017 02:07:41 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BF976E8C0 for ; Tue, 12 Sep 2017 02:07:39 +0000 (UTC) Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.217.80.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7911C0587C2 for ; Tue, 12 Sep 2017 02:07:36 +0000 (UTC) Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 9DDFC8266711F25A2C94 for ; Tue, 12 Sep 2017 10:07:34 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v8C27Lwx077556 for ; Tue, 12 Sep 2017 10:07:21 +0800 (GMT-8) (envelope-from lu.zhipeng@zte.com.cn) Received: from ceshi.localdomain ([10.74.120.130]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017091210072344-2210297 ; Tue, 12 Sep 2017 10:07:23 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 59643285A0 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 59643285A0 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D7911C0587C2 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lu.zhipeng@zte.com.cn DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D7911C0587C2 From: ZhiPeng Lu To: libvir-list@redhat.com Date: Tue, 12 Sep 2017 10:06:10 +0800 Message-Id: <1505181970-11467-1-git-send-email-lu.zhipeng@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-09-12 10:07:23, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2017-09-12 10:07:17, Serialize complete at 2017-09-12 10:07:17 X-MAIL: mse01.zte.com.cn v8C27Lwx077556 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 205 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 12 Sep 2017 02:07:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 12 Sep 2017 02:07:37 +0000 (UTC) for IP:'63.217.80.70' DOMAIN:'mxhk.zte.com.cn' HELO:'mxhk.zte.com.cn' FROM:'lu.zhipeng@zte.com.cn' RCPT:'' X-RedHat-Spam-Score: -2.302 (RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SPF_PASS) 63.217.80.70 mxhk.zte.com.cn 63.217.80.70 mxhk.zte.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: ZhiPeng Lu Subject: [libvirt] [PATCH] qemu: handle reconnect on chardev hotplug X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 12 Sep 2017 02:20:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The patch passes the reconnect timeout to QEMU by monitor on chardev hotplu= g. Signed-off-by: ZhiPeng Lu --- src/qemu/qemu_monitor_json.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index df5fb7c..4169cd5 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); } =20 +static int +qemuMonitorJSONBuildChrChardevReconnect(virJSONValuePtr object, + const virDomainChrSourceReconnectD= ef *def) +{ + int ret =3D 0; + if (def->enabled =3D=3D VIR_TRISTATE_BOOL_YES) { + ret =3D virJSONValueObjectAppendNumberUint(object, "reconnect", de= f->timeout); + } + return ret; +} + static virJSONValuePtr qemuMonitorJSONAttachCharDevCommand(const char *chrID, const virDomainChrSourceDef *chr) @@ -6508,6 +6519,10 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrI= D, if (virJSONValueObjectAppendString(data, "tls-creds", tlsalias= ) < 0) goto cleanup; } + + if (qemuMonitorJSONBuildChrChardevReconnect(data, &chr->data.tcp.r= econnect) < 0) { + goto cleanup; + } break; =20 case VIR_DOMAIN_CHR_TYPE_UDP: @@ -6545,6 +6560,10 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrI= D, if (virJSONValueObjectAppendBoolean(data, "wait", false) < 0 || virJSONValueObjectAppendBoolean(data, "server", chr->data.nix.= listen) < 0) goto cleanup; + + if (qemuMonitorJSONBuildChrChardevReconnect(data, &chr->data.nix.r= econnect) < 0) { + goto cleanup; + } break; =20 case VIR_DOMAIN_CHR_TYPE_SPICEVMC: --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list