0a7476
From 81d6db6e7af7d9f159cfb1c5b7bfc7b6f16b4b23 Mon Sep 17 00:00:00 2001
0a7476
Message-Id: <81d6db6e7af7d9f159cfb1c5b7bfc7b6f16b4b23@dist-git>
0a7476
From: John Ferlan <jferlan@redhat.com>
0a7476
Date: Wed, 3 Apr 2019 07:04:46 -0400
0a7476
Subject: [PATCH] nwfilter: Add extra verbiage for binding create/delete
0a7476
MIME-Version: 1.0
0a7476
Content-Type: text/plain; charset=UTF-8
0a7476
Content-Transfer-Encoding: 8bit
0a7476
0a7476
https://bugzilla.redhat.com/show_bug.cgi?id=1609454
0a7476
0a7476
Add some cautionary words related to the create and delete
0a7476
NWFilter Binding use cases and possible issues that may result
0a7476
to the virsh nwfilter-binding-{create|delete} descriptions
0a7476
and the virNWFilterBinding{CreateXML|Delete) API descriptions.
0a7476
0a7476
Essentially summarizing commit 2d9318b6c without using the
0a7476
shoot yourself in the foot wording.
0a7476
0a7476
Signed-off-by: John Ferlan <jferlan@redhat.com>
0a7476
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
0a7476
(cherry picked from commit b4833917f12a0ffa4b5957ef77edea737cb8ad58)
0a7476
Message-Id: <20190403110446.15118-1-jferlan@redhat.com>
0a7476
Reviewed-by: Erik Skultety <eskultet@redhat.com>
0a7476
---
0a7476
 src/libvirt-nwfilter.c | 16 ++++++++++++++--
0a7476
 tools/virsh.pod        | 14 ++++++++++++--
0a7476
 2 files changed, 26 insertions(+), 4 deletions(-)
0a7476
0a7476
diff --git a/src/libvirt-nwfilter.c b/src/libvirt-nwfilter.c
0a7476
index e572d46c18..3da85adc9e 100644
0a7476
--- a/src/libvirt-nwfilter.c
0a7476
+++ b/src/libvirt-nwfilter.c
0a7476
@@ -678,7 +678,14 @@ virNWFilterBindingGetFilterName(virNWFilterBindingPtr binding)
0a7476
  * @flags: currently unused, pass 0
0a7476
  *
0a7476
  * Define a new network filter, based on an XML description
0a7476
- * similar to the one returned by virNWFilterGetXMLDesc()
0a7476
+ * similar to the one returned by virNWFilterGetXMLDesc(). This
0a7476
+ * API may be used to associate a filter with a currently running
0a7476
+ * guest that does not have a filter defined for a specific network
0a7476
+ * port. Since the bindings are generally automatically managed by
0a7476
+ * the hypervisor, using this command to define a filter for a network
0a7476
+ * port and then starting the guest afterwards may prevent the guest
0a7476
+ * from starting if it attempts to use the network port and finds a
0a7476
+ * filter already defined.
0a7476
  *
0a7476
  * virNWFilterFree should be used to free the resources after the
0a7476
  * binding object is no longer needed.
0a7476
@@ -717,7 +724,12 @@ virNWFilterBindingCreateXML(virConnectPtr conn, const char *xml, unsigned int fl
0a7476
  * @binding: a binding object
0a7476
  *
0a7476
  * Delete the binding object. This does not free the
0a7476
- * associated virNWFilterBindingPtr object.
0a7476
+ * associated virNWFilterBindingPtr object. This API
0a7476
+ * may be used to remove the network port binding filter
0a7476
+ * currently in use for the guest while the guest is
0a7476
+ * running without needing to restart the guest. Restoring
0a7476
+ * the network port binding filter for the running guest
0a7476
+ * would be accomplished by using virNWFilterBindingCreateXML.
0a7476
  *
0a7476
  * Returns 0 in case of success and -1 in case of failure.
0a7476
  */
0a7476
diff --git a/tools/virsh.pod b/tools/virsh.pod
0a7476
index 368ce89ed8..0e704bc407 100644
0a7476
--- a/tools/virsh.pod
0a7476
+++ b/tools/virsh.pod
0a7476
@@ -4825,13 +4825,23 @@ of the network filters directly.
0a7476
 =item B<nwfilter-binding-create> I<xmlfile>
0a7476
 
0a7476
 Associate a network port with a network filter. The network filter backend
0a7476
-will immediately attempt to instantiate the filter rules on the port.
0a7476
+will immediately attempt to instantiate the filter rules on the port. This
0a7476
+command may be used to associate a filter with a currently running guest
0a7476
+that does not have a filter defined for a specific network port. Since the
0a7476
+bindings are generally automatically managed by the hypervisor, using this
0a7476
+command to define a filter for a network port and then starting the guest
0a7476
+afterwards may prevent the guest from starting if it attempts to use the
0a7476
+network port and finds a filter already defined.
0a7476
 
0a7476
 =item B<nwfilter-binding-delete> I<port-name>
0a7476
 
0a7476
 Disassociate a network port from a network filter. The network filter
0a7476
 backend will immediately tear down the filter rules that exist on the
0a7476
-port.
0a7476
+port. This command may be used to remove the network port binding for
0a7476
+a filter currently in use for the guest while the guest is running
0a7476
+without needing to restart the guest. Restoring the network port binding
0a7476
+filter for the running guest would be accomplished by using
0a7476
+I<nwfilter-binding-create>.
0a7476
 
0a7476
 =item B<nwfilter-binding-list>
0a7476
 
0a7476
-- 
0a7476
2.21.0
0a7476