From nobody Wed Nov 19 04:33:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614683192; cv=none; d=zohomail.com; s=zohoarc; b=Wyslw1vRZ9VaubmS7Wb+ERrLbLhzVk6i+kkKdpV2MwJR2rl5mIfdkBZrvmZ+z4x2qgjkwe0Bk3w8Twm5Q06SQDz3DZejd9truxwraC/R+NNy4ku9te5ifU+wWCuoOOXar82VqApny6hx5nVzvMJCzNGiRNRWDUa++i842PsQAEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614683192; h=Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=lgar7T90j+C8NcbPuVdSy1Hed0C7L3TuhND2OoyhQUs=; b=iqRrTDhMq5szoowm3FV8R9Ys1hi66EpVBq9iSgYgzg7dF9w1oRIIdjnJvxrFVOsDYiVNiGo4hXKkOO2eQtgrnvJ11KfUrSOzh4Zaorh1VbEzmJ3XEeppPr6J7wyU3wakzoT5It0okc/lL0PS570A9ZbdhiE1GG1c7jqN146CQ0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614683192437611.3597087642729; Tue, 2 Mar 2021 03:06:32 -0800 (PST) Received: from localhost ([::1]:51102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lH2rG-0003i0-1E for importer@patchew.org; Tue, 02 Mar 2021 06:06:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH2pe-0002gF-6l for qemu-devel@nongnu.org; Tue, 02 Mar 2021 06:04:50 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:44405) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lH2pc-0006N7-1l for qemu-devel@nongnu.org; Tue, 02 Mar 2021 06:04:49 -0500 Received: by mail-ej1-x631.google.com with SMTP id w1so34454338ejf.11 for ; Tue, 02 Mar 2021 03:04:47 -0800 (PST) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v13sm19713588ede.5.2021.03.02.03.04.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 03:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=lgar7T90j+C8NcbPuVdSy1Hed0C7L3TuhND2OoyhQUs=; b=Rt8uu/0kDKmxZgau0FqPozPkjP5YVRYiPp3iqPSny7EzfMfHAWDL4m3WzfHtrRMYRX 99jL03yj6k4d5HDIbHMsQwbJtvOtKBtLyPueFEFkwDoydULjjKy+gO1+/A0B8ex3fcZA d79bviihGDfTkckerGAU6sPqaPPqfB7MdcbCdltKmoIR6nueQgrSayjyvHZetFmVOgob JSeFBOW9nix1ScGUBUW/ZZkcXjs3EUvmnbnGfvklXK8goErHKpd3tkvHVYV//cBGtekQ YqG7ZdsWRDFiugCKkbSToFVvX/y85HJn7956XE9exmAfU7gGWGYGsVH9LihhgMIDVAtJ 0dcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=lgar7T90j+C8NcbPuVdSy1Hed0C7L3TuhND2OoyhQUs=; b=cAjd46ysaguMxToE2DdYbuzO7DtHajJEUKLHfcWOz6avgGSROQ+7tzg0K3EJaHNdZD PzOUoIS4SSU2gDY7nh/DclvzTlHOPGf7SRlfspEl5UjjFiqmYpvmAUBTiPG50PxGbY8A N2fgUnK4blqw/KXQix4KG2Lizcp9V921uEKLJq1Y54W4g1wW81N0s59yw+X62UkPN7XY oliqbxiXfZFZ+8oa3VMigE91eh1jIGuxU0KvwGBs3u1R+xYPwvass8PzOmPVWEpiUQpQ 6OuMwtml7zvJm+O6QzeiLAU5GWFtdycRUXac9ClxShYYMDCr+KyvkGMxpZGx1BA/lvg1 UL4Q== X-Gm-Message-State: AOAM5338KFru1eOvq0YVqQPBMm9TbUOY4MEOtkjKkCvrb67zqqia18PW INxZPhLhlhVR+jnocRW9s9A+ev5YQ+g= X-Google-Smtp-Source: ABdhPJxUNl0h+MWu4Qk6jWaY4Jl8iBaayfxGDn3YrxvcPqj9t+ns9rBhToy73k0n+kURd4w87LZd3g== X-Received: by 2002:a17:906:1447:: with SMTP id q7mr21028672ejc.27.1614683085844; Tue, 02 Mar 2021 03:04:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] chardev: add nodelay option Date: Tue, 2 Mar 2021 12:04:44 +0100 Message-Id: <20210302110444.39084-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The "delay" option was introduced as a way to enable Nagle's algorithm with ",nodelay". Since the short form for boolean options has now been deprecated, introduce a more properly named "nodelay" option. The "delay" option remains as an undocumented option. Signed-off-by: Paolo Bonzini --- chardev/char-socket.c | 9 +++++++-- gdbstub.c | 2 +- qemu-options.hx | 14 +++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 06a37c0cc8..73a7afe5a0 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1472,8 +1472,13 @@ static void qemu_chr_parse_socket(QemuOpts *opts, Ch= ardevBackend *backend, sock =3D backend->u.socket.data =3D g_new0(ChardevSocket, 1); qemu_chr_parse_common(opts, qapi_ChardevSocket_base(sock)); =20 - sock->has_nodelay =3D qemu_opt_get(opts, "delay"); - sock->nodelay =3D !qemu_opt_get_bool(opts, "delay", true); + sock->has_nodelay =3D + qemu_opt_get(opts, "delay") || + qemu_opt_get(opts, "nodelay"); + sock->nodelay =3D + !qemu_opt_get_bool(opts, "delay", true) || + qemu_opt_get_bool(opts, "nodelay", false); + /* * We have different default to QMP for 'server', hence * we can't just check for existence of 'server' diff --git a/gdbstub.c b/gdbstub.c index 3ee40479b6..16d7c8f534 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -3505,7 +3505,7 @@ int gdbserver_start(const char *device) if (strstart(device, "tcp:", NULL)) { /* enforce required TCP attributes */ snprintf(gdbstub_device_name, sizeof(gdbstub_device_name), - "%s,wait=3Doff,delay=3Doff,server=3Don", device); + "%s,wait=3Doff,nodelay=3Don,server=3Don", device); device =3D gdbstub_device_name; } #ifndef _WIN32 diff --git a/qemu-options.hx b/qemu-options.hx index 252db9357c..90801286c6 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3033,7 +3033,7 @@ DEFHEADING(Character device options:) DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, "-chardev help\n" "-chardev null,id=3Did[,mux=3Don|off][,logfile=3DPATH][,logappend=3Don= |off]\n" - "-chardev socket,id=3Did[,host=3Dhost],port=3Dport[,to=3Dto][,ipv4=3Do= n|off][,ipv6=3Don|off][,delay=3Don|off][,reconnect=3Dseconds]\n" + "-chardev socket,id=3Did[,host=3Dhost],port=3Dport[,to=3Dto][,ipv4=3Do= n|off][,ipv6=3Don|off][,nodelay=3Don|off][,reconnect=3Dseconds]\n" " [,server=3Don|off][,wait=3Don|off][,telnet=3Don|off][,websoc= ket=3Don|off][,reconnect=3Dseconds][,mux=3Don|off]\n" " [,logfile=3DPATH][,logappend=3Don|off][,tls-creds=3DID][,tls= -authz=3DID] (tcp)\n" "-chardev socket,id=3Did,path=3Dpath[,server=3Don|off][,wait=3Don|off]= [,telnet=3Don|off][,websocket=3Don|off][,reconnect=3Dseconds]\n" @@ -3184,7 +3184,7 @@ The available backends are: =20 TCP and unix socket options are given below: =20 - ``TCP options: port=3Dport[,host=3Dhost][,to=3Dto][,ipv4=3Don|off][,ip= v6=3Don|off][,delay=3Don|off]`` + ``TCP options: port=3Dport[,host=3Dhost][,to=3Dto][,ipv4=3Don|off][,ip= v6=3Don|off][,nodelay=3Don|off]`` ``host`` for a listening socket specifies the local address to be bound. For a connecting socket species the remote host to connect to. ``host`` is optional for listening sockets. If not @@ -3204,7 +3204,7 @@ The available backends are: or IPv6 must be used. If neither is specified the socket may use either protocol. =20 - ``delay=3Don|off`` disables the Nagle algorithm. + ``nodelay=3Don|off`` disables the Nagle algorithm. =20 ``unix options: path=3Dpath[,abstract=3Don|off][,tight=3Don|off]`` ``path`` specifies the local path of the unix socket. ``path`` @@ -3593,13 +3593,13 @@ SRST ``telnet options:`` localhost 5555 =20 - ``tcp:[host]:port[,server=3Don|off][,wait=3Don|off][,delay=3Don|off][,= reconnect=3Dseconds]`` + ``tcp:[host]:port[,server=3Don|off][,wait=3Don|off][,nodelay=3Don|off]= [,reconnect=3Dseconds]`` The TCP Net Console has two modes of operation. It can send the serial I/O to a location or wait for a connection from a location. By default the TCP Net Console is sent to host at the port. If you use the ``server=3Don`` option QEMU will wait for a c= lient socket application to connect to the port before continuing, - unless the ``wait=3Don|off`` option was specified. The ``delay=3Do= n|off`` + unless the ``wait=3Don|off`` option was specified. The ``nodelay= =3Don|off`` option disables the Nagle buffering algorithm. The ``reconnect=3Do= n`` option only applies if ``server=3Dno`` is set, if the connection g= oes down it will attempt to reconnect at the given interval. If host @@ -3616,7 +3616,7 @@ SRST ``Example to not wait and listen on ip 192.168.0.100 port 4444`` -serial tcp:192.168.0.100:4444,server=3Don,wait=3Doff =20 - ``telnet:host:port[,server=3Don|off][,wait=3Don|off][,delay=3Don|off]`` + ``telnet:host:port[,server=3Don|off][,wait=3Don|off][,nodelay=3Don|off= ]`` The telnet protocol is used instead of raw tcp sockets. The options work the same as if you had specified ``-serial tcp``. The difference is that the port acts like a telnet server or @@ -3626,7 +3626,7 @@ SRST you do it with Control-] and then type "send break" followed by pressing the enter key. =20 - ``websocket:host:port,server=3Don[,wait=3Don|off][,delay=3Don|off]`` + ``websocket:host:port,server=3Don[,wait=3Don|off][,nodelay=3Don|off]`` The WebSocket protocol is used instead of raw tcp socket. The port acts as a WebSocket server. Client mode is not supported. =20 --=20 2.29.2