From nobody Thu Apr 25 05:18:58 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555347135; cv=none; d=zoho.com; s=zohoarc; b=KNuaQmZTDMRk/pw9Lbe2Jv84iRSNKBJXMmsEg9OoIkvWkAPMkoP7i1pfNeJjX6YKuUSrEWNSH+RSCCEX1KnR8ui3n4CTHzZhHD95MZMXUc5TVdeCxs4RF6ZR/Lp4X/iSwHPcnsKObv2Bls/BSfe/nShYIjtcn3QaHOjtGaTYtRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555347135; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=dgcECmhT6dO//gWV1tCIBzg66er9bU7qBGkEQXqZeQw=; b=jQDuWNZrshAh09Bni0g5GmOwU4rZe1pgJw06Dzjzw7WYFsgm05H+NzE5mBA4xWYJ+786xl0/+EOhuharNjb9X7dNoDehSN621aH6f7yHo9RMIb2LlVxc3Ay6ywX+YWFl+ai2CDGkeZyVYCHNeAgbPgO+NrBSP59hve3VDzQNsRg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1555347135732879.126897392588; Mon, 15 Apr 2019 09:52:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FACB81DEB; Mon, 15 Apr 2019 16:52:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F356C19C77; Mon, 15 Apr 2019 16:52:12 +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 E6CC43FB11; Mon, 15 Apr 2019 16:52:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3FGpsxq014149 for ; Mon, 15 Apr 2019 12:51:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 24DDF608C7; Mon, 15 Apr 2019 16:51:54 +0000 (UTC) Received: from localhost (unknown [10.36.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7766F608C6; Mon, 15 Apr 2019 16:51:49 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 18:51:48 +0200 Message-Id: <20190415165148.16760-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [libvirt] [PATCH] qemu: do not set wait:false for client sockets 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 15 Apr 2019 16:52:14 +0000 (UTC) From: Marc-Andr=C3=A9 Lureau Qemu commit 767abe7 ("chardev: forbid 'wait' option with client sockets") effectively deprecates usage of "wait" with client sockets starting with qemu 4.0, and earlier versions ignored the value. Cc: Daniel P. Berrang=C3=A9 Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor_json.c | 14 ++++++++++---- tests/qemumonitorjsontest.c | 2 -- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 71c452b25b..e7d063a5a8 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6922,8 +6922,11 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrI= D, =20 telnet =3D chr->data.tcp.protocol =3D=3D VIR_DOMAIN_CHR_TCP_PROTOC= OL_TELNET; =20 - if (virJSONValueObjectAppendBoolean(data, "wait", false) < 0 || - virJSONValueObjectAppendBoolean(data, "telnet", telnet) < 0 || + if (chr->data.tcp.listen && + virJSONValueObjectAppendBoolean(data, "wait", false) < 0) + goto cleanup; + + if (virJSONValueObjectAppendBoolean(data, "telnet", telnet) < 0 || virJSONValueObjectAppendBoolean(data, "server", chr->data.tcp.= listen) < 0) goto cleanup; if (chr->data.tcp.tlscreds) { @@ -6973,8 +6976,11 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrI= D, goto cleanup; addr =3D NULL; =20 - if (virJSONValueObjectAppendBoolean(data, "wait", false) < 0 || - virJSONValueObjectAppendBoolean(data, "server", chr->data.nix.= listen) < 0) + if (chr->data.nix.listen && + virJSONValueObjectAppendBoolean(data, "wait", false) < 0) + goto cleanup; + + if (virJSONValueObjectAppendBoolean(data, "server", chr->data.nix.= listen) < 0) goto cleanup; =20 if (qemuMonitorJSONBuildChrChardevReconnect(data, &chr->data.nix.r= econnect) < 0) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 055e201611..f5ad3f6a73 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -874,7 +874,6 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr = xmlopt) "'data':{'addr':{'type':'inet'," "'data':{'host':'example.com'," "'port':'1234'}}," - "'wait':false," "'telnet':false," "'server':false}}}"); =20 @@ -920,7 +919,6 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr = xmlopt) "'backend':{'type':'socket'," "'data':{'addr':{'type':'unix'," "'data':{'path':'/path/to/socket'}}," - "'wait':false," "'server':false}}}"); =20 chr =3D (virDomainChrSourceDef) { .type =3D VIR_DOMAIN_CHR_TYPE_SPICEV= MC }; --=20 2.21.0.313.ge35b8cb8e2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list