From nobody Sat Sep 26 20:02:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1790112781; cv=none; d=zohomail.com; s=zohoarc; b=ij/MK/UcX1vjkpafsEpQ088NMing+BVbQEIEV0srMq0x0psJNFfxvHfaozRV1CkJPcg4whloRHOu8L3wwqzBFz9bNt77P6saC25t6NH6NjJH0mEOBIAStoWJPrqBjBypFc7qPwt9KIgfBwJdbURbToyO26hd76w/2hTfOJy3qYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790112781; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=II1Z7xFY5rJ5D1CK5n17cgARPGsk9nv8xiYai0wsNbs=; b=cIDI1QzUWB7LYikniSQ11eMPnL6gPwo/3cB616gyTe8MYyYKqhlb6asw0xl2aLcmL/BO0h1T6lFvo4M99RETMmFPROadbBa1NDLCZ8Wg1TMqt1eG3+FKdaJvRpxFydMT2m0nskep/AoWjKxKxo8GyUz2gNuvVIkddol8xKnamtI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790112779953854.535535255671; Tue, 22 Sep 2026 14:32:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x986E-0004xL-QV; Tue, 22 Sep 2026 17:32:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x986B-0004te-4A; Tue, 22 Sep 2026 17:32:23 -0400 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9866-0007EY-7V; Tue, 22 Sep 2026 17:32:22 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c23:1224:0:640:741a:0]) by forwardcorp1b.mail.yandex.net (postfix) with ESMTPS id 2EA2580901; Wed, 23 Sep 2026 00:32:14 +0300 (MSK) Received: from i115954770.yandex-team.ru (unknown [2a02:6bf:8080:126::1:23]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp) with ESMTPSA id BWjvhxGXtiE0-bCFFxAMw; Wed, 23 Sep 2026 00:32:13 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1790112733; bh=II1Z7xFY5rJ5D1CK5n17cgARPGsk9nv8xiYai0wsNbs=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=lEt/7pfnuL9ScfGm1GYKxxQdx/jL+Sc24lkdklNgBk2YXqzemjgxxxVnYb8yJGo// 3qoxhOuD8q8HVAm+BQKHSET1TSGI3AsZI0zo82C8PTSgs1Pu9MewGHGuV8f6XOEH9S cCAr3mrxwU5lElWvEZgDcKMqC95Rvxo/JZ3wcyQw= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: mst@redhat.com Cc: eblake@redhat.com, armbru@redhat.com, th.huth+qemu@posteo.eu, philmd@oss.qualcomm.com, berrange@redhat.com, pbonzini@redhat.com, zhao1.liu@intel.com, qemu-devel@nongnu.org, vsementsov@yandex-team.ru, qemu-stable@nongnu.org Subject: [PATCH 1/3] tests/funtional: add test_virtio_status.py Date: Wed, 23 Sep 2026 00:32:08 +0300 Message-ID: <20260922213210.1429435-2-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260922213210.1429435-1-vsementsov@yandex-team.ru> References: <20260922213210.1429435-1-vsementsov@yandex-team.ru> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net 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, SPF_HELO_NONE=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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1790112785826158500 Content-Type: text/plain; charset="utf-8" Add test that run x-query-virtio-status QMP command, and its HMP analog. Now QEMU crashes in these scenarios due to bugs, so the test-cases are skipped. You may run them by setting QEMU_FAILING_TESTS environment variable. Following commits will fix bug and enable the test-cases. Wrap QEMU run by "unshare" to access vhost-net without sudo. Signed-off-by: Vladimir Sementsov-Ogievskiy --- MAINTAINERS | 1 + tests/functional/qemu_test/testcase.py | 9 +- tests/functional/x86_64/meson.build | 2 + tests/functional/x86_64/test_virtio_status.py | 97 +++++++++++++++++++ 4 files changed, 105 insertions(+), 4 deletions(-) create mode 100755 tests/functional/x86_64/test_virtio_status.py diff --git a/MAINTAINERS b/MAINTAINERS index 6be9c5725b9..8bd7c8472d9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2535,6 +2535,7 @@ F: include/hw/virtio/ F: docs/devel/virtio* F: docs/devel/migration/virtio.rst F: tests/functional/x86_64/test_virtio_version.py +F: tests/functional/x86_64/test_virtio_status.py =20 virtio-balloon M: Michael S. Tsirkin diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu= _test/testcase.py index bf2dc1dc101..d719b79eb1e 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -387,12 +387,13 @@ def require_device(self, devicename): if helptxt.find(devicename) < 0: self.skipTest('no support for device ' + devicename) =20 - def _new_vm(self, name, monitor_address): + def _new_vm(self, name, monitor_address, wrapper): vm =3D QEMUMachine(self.qemu_bin, name=3Dname, base_temp_dir=3Dself.workdir, log_dir=3Dself.log_file(), - monitor_address=3Dmonitor_address) + monitor_address=3Dmonitor_address, + wrapper=3Dwrapper) self.log.debug('QEMUMachine "%s" created', name) self.log.debug('QEMUMachine "%s" temp_dir: %s', name, vm.temp_dir) =20 @@ -407,11 +408,11 @@ def _new_vm(self, name, monitor_address): def vm(self): return self.get_vm(name=3D'default') =20 - def get_vm(self, name=3DNone, monitor_address=3DNone): + def get_vm(self, name=3DNone, monitor_address=3DNone, wrapper=3D()): if not name: name =3D str(uuid.uuid4()) if self._vms.get(name) is None: - self._vms[name] =3D self._new_vm(name, monitor_address) + self._vms[name] =3D self._new_vm(name, monitor_address, wrappe= r) if self.cpu is not None: self._vms[name].add_args('-cpu', self.cpu) if self.machine is not None: diff --git a/tests/functional/x86_64/meson.build b/tests/functional/x86_64/= meson.build index 0353b2af8e1..62dedb2e203 100644 --- a/tests/functional/x86_64/meson.build +++ b/tests/functional/x86_64/meson.build @@ -7,6 +7,7 @@ test_x86_64_timeouts =3D { 'netdev_ethtool' : 180, 'replay' : 480, 'virtio_balloon': 120, + 'virtio_status': 120, } =20 tests_x86_64_system_quick =3D [ @@ -50,5 +51,6 @@ tests_x86_64_system_thorough =3D [ 'vhost_user_bridge', 'virtio_balloon', 'virtio_gpu', + 'virtio_status', 'rebuild_vmfd', ] diff --git a/tests/functional/x86_64/test_virtio_status.py b/tests/function= al/x86_64/test_virtio_status.py new file mode 100755 index 00000000000..c8cbdf7c42e --- /dev/null +++ b/tests/functional/x86_64/test_virtio_status.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: MIT + +import os +import subprocess + +from qemu_test import ( + Asset, + LinuxKernelTest, + skipIfMissingCommands, + skipIfMissingEnv, +) + + +class VirtioStatus(LinuxKernelTest): + ASSET_KERNEL =3D Asset( + "https://dl-cdn.alpinelinux.org/alpine/v3.24/releases/x86_64/" + "netboot-3.24.2/vmlinuz-virt", + "be8ae7782de532d1a791c97fbf9ddc955b9de78349382ad097c83ffe9db857f4") + ASSET_INITRD =3D Asset( + "https://dl-cdn.alpinelinux.org/alpine/v3.24/releases/x86_64/" + "netboot-3.24.2/initramfs-virt", + "385418a99b17c0ef44947d88ea448d43b2df4a2c3343da72e724c6cf3b05e9f7") + + VIRTIO_PATH =3D "/machine/peripheral/net0/virtio-backend" + + def setUp(self): + super().setUp() + self.qemu_wrapper =3D [] + self.require_accelerator("kvm") + self.require_device("virtio-net-pci") + self.set_machine("q35") + + def has_hmp(self, vm): + commands =3D vm.cmd('query-commands') + return any(cmd['name'] =3D=3D 'human-monitor-command' for cmd in c= ommands) + + def check_commands(self, vm): + if self.has_hmp(vm): + vm.cmd( + "human-monitor-command", + command_line=3D"info virtio-status " + self.VIRTIO_PATH, + ) + vm.cmd("x-query-virtio-status", path=3Dself.VIRTIO_PATH) + + @skipIfMissingCommands("unshare") + @skipIfMissingEnv("QEMU_FAILING_TESTS") + def test_vhost(self): + self.require_netdev("tap") + for device in ("/dev/net/tun", "/dev/vhost-net"): + if not os.access(device, os.R_OK | os.W_OK): + self.skipTest(f"Read/write access to {device} is required") + + wrapper =3D ["unshare", "-Urn", "--"] + probe =3D subprocess.run(wrapper + ["true"], + capture_output=3DTrue, + text=3DTrue, check=3DFalse) + if probe.returncode: + self.skipTest("User/network namespaces unavailable: " + + probe.stderr.strip()) + + vm =3D self.get_vm("wrapped", wrapper=3Dwrapper) + + kernel =3D self.ASSET_KERNEL.fetch() + initrd =3D self.ASSET_INITRD.fetch() + + vm.set_console() + vm.add_args("-accel", "kvm") + vm.add_args("-kernel", kernel, + "-initrd", initrd, + "-append", "console=3DttyS0 modules=3Dvirtio_net", + "-netdev", + "tap,id=3Dnet,script=3D,downscript=3D,vhost=3Don", + "-device", + "virtio-net-pci,id=3Dnet0,netdev=3Dnet,romfile=3D") + vm.launch() + + # modules=3Dvirtio_net ensures the driver is loaded by this point + self.wait_for_console_pattern("Loading boot drivers: ok.", vm=3Dvm) + vm.cmd( + "x-query-virtio-vhost-queue-status", path=3Dself.VIRTIO_PATH, = queue=3D0 + ) + + self.check_commands(vm) + + @skipIfMissingEnv("QEMU_FAILING_TESTS") + def test_no_vhost(self): + self.vm.add_args("-accel", "kvm", + "-S", "-net", "none", "-device", + "virtio-net-pci,id=3Dnet0,romfile=3D") + self.vm.launch() + self.check_commands(self.vm) + + +if __name__ =3D=3D "__main__": + LinuxKernelTest.main() --=20 2.43.0 From nobody Sat Sep 26 20:02:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1790112810; cv=none; d=zohomail.com; s=zohoarc; b=OGTax18s+A8R3eFfKMX35AYkcjRJOELynNRjz2eTWxKkadBLSBoaqz5jSivj5XNnnV8IR/QCDi9bccWjfKgwpx4vCwGdr7gYQPOrajXKZB+fW04uq0VBhOQrElJHqFEmTyxGm57Hmlwcl94ZS2t0u2B/SXdaxdk4o7B8cWI9rY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790112810; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tzYE8XD4llxLxWjfhOS1JgAPPaMrLBLyZ19/qcfhhsE=; b=l3SstGeYS//mDsev0LtHPEzClt1VCJGenH0aMVaJmPu32TEShuF3Q7I9jYVCDbDX1WlvifdeaCxU2w1JZw9eULS4KrGc64Ur4magxNVXWf1jXpg5ZhBOU52oSPeHVVnPcuM8xFCAwA7zk401Zujc3MyAcMamQU8ReOSauSPLoX4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790112810219584.2799644600371; Tue, 22 Sep 2026 14:33:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x986A-0004tP-Qm; Tue, 22 Sep 2026 17:32:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9869-0004sl-NJ; Tue, 22 Sep 2026 17:32:21 -0400 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9866-0007Ee-9j; Tue, 22 Sep 2026 17:32:21 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c23:1224:0:640:741a:0]) by forwardcorp1b.mail.yandex.net (postfix) with ESMTPS id C843080908; Wed, 23 Sep 2026 00:32:14 +0300 (MSK) Received: from i115954770.yandex-team.ru (unknown [2a02:6bf:8080:126::1:23]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp) with ESMTPSA id BWjvhxGXtiE0-TCD7XwHe; Wed, 23 Sep 2026 00:32:14 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1790112734; bh=tzYE8XD4llxLxWjfhOS1JgAPPaMrLBLyZ19/qcfhhsE=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=zuxOI05hH3XLR1vtI8hE1ivZXCkJsHdSrb80q2ieDTHZ8L5N4b4Y3+TXJw8CEh+B9 S1AnVz4Q57Cf3y0xlIxuNdzpEhDdzaQnD2aFRgzLbIwBUYayIgO6lI8nPOThivo6fo AywW1z0mCO5EptshRvYFAe4SoJLiAdReq+NKCrpU= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: mst@redhat.com Cc: eblake@redhat.com, armbru@redhat.com, th.huth+qemu@posteo.eu, philmd@oss.qualcomm.com, berrange@redhat.com, pbonzini@redhat.com, zhao1.liu@intel.com, qemu-devel@nongnu.org, vsementsov@yandex-team.ru, qemu-stable@nongnu.org Subject: [PATCH 2/3] qapi/virtio: Restore backend features in x-query-virtio-status Date: Wed, 23 Sep 2026 00:32:09 +0300 Message-ID: <20260922213210.1429435-3-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260922213210.1429435-1-vsementsov@yandex-team.ru> References: <20260922213210.1429435-1-vsementsov@yandex-team.ru> 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=lists1p.gnu.org; Received-SPF: pass client-ip=178.154.239.136; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net 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, SPF_HELO_NONE=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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1790112813448158500 Content-Type: text/plain; charset="utf-8" Commit 1ee0bc0c9bf0 removed vhost_dev.backend_features and its representation in VhostStatus. It also removed the assignment to VirtioStatus.backend_features, although both that field and its source, VirtIODevice.backend_features_ex, still exist. The resulting NULL pointer causes HMP info virtio-status and QMP x-query-virtio-status to crash. This affects virtio devices even without an active vhost backend. Restore the assignment from VirtIODevice.backend_features_ex and enable corresponding test, which becomes fixed. Fixes: 1ee0bc0c9bf0 ("vhost: drop backend_features field") Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/virtio/virtio-qmp.c | 2 ++ tests/functional/x86_64/test_virtio_status.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c index 5aaeebdd96a..8b7cd7a3106 100644 --- a/hw/virtio/virtio-qmp.c +++ b/hw/virtio/virtio-qmp.c @@ -713,6 +713,8 @@ VirtioStatus *qmp_x_query_virtio_status(const char *pat= h, Error **errp) vdev->guest_features_ex); status->host_features =3D qmp_decode_features(vdev->device_id, vdev->host_features_ex); + status->backend_features =3D qmp_decode_features(vdev->device_id, + vdev->backend_features_= ex); =20 switch (vdev->device_endian) { case VIRTIO_DEVICE_ENDIAN_LITTLE: diff --git a/tests/functional/x86_64/test_virtio_status.py b/tests/function= al/x86_64/test_virtio_status.py index c8cbdf7c42e..1e72c713cc6 100755 --- a/tests/functional/x86_64/test_virtio_status.py +++ b/tests/functional/x86_64/test_virtio_status.py @@ -84,7 +84,6 @@ def test_vhost(self): =20 self.check_commands(vm) =20 - @skipIfMissingEnv("QEMU_FAILING_TESTS") def test_no_vhost(self): self.vm.add_args("-accel", "kvm", "-S", "-net", "none", "-device", --=20 2.43.0 From nobody Sat Sep 26 20:02:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1790112799; cv=none; d=zohomail.com; s=zohoarc; b=OHBl5d6jDwJE0zxvLBYqYx7ejQ/z4CKC7zrfamKo0N33NWVsPgXukStP73BW8U+LEGqgSc523vDdEv1TfV8Gwq3V2TAR+hulSYJapUzwntohyI6/7RK7aXDdKIKNVkQukdyW1CiO0sQq51sfYVDvQClrloJlAGYcwbzTe2vXRGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790112799; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FvqVXcBKgWH+uWCBinN65HrAd3xMQ6F5Q3jF9ezgjS0=; b=Q+5sONuhoetyukTiWkTkAYFEZ4itZ9AaOOhyfNSzOjexXcTvZ/JgypP0VO5FYgAhFwPVLzU72cS8xvsW3ZsX9IS4ba3QYuxP9OT4KCw9j812qCHsNfPKZOJc7rjkLQEKx1rwUSUXU5agSLsPZDdy97p1WnLWvbTdzqSoI0OOpY0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790112799017719.105273257739; Tue, 22 Sep 2026 14:33:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x986E-0004wu-Ah; Tue, 22 Sep 2026 17:32:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x986A-0004tQ-MK; Tue, 22 Sep 2026 17:32:22 -0400 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9866-0007Ek-9i; Tue, 22 Sep 2026 17:32:22 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c23:1224:0:640:741a:0]) by forwardcorp1b.mail.yandex.net (postfix) with ESMTPS id 9327780892; Wed, 23 Sep 2026 00:32:15 +0300 (MSK) Received: from i115954770.yandex-team.ru (unknown [2a02:6bf:8080:126::1:23]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp) with ESMTPSA id BWjvhxGXtiE0-ehkC0chY; Wed, 23 Sep 2026 00:32:15 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1790112735; bh=FvqVXcBKgWH+uWCBinN65HrAd3xMQ6F5Q3jF9ezgjS0=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=VW+xt3h+F8UsWtzkpt7FrSFdyG5OrrCp73OI4v+85TWutFK5lqagsmuomf5UNIGvH ClUXGiOQyST2XuQqFUqi29Q0QlU89HJDRwbIWE/yt/Zc8P15g7Tw8W6VTWbgP5hPV1 bq6RpeXgSujXMse6VArTdlFq4pIeIE/PtVQkiidI= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: mst@redhat.com Cc: eblake@redhat.com, armbru@redhat.com, th.huth+qemu@posteo.eu, philmd@oss.qualcomm.com, berrange@redhat.com, pbonzini@redhat.com, zhao1.liu@intel.com, qemu-devel@nongnu.org, vsementsov@yandex-team.ru, qemu-stable@nongnu.org, Nikolay Kuratov Subject: [PATCH 3/3] qapi/monitor: Handle missing vhost-user protocol features Date: Wed, 23 Sep 2026 00:32:10 +0300 Message-ID: <20260922213210.1429435-4-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260922213210.1429435-1-vsementsov@yandex-team.ru> References: <20260922213210.1429435-1-vsementsov@yandex-team.ru> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net 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, SPF_HELO_NONE=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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1790112802415158500 Content-Type: text/plain; charset="utf-8" Commit f9a8f5812607 moved protocol_features to the vhost-user backend. As a result, VhostStatus.protocol_features is only populated for vhost-user devices. For an active kernel vhost device, HMP info virtio-status and QMP x-query-virtio-status crashes now because of unset protocol-features. Make protocol-features optional in VhostStatus and skip dumping a missing object in HMP. For QMP we can change the x-query-virtio-status command semantics because it is unstable. Enable corresponding test, it works now. Fixes: f9a8f5812607 ("vhost: move protocol_features to vhost_user") Co-authored-by: Nikolay Kuratov Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/virtio/virtio-hmp-cmds.c | 6 ++++-- qapi/virtio.json | 5 +++-- tests/functional/x86_64/test_virtio_status.py | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio-hmp-cmds.c b/hw/virtio/virtio-hmp-cmds.c index e5da6f00699..5b08a06ec42 100644 --- a/hw/virtio/virtio-hmp-cmds.c +++ b/hw/virtio/virtio-hmp-cmds.c @@ -176,8 +176,10 @@ void hmp_virtio_status(MonitorHMP *hmp, const QDict *q= dict) hmp_virtio_dump_features(hmp, s->vhost_dev->features); monitor_hmp_printf(hmp, " Acked features:\n"); hmp_virtio_dump_features(hmp, s->vhost_dev->acked_features); - monitor_hmp_printf(hmp, " Protocol features:\n"); - hmp_virtio_dump_protocols(hmp, s->vhost_dev->protocol_features); + if (s->vhost_dev->protocol_features) { + monitor_hmp_printf(hmp, " Protocol features:\n"); + hmp_virtio_dump_protocols(hmp, s->vhost_dev->protocol_features= ); + } } =20 qapi_free_VirtioStatus(s); diff --git a/qapi/virtio.json b/qapi/virtio.json index 1fc4e38a44d..f8e699a0e4e 100644 --- a/qapi/virtio.json +++ b/qapi/virtio.json @@ -85,7 +85,8 @@ # # @acked-features: vhost_dev acked_features # -# @protocol-features: vhost_dev protocol_features +# @protocol-features: vhost-user protocol features. Present only for +# vhost-user devices. # # @max-queues: vhost_dev max_queues # @@ -104,7 +105,7 @@ 'vq-index': 'int', 'features': 'VirtioDeviceFeatures', 'acked-features': 'VirtioDeviceFeatures', - 'protocol-features': 'VhostDeviceProtocols', + '*protocol-features': 'VhostDeviceProtocols', 'max-queues': 'uint64', 'backend-cap': 'uint64', 'log-enabled': 'bool', diff --git a/tests/functional/x86_64/test_virtio_status.py b/tests/function= al/x86_64/test_virtio_status.py index 1e72c713cc6..a88823004f8 100755 --- a/tests/functional/x86_64/test_virtio_status.py +++ b/tests/functional/x86_64/test_virtio_status.py @@ -45,7 +45,6 @@ def check_commands(self, vm): vm.cmd("x-query-virtio-status", path=3Dself.VIRTIO_PATH) =20 @skipIfMissingCommands("unshare") - @skipIfMissingEnv("QEMU_FAILING_TESTS") def test_vhost(self): self.require_netdev("tap") for device in ("/dev/net/tun", "/dev/vhost-net"): --=20 2.43.0