From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 5B1115A026A for ; Wed, 22 Feb 2023 01:36:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677026161; 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; bh=/jrUYYRhvLj2wu0W2yhDf4mhzd1HjMm7H2Ojsb825Qo=; b=bNCUHanv8qxX+JnUUM50RHQbRKUEawuzTlo/umZKQvI9wP0hipenFcP/wZdYHrueG9y2Aj NhC4s3V9PUrH/LQaVVkHAONoVkEKmFCYI8ab7lxib8/g6VOjJScvaj0BGwrN6xhx5Xdmgk 03Hm+vIatLDz1iDRxgN0lcVmkx4Muyk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-573-2Yzy3RdmPVKsUJR2FB5k3A-1; Tue, 21 Feb 2023 19:35:59 -0500 X-MC-Unique: 2Yzy3RdmPVKsUJR2FB5k3A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8326E3813F29 for ; Wed, 22 Feb 2023 00:35:59 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50D542026D4B; Wed, 22 Feb 2023 00:35:59 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 0/3] Support for restarting passt backend Date: Tue, 21 Feb 2023 19:35:56 -0500 Message-Id: <20230222003559.62442-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-ID-Hash: U56VEEDAGYO353JCF6KR6FM6IXUBHWF7 X-Message-ID-Hash: U56VEEDAGYO353JCF6KR6FM6IXUBHWF7 X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: If the passt process that implements the backend of a QEMU emulated network device terminates, QEMU itself is incapable of restarting a new process so that the networking can begin... working again. However, what QEMU can and does do is: 1) send the NETDEV_STREAM_DISCONNECTED event to libvirt when it sees that the socket has been closed (this event has been in QEMU for as long as support for "-netdev stream", which is used for connecting to passt) 2) as of QEMU 8.0.0, the qemu commandline for -netdev stream accepts the "reconnect" option, which tells QEMU to attempt reconnecting to the same socket it previously used, repeating the attempt every "n" seconds (the only argument to reconnect) until it is successful. If libvirt adds the reconnect option to the qemu commandline, and then responds to a NETDEV_STREAM_DISCONNECTED event by re-running the same passt command that it ran when the device was originally connected, then a guest will be able to recover in the (very unlikely, according to Stefano!) event that the original passt process unexpectedly exits, or is killed by some external entity. Patch 2/3 handles (2) above, while patch 3/3 handles (1). (patch 1/3 is a short guest appearance by pkrempa. Thanks pkrempa!). This resolves https://bugzilla.redhat.com/2172098 Along with Stefano's series fixing up selinux issues related to running the passt process, they make the passt backend very usable. Laine Stump (2): qemu: add reconnect=5 to passt qemu commandline options when available qemu: respond to NETDEV_STREAM_DISCONNECTED event Peter Krempa (1): qemu: capabilities: Introduce QEMU_CAPS_NETDEV_STREAM_RECONNECT src/qemu/qemu_capabilities.c | 4 + src/qemu/qemu_capabilities.h | 3 + src/qemu/qemu_domain.c | 1 + src/qemu/qemu_domain.h | 1 + src/qemu/qemu_driver.c | 82 +++++++++++++++++++ src/qemu/qemu_monitor.c | 11 +++ src/qemu/qemu_monitor.h | 6 ++ src/qemu/qemu_monitor_json.c | 16 ++++ src/qemu/qemu_passt.c | 11 +++ src/qemu/qemu_process.c | 18 ++++ .../caps_8.0.0.x86_64.xml | 1 + .../net-user-passt.x86_64-7.2.0.args | 37 +++++++++ .../net-user-passt.x86_64-latest.args | 2 +- tests/qemuxml2argvtest.c | 1 + 14 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/net-user-passt.x86_64-7.2.0.args -- 2.39.2