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 8EEC15A0082 for ; Wed, 22 Feb 2023 11:21:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677061272; 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=3NSc9EobaUFs3LkqKlkKzN0XZ3WKZnozOIlitiy33GM=; b=V6BzcSBCMJRkAIuDtQP4w7fAinY5l87lrv2ap2lUAT4tNeFAJuTQpR8an36375Gvb1hvDJ iGGZTJVArWAM5ssm7tNl/HyNxAnJUdiBA+j1AGAVw/rCtE3tCqnMS16LEwUmk/PHSOB9ah sLgA9Tc8+eGk5hB1i8b+4re/J5Q9DKo= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-35-BK_CzSI7PGWSYSyLOIqYJA-1; Wed, 22 Feb 2023 05:21:11 -0500 X-MC-Unique: BK_CzSI7PGWSYSyLOIqYJA-1 Received: by mail-ed1-f72.google.com with SMTP id g24-20020a056402321800b004ace77022ebso10126388eda.8 for ; Wed, 22 Feb 2023 02:21:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3NSc9EobaUFs3LkqKlkKzN0XZ3WKZnozOIlitiy33GM=; b=MI7W50y3O2knlaWfPb+0TKRIEVWrYkoiXcZiy2eWAtRV3vzhJ2/ZDhUF2bhOpjnj1+ 2pNj9cX00Gj5zVXbYhs6v1jfFzUP57GNgukIoy82LWgYN3GKlmTEp2QxhUgXgJrX24AR zSbhwicNE7wuxd1BBcwa34+SB4krmuqr2g1sJIIWu/r02Udb7TdoSjWCUm9+bXbLxZtp y8iqgJdv5AqiQAsliC388W5NfCX+fE8aYQNbE+vobCVq0cF8e+c80C8xriWSWRMOoFNK GK+fDjE8JgSZzecAr/NpooRUYsZviNUfJqvnUO5/Vne7R5DZaL0eMzH6PlGisC9lIXTT tzAA== X-Gm-Message-State: AO0yUKWoCoE1zKGPh3QHH96CATqHdbzdiEICO/+gBklQHmXsWzpEYZax by75m9SQ122xw6qoJRJllQXB2UMjtnotMKDr6Ti4jyIiu45eLnc3o8ww8qSFClXjpHXgHT7o0AA BRh5PljZCFUla X-Received: by 2002:a17:906:8056:b0:872:27cb:9436 with SMTP id x22-20020a170906805600b0087227cb9436mr13542646ejw.43.1677061270049; Wed, 22 Feb 2023 02:21:10 -0800 (PST) X-Google-Smtp-Source: AK7set+vibGGsO/io0RmXWG7dDEUkgMklk1h+WqjRsr2TDjzLMHYS1fJVyAkc1ljqkKbsM3v+5U4mQ== X-Received: by 2002:a17:906:8056:b0:872:27cb:9436 with SMTP id x22-20020a170906805600b0087227cb9436mr13542636ejw.43.1677061269793; Wed, 22 Feb 2023 02:21:09 -0800 (PST) Received: from [10.43.2.39] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id kt8-20020a170906aac800b008dd6bf721c2sm2248886ejb.106.2023.02.22.02.21.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Feb 2023 02:21:09 -0800 (PST) Message-ID: <41fc76f2-92f6-1a8f-3796-7408b4eb0a19@redhat.com> Date: Wed, 22 Feb 2023 11:21:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [libvirt PATCH 0/3] Support for restarting passt backend To: Laine Stump , libvir-list@redhat.com References: <20230222003559.62442-1-laine@redhat.com> From: =?UTF-8?B?TWljaGFsIFByw612b3puw61r?= In-Reply-To: <20230222003559.62442-1-laine@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: 4Y6P4VXSHWVTSOOXK7KBI44SOW6BBWBY X-Message-ID-Hash: 4Y6P4VXSHWVTSOOXK7KBI44SOW6BBWBY X-Mailman-Approved-At: Thu, 23 Feb 2023 09:26:34 +0100 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: On 2/22/23 01:35, Laine Stump wrote: > 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 > Reviewed-by: Michal Privoznik Michal