From nobody Mon Feb 9 11:33:32 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1593449198; cv=none; d=zohomail.com; s=zohoarc; b=dpw1F9h8yC769KzRVTDSzOup5erY/V0hIaYWzL+lpimAmscRvDiDG1nXNkSNmKNmH1J1kETW5Pr+qauF/0OYXIw3FG+S7yeOtmITuFV6oh2XCdsJgOBf6GJYTkwf2j+E9a3J8JAfoGmlhkXXQHGB/0TMVBGJUXqvRK1P1mjiy+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593449198; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FsIVIoOVJboArGXMQrUGGX14JmbZhvk3mjQFE9rsWOk=; b=BKZMcQxjHhumP7LtPRy6ojEKeo1hmggRbu8nKWKmHlTLI4EP1urT2ItrmdJbyYxWCVUNByCx78Dh9cppD3nK9rEzwNL7LlgG4TgCvHfsVGvqh0PHY+DBGpUlCCflkN+L5hnxWeK98rGNuaa9mpQoYl2O2Dniwbq1psup/nTR/4U= 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 1593449198587215.86874751058497; Mon, 29 Jun 2020 09:46:38 -0700 (PDT) Received: from localhost ([::1]:60756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpwvV-00005J-9L for importer@patchew.org; Mon, 29 Jun 2020 12:46:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpwqM-0000OX-HA for qemu-devel@nongnu.org; Mon, 29 Jun 2020 12:41:18 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:44882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jpwqK-0007vg-Dm for qemu-devel@nongnu.org; Mon, 29 Jun 2020 12:41:18 -0400 Received: by mail-lj1-x242.google.com with SMTP id s9so18719331ljm.11 for ; Mon, 29 Jun 2020 09:41:15 -0700 (PDT) Received: from localhost.localdomain (193-239-39-51.ksi-system.net. [193.239.39.51]) by smtp.gmail.com with ESMTPSA id o1sm37641lfi.92.2020.06.29.09.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 09:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FsIVIoOVJboArGXMQrUGGX14JmbZhvk3mjQFE9rsWOk=; b=r7+grCbChISoVGXwV5xZDySFFX1gnUCQ4tnl2knM0XJLcubjNSkBZw4rgjoXUU5+rt UNsxBosKQEoEesqp9+B+M+jIGSoe5S2I7H/OjqeIBqJ6c+HkV6Nk9RwrXQBPpmRHdyL6 EZcM31th+12YWOcsQBblwkqivK1KUsN04BFvFKnyeAVhMNpsCDzfSaflETmq8uUcEjeF KvUGd78eU5cGni4MiCIWrU+839lWXTi5hhYx7wYou50e72vd/LPinjwistjHqVIi6w9q 0AB4Ev3KU+zd+eh6BM5rPRhLaeIuvY0MCR+7QNAKcu16yZFf6cQDKacZ6TmpU0K6++BH RVJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FsIVIoOVJboArGXMQrUGGX14JmbZhvk3mjQFE9rsWOk=; b=W/3EKVXOODkeHmESj0FL3D728OJ3aN4kK11Qm+aRBpUnqxivAh/cFAlqMF6Zg3tuE1 FCP8tRHpV1A6urx+36RxYY+J14/VpJUI6wT9mv8DJoH9V7GpFh//shjMxldl2lTE7teW GJ+CP2riylSJMjfH6TmdddhB56F8sW/zWjR1FqjUnZIaR6ydAwKdw8SUmyocnUEn59gl jYZ12r127YgXvu+R4PRE2v4Rep81GpMTDABFNHpuYHRVocezbEVGAoNtk4VOvSTauwra eiHEWkjUFpEEZiK3DtSAHPIFo8Sen3wHRh401Xl4f3rs3SdEQyKVVXNPCly1fbO58nWN Xm5w== X-Gm-Message-State: AOAM531DYPyNeRrNvXwmWXrdqbQWdRJ25ngkruFzD178Og9kGVTeHquP yl8UN2sGNqhZ9lrKTHD2rUm65jn//Q0qzQ== X-Google-Smtp-Source: ABdhPJyhne7wnwo28CncTAlxYxanOV771jDjbADy+HL1Zc/P92n3nTa+0n8AZuKt3hxTarGX+wKsHw== X-Received: by 2002:a2e:81d5:: with SMTP id s21mr1201533ljg.362.1593448874624; Mon, 29 Jun 2020 09:41:14 -0700 (PDT) From: Szymon Lukasz To: qemu-devel@nongnu.org Subject: [PATCH v3 7/9] qmp: add chardev-resize command Date: Mon, 29 Jun 2020 18:40:39 +0200 Message-Id: <20200629164041.472528-8-noh4hss@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629164041.472528-1-noh4hss@gmail.com> References: <20200629164041.472528-1-noh4hss@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::242; envelope-from=noh4hss@gmail.com; helo=mail-lj1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: , Cc: lvivier@redhat.com, berrange@redhat.com, amit@kernel.org, mst@redhat.com, Szymon Lukasz , marcandre.lureau@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The managment software can use this command to notify QEMU about the size of the terminal connected to a chardev, QEMU can then forward this information to the guest if the chardev is connected to a virtio console device. Signed-off-by: Szymon Lukasz Suggested-by: Daniel P. Berrang=C3=A9 --- chardev/char.c | 14 ++++++++++++++ qapi/char.json | 25 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/chardev/char.c b/chardev/char.c index 1dc22aca95..c1bdfc8b5f 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -1182,6 +1182,20 @@ void qmp_chardev_send_break(const char *id, Error **= errp) qemu_chr_be_event(chr, CHR_EVENT_BREAK); } =20 +void qmp_chardev_resize(const char *id, uint16_t cols, uint16_t rows, + Error **errp) +{ + Chardev *chr; + + chr =3D qemu_chr_find(id); + if (chr =3D=3D NULL) { + error_setg(errp, "Chardev '%s' not found", id); + return; + } + + qemu_chr_resize(chr, cols, rows); +} + /* * Add a timeout callback for the chardev (in milliseconds), return * the GSource object created. Please use this to add timeout hook for diff --git a/qapi/char.json b/qapi/char.json index daceb20f84..dc2d6cab22 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -573,3 +573,28 @@ { 'event': 'VSERPORT_CHANGE', 'data': { 'id': 'str', 'open': 'bool' } } + +## +# @chardev-resize: +# +# Notifies a chardev about the current size of the terminal connected +# to this chardev. +# +# @id: the chardev's ID, must exist +# @cols: the number of columns +# @rows: the number of rows +# +# Returns: Nothing on success +# +# Since: 5.1 +# +# Example: +# +# -> { "execute": "chardev-resize", "arguments": { "id": "foo", "cols": 80= , "rows": 24 } } +# <- { "return": {} } +# +## +{ 'command': 'chardev-resize', + 'data': { 'id': 'str', + 'cols': 'uint16', + 'rows': 'uint16' } } --=20 2.27.0