From nobody Thu May 2 06:33:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1535119390539662.9709583808125; Fri, 24 Aug 2018 07:03:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F357310E98A; Fri, 24 Aug 2018 14:03:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 844D08FC0D; Fri, 24 Aug 2018 14:03:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7224C4BB75; Fri, 24 Aug 2018 14:03:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7OE31qw026548 for ; Fri, 24 Aug 2018 10:03:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 97D876F96F; Fri, 24 Aug 2018 14:03:01 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-58.phx2.redhat.com [10.3.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51BB46F123 for ; Fri, 24 Aug 2018 14:02:59 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 24 Aug 2018 10:02:56 -0400 Message-Id: <20180824140256.22030-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3] qemu: Ignore nwfilter binding instantiation issues during reconnect X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 24 Aug 2018 14:03:09 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1607202 It's essentially stated in the nwfilterBindingDelete that we will allow the admin to shoot themselves in the foot by deleting the nwfilter binding which then allows them to undefine the nwfilter that is in use for the running guest... However, by allowing this we cause a problem for libvirtd restart reconnect processing which would then try to recreate the missing binding attempting to use the deleted filter resulting in an error and thus shutting the guest down. So rather than keep adding virDomainConfNWFilterInstantiate flags to "ignore" specific error conditions, modify the logic to ignore, but VIR_WARN errors other than ignoreExists. This will at least allow the guest to not shutdown for only nwfilter binding errors that we can now perhaps recover from since we have the binding create/delete capability. Signed-off-by: John Ferlan --- v2: https://www.redhat.com/archives/libvir-list/2018-August/msg01567.html Differences to v2. Leave the ignoreExists bool, but just allow and VIR_WARN other errors from virDomainConfNWFilterInstantiate. Continue processing all filters from error point too. src/qemu/qemu_process.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ab749389ee..61a277f468 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3160,20 +3160,29 @@ qemuProcessNotifyNets(virDomainDefPtr def) } } =20 -static int -qemuProcessFiltersInstantiate(virDomainDefPtr def, bool ignoreExists) +/* Attempt to instantiate the filters. Ignore failures because it's + * possible that someone deleted a filter binding and the associated + * filter while the guest was running and we don't want that action + * to cause failure to keep the guest running during the reconnection + * processing. Nor do we necessarily want other failures to do the + * same. We'll just log the error conditions other than of course + * ignoreExists possibility (e.g. the true flag) */ +static void +qemuProcessFiltersInstantiate(virDomainDefPtr def) { size_t i; =20 for (i =3D 0; i < def->nnets; i++) { virDomainNetDefPtr net =3D def->nets[i]; if ((net->filter) && (net->ifname)) { - if (virDomainConfNWFilterInstantiate(def->name, def->uuid, net= , ignoreExists) < 0) - return 1; + if (virDomainConfNWFilterInstantiate(def->name, def->uuid, net, + true) < 0) { + VIR_WARN("filter '%s' instantiation for '%s' failed '%s'", + net->filter, net->ifname, virGetLastErrorMessage(= )); + virResetLastError(); + } } } - - return 0; } =20 static int @@ -7892,8 +7901,7 @@ qemuProcessReconnect(void *opaque) =20 qemuProcessNotifyNets(obj->def); =20 - if (qemuProcessFiltersInstantiate(obj->def, true)) - goto error; + qemuProcessFiltersInstantiate(obj->def); =20 if (qemuProcessRefreshDisks(driver, obj, QEMU_ASYNC_JOB_NONE) < 0) goto error; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list