From nobody Fri Dec 19 20:44:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1744268464; cv=none; d=zohomail.com; s=zohoarc; b=YhcOZGwxFv9qXqiTVM1jaZCMPvJGXFBG8NHUOYvReEek0LdZ9dy0TUggwJ0CiuYr9q2sF3CWbnvGEGlWXWnJ55xFLo2RU/r3IacyjFnHThtJ8fVWMJ3Sf0e6XX7QMYJT3oGBT5XBgA4X6VaCuMi41yxvcSm3GNJy366JFfVAw1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744268464; h=Content-Type: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:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=eO/NguLEqhRf2CvdBgGxsaheqOdE8yASzopPotPP558=; b=JaFjrhE25vrkvOqmswfPoahoVCgWT28UrascHhmq9GzMW5brS+rgncB6mHgMHSLtOzXnrw40uIFW1Qw5g3Wrqe7VjkNfp4OdCbqxyDEZ9+mUblk9qs3V0AjNNIiULAqPq8/WuoHqW2gc7mY1E7+ipBTQCABffvzyjUhfO1hNU+M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1744268464040231.62782463676047; Thu, 10 Apr 2025 00:01:04 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 682EA1741; Thu, 10 Apr 2025 03:01:03 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id AD2B317CD; Thu, 10 Apr 2025 02:58:49 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1B5121594; Thu, 10 Apr 2025 02:58:39 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8FBBEA2D for ; Thu, 10 Apr 2025 02:58:38 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-5rTeYP-sO2WOhPWoHZ6w2Q-1; Thu, 10 Apr 2025 02:58:36 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EF0681801A06 for ; Thu, 10 Apr 2025 06:58:35 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.64.128]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4764918009BC; Thu, 10 Apr 2025 06:58:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744268318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7KYHH/m+yMkEACsfSZl+Ds3lumqPl7Q7auZkbT1Zy34=; b=D1TT4U/9eLEtz1qK0vYMoU+STQOiHXt/GfWYDGz3fKhTvoMNfDFuHbPaGvuqoOGWpKiTv+ carQM7O8TPWSfyyarcuP1NnQhnH5lKFW0IY3vQMUPHeNC/U4wSER1/SIER3zhtbBv6+mF6 NpNRMwRbX8GYVbM+kyNq1DNyqZDa7XI= X-MC-Unique: 5rTeYP-sO2WOhPWoHZ6w2Q-1 X-Mimecast-MFC-AGG-ID: 5rTeYP-sO2WOhPWoHZ6w2Q_1744268316 To: devel@lists.libvirt.org Subject: [PATCH 5/5] qemu: make passt+vhostuser reconnect behave identically to passt+user Date: Thu, 10 Apr 2025 02:58:30 -0400 Message-ID: <20250410065830.380720-6-laine@redhat.com> In-Reply-To: <20250410065830.380720-1-laine@redhat.com> References: <20250410065830.380720-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Ab_lrRiG9wdHiqXBqYaU4wxw7sxmia52-S6vN7qLszw_1744268316 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GHJCATFBJR63KRP3LTWAKSWCTMUCWRAR X-Message-ID-Hash: GHJCATFBJR63KRP3LTWAKSWCTMUCWRAR X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Laurent Vivier , Stefano Brivio X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Laine Stump via Devel Reply-To: Laine Stump X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744268464275019000 Content-Type: text/plain; charset="utf-8"; x-default="true" When "original passt" support was added, we decided that we always wanted to reconnect (i.e. restart the passt process) if it was somehow terminated. Generic vhost-user only turns on reconnect if specified in the config, but there is no reason to require this if the other end of the vhost-user socket is a passt process - we know what has happened and what we want to do; no reason to make the default configuration "do the *wrong* thing". Resolves: https://issues.redhat.com/browse/RHEL-80169 Signed-off-by: Laine Stump Reviewed-by: Jiri Denemark --- src/qemu/qemu_passt.c | 6 ++++++ .../qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args | 6 +++--- .../schema-reorder-domain-subelements.x86_64-latest.args | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index bc495eca1e..018630a5de 100644 --- a/src/qemu/qemu_passt.c +++ b/src/qemu/qemu_passt.c @@ -182,6 +182,12 @@ qemuPasstPrepareVhostUser(virDomainObj *vm, */ g_free(net->data.vhostuser->data.nix.path); net->data.vhostuser->data.nix.path =3D qemuPasstCreateSocketPath(vm, n= et); + + /* reconnect is always enabled, with timeout always at 5 seconds, when + * using passt + */ + net->data.vhostuser->data.nix.reconnect.enabled =3D VIR_TRISTATE_BOOL_= YES; + net->data.vhostuser->data.nix.reconnect.timeout =3D 5; } =20 int diff --git a/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args b= /tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args index 7c030d7067..afbbe188cf 100644 --- a/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args +++ b/tests/qemuxmlconfdata/net-vhostuser-passt.x86_64-latest.args @@ -28,13 +28,13 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUG= uest1/.config \ -boot strict=3Don \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-stor= age","id":"ide0-0-0","bootindex":1}' \ --chardev socket,id=3Dcharnet0,path=3D/var/run/libvirt/qemu/passt/-1-QEMUGu= est1-net0.socket \ +-chardev socket,id=3Dcharnet0,path=3D/var/run/libvirt/qemu/passt/-1-QEMUGu= est1-net0.socket,reconnect-ms=3D5000 \ -netdev '{"type":"vhost-user","chardev":"charnet0","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "00:11:22:33:44:55","bus":"pci.0","addr":"0x2"}' \ --chardev socket,id=3Dcharnet1,path=3D/var/run/libvirt/qemu/passt/-1-QEMUGu= est1-net1.socket \ +-chardev socket,id=3Dcharnet1,path=3D/var/run/libvirt/qemu/passt/-1-QEMUGu= est1-net1.socket,reconnect-ms=3D5000 \ -netdev '{"type":"vhost-user","chardev":"charnet1","id":"hostnet1"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":= "00:11:22:33:44:11","bus":"pci.0","addr":"0x3"}' \ --chardev socket,id=3Dcharnet2,path=3D/var/run/libvirt/qemu/passt/-1-QEMUGu= est1-net2.socket \ +-chardev socket,id=3Dcharnet2,path=3D/var/run/libvirt/qemu/passt/-1-QEMUGu= est1-net2.socket,reconnect-ms=3D5000 \ -netdev '{"type":"vhost-user","chardev":"charnet2","id":"hostnet2"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet2","id":"net2","mac":= "00:11:22:33:44:11","bus":"pci.0","addr":"0x4"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxmlconfdata/schema-reorder-domain-subelements.x86_64= -latest.args b/tests/qemuxmlconfdata/schema-reorder-domain-subelements.x86_= 64-latest.args index d27dd77d9f..76df9c30b0 100644 --- a/tests/qemuxmlconfdata/schema-reorder-domain-subelements.x86_64-latest= .args +++ b/tests/qemuxmlconfdata/schema-reorder-domain-subelements.x86_64-latest= .args @@ -29,7 +29,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-passtvh= ostuu/.config \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -blockdev '{"driver":"file","filename":"/home/laine/libvirt/images/fedora-= 34.img","node-name":"libvirt-1-storage","read-only":false}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","multifunction":true,"ad= dr":"0x3","drive":"libvirt-1-storage","id":"virtio-disk0","bootindex":1}' \ --chardev socket,id=3Dcharnet0,path=3D/var/run/libvirt/qemu/passt/-1-passtv= hostuu-net0.socket \ +-chardev socket,id=3Dcharnet0,path=3D/var/run/libvirt/qemu/passt/-1-passtv= hostuu-net0.socket,reconnect-ms=3D5000 \ -netdev '{"type":"vhost-user","chardev":"charnet0","id":"hostnet0"}' \ -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":= "52:54:00:21:de:6c","bus":"pci.0","addr":"0x2"}' \ -chardev pty,id=3Dcharserial0 \ --=20 2.49.0