On 22/07/15 12:55, Yang Hongyang wrote:
This patch add a net filter between network backend and NIC devices.
All packets will pass by this filter.
TODO:
multiqueue support.
plugin support.
+--------------+ +-------------+
+----------+ | filter | |frontend(NIC)|
| real | | | | |
| network <--+backend <-------+ |
| backend | | peer +-------> peer |
+----------+ +--------------+ +-------------+
Usage:
-netdev tap,id=bn0 # you can use whatever backend as needed
-netdev filter,id=f0,backend=bn0,plugin=dump
-device e1000,netdev=f0
That's basically a neat idea... however, one question remains: Will
there be other filters beside the "dump" filter that you mentioned in
your example? Do you already have something in mind?
If not, I think this is likely not worth the effort - and we likely
should keep it simple and implement the dump option as suggested with my
patches instead.
diff --git a/net/filter.c b/net/filter.c
new file mode 100644
index 0000000..006c64a
--- /dev/null
+++ b/net/filter.c
@@ -0,0 +1,200 @@
+/*
+ * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
+ * (a.k.a. Fault Tolerance or Continuous Replication)
This looks like a bad copy-n-paste comment... ?
+ * Copyright (c) 2015 HUAWEI TECHNOLOGIES CO., LTD.
+ * Copyright (c) 2015 FUJITSU LIMITED
+ * Copyright (c) 2015 Intel Corporation
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
...
Thomas