[{"id":3673586,"web_url":"http://patchwork.ozlabs.org/comment/3673586/","msgid":"<20260405200648.1f7c6a3d@tpx1>","list_archive_url":null,"date":"2026-04-05T18:06:50","subject":"Re: [PATCH 5/5] tests/functional: add e2e test for dynamic QMP\n monitor hotplug","submitter":{"id":92808,"url":"http://patchwork.ozlabs.org/api/people/92808/","name":"Thomas Huth","email":"th.huth+qemu@posteo.eu"},"content":"Hi Christian!\n\nAm Thu, 02 Apr 2026 23:19:20 +0200\nschrieb Christian Brauner <brauner@kernel.org>:\n\n> Add a functional test that exercises the full monitor hotplug lifecycle\n> with a real socket connection:\n> \n> 1. Launch QEMU\n> 2. chardev-add a unix socket chardev\n> 3. monitor-add to attach a QMP monitor to it\n> 4. Connect to the socket, receive the QMP greeting, negotiate\n>    capabilities, and send a query-version command\n> 5. Disconnect, monitor-remove, chardev-remove\n> 6. Repeat the entire cycle a second time to verify cleanup and reuse\n> \n> This complements the qtest unit tests by verifying that a real QMP\n> client can connect to a dynamically-added monitor and exchange messages.\n> \n> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>\n> ---\n...\n> diff --git a/tests/functional/generic/test_monitor_hotplug.py b/tests/functional/generic/test_monitor_hotplug.py\n> new file mode 100644\n> index 0000000000..f8f24320c6\n> --- /dev/null\n> +++ b/tests/functional/generic/test_monitor_hotplug.py\n> @@ -0,0 +1,102 @@\n> +#!/usr/bin/env python3\n> +#\n> +# Functional test for dynamic QMP monitor hotplug\n> +#\n> +# Copyright (c) 2026 Christian Brauner\n> +#\n> +# This work is licensed under the terms of the GNU GPL, version 2 or\n> +# later.  See the COPYING file in the top-level directory.\n\nPlease add a SPDX license identifier for new files - otherwise\nscripts/checkpatch.pl will complain.\n\n(and bonus points for fixing all warnings from pylint ;-))\n\n> +import os\n> +import tempfile\n> +\n> +from qemu.qmp.legacy import QEMUMonitorProtocol\n> +\n> +from qemu_test import QemuSystemTest\n> +\n> +\n> +class MonitorHotplug(QemuSystemTest):\n> +\n> +    def setUp(self):\n> +        super().setUp()\n> +        # Use /tmp to avoid UNIX socket path length limit (108 bytes).\n> +        # The scratch_file() path is too deep for socket names.\n> +        fd, self._sock_path = tempfile.mkstemp(\n> +            prefix='qemu-mon-', suffix='.sock')\n\nWe've got a socket_dir() function in the test framework to create socket\npaths ... could you use that one instead?\n\nApart from that, patch looks fine to me.\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=posteo.eu header.i=@posteo.eu header.a=rsa-sha256\n header.s=2017 header.b=Yxj2L9e4;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpgRD36Rsz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 04:07:36 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w9Rs9-0007vV-NX; Sun, 05 Apr 2026 14:06:57 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <th.huth+qemu@posteo.eu>)\n id 1w9Rs8-0007vA-7F\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 14:06:56 -0400","from mout01.posteo.de ([185.67.36.65])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <th.huth+qemu@posteo.eu>)\n id 1w9Rs6-0003dJ-5H\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 14:06:55 -0400","from submission (posteo.de [185.67.36.169])\n by mout01.posteo.de (Postfix) with ESMTPS id 5FB1F240029\n for <qemu-devel@nongnu.org>; Sun,  5 Apr 2026 20:06:51 +0200 (CEST)","from customer (localhost [127.0.0.1])\n by submission (posteo.de) with ESMTPSA id 4fpgQK4lHvz9rxF;\n Sun,  5 Apr 2026 20:06:49 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.eu; s=2017;\n t=1775412411; bh=jmhmse9x3N7NO6eCDFxe+fhPthnWKL1/n/S2Iarfx4Y=;\n h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:\n Content-Transfer-Encoding:From;\n b=Yxj2L9e48eZ1JQnrI+uMmmXd/85O1Wp/KvULILq3eEszew3SUsDccZ0HVAR40PY90\n ab2y6iII2OVO492gRfN6S5owts+df2iBiEbsFzglViuO5eS5+KWTOhpW5+RWrlC6HV\n JY8itOnMFWU0RkUsPMq8ZOxqtSvn/zeSQNDyBKf7YVGjZ4jMq5D08vtL2foTfDvYUi\n UM4s6Or8mn0CI8WgHslM7m8aalPcyuEdrGfFmxfYtrY7TDrZpChy15ij3MA3uC3+rB\n vT9/imZFAbLdQxvzOecnG6l8hPgjBKoia5StzCOyH0sPNJe39J6rf3XJZ1LYRmjatX\n u/iECSYJpBGKg==","Date":"Sun, 05 Apr 2026 18:06:50 +0000","From":"Thomas Huth <th.huth+qemu@posteo.eu>","To":"Christian Brauner <brauner@kernel.org>","Cc":"qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,\n Eric Blake <eblake@redhat.com>, Fabiano Rosas <farosas@suse.de>,\n Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,\n Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= <philmd@linaro.org>, \"Daniel P.\n\t=?utf-8?b?QmVycmFuZ8Op?= \" <berrange@redhat.com>","Subject":"Re: [PATCH 5/5] tests/functional: add e2e test for dynamic QMP\n monitor hotplug","Message-ID":"<20260405200648.1f7c6a3d@tpx1>","In-Reply-To":"<20260402-work-qmp-monitor-hotplug-v1-5-6313a5cdd574@kernel.org>","References":"<20260402-work-qmp-monitor-hotplug-v1-0-6313a5cdd574@kernel.org>\n <20260402-work-qmp-monitor-hotplug-v1-5-6313a5cdd574@kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","Received-SPF":"pass client-ip=185.67.36.65;\n envelope-from=th.huth+qemu@posteo.eu;\n helo=mout01.posteo.de","X-Spam_score_int":"-43","X-Spam_score":"-4.4","X-Spam_bar":"----","X-Spam_report":"(-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]