[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] Rebuild network filter for UML guests on updates



When nwfilter support was added to UML, I didn't realise the UML driver
needed instrumentation to make updating nwfilters on the fly work. This
patch adds this bit of glue.

Signed-off-by: Soren Hansen <soren linux2go dk>
---
 src/uml/uml_driver.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 40345d5..9101928 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -2198,6 +2198,18 @@ static virDriver umlDriver = {
     NULL, /* qemuDomainMonitorCommand */
 };
 
+static int
+umlVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED,
+                   virHashIterator iter, void *data)
+{
+    struct uml_driver *driver = uml_driver;
+
+    umlDriverLock(driver);
+    virHashForEach(uml_driver->domains.objs, iter, data);
+    umlDriverUnlock(driver);
+
+    return 0;
+}
 
 static virStateDriver umlStateDriver = {
     .name = "UML",
@@ -2207,8 +2219,14 @@ static virStateDriver umlStateDriver = {
     .active = umlActive,
 };
 
+static virNWFilterCallbackDriver umlCallbackDriver = {
+    .name = "UML",
+    .vmFilterRebuild = umlVMFilterRebuild,
+};
+
 int umlRegister(void) {
     virRegisterDriver(&umlDriver);
     virRegisterStateDriver(&umlStateDriver);
+    virNWFilterRegisterCallbackDriver(&umlCallbackDriver);
     return 0;
 }
-- 
1.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]