[ovs-dev] [PATCH 3/5] ovs-bugtool: Compact the database before collecting.

Gurucharan Shetty shettyg at nicira.com
Mon Jul 22 19:17:07 UTC 2013


Currently the openvswitch database is being collected with
CAP_NETWORK_CONFIG which has a max size of 50 KB. This is
quite low as the database can easily be larger than 50 KB.

Move database collection to CAP_NETWORK_STATUS which does
not have a max size. Also, compact the database before picking
it up.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 utilities/bugtool/ovs-bugtool.in |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
index 854dfa1..e2a8c37 100755
--- a/utilities/bugtool/ovs-bugtool.in
+++ b/utilities/bugtool/ovs-bugtool.in
@@ -543,7 +543,6 @@ exclude those logs from the archive.
     tree_output(CAP_NETWORK_CONFIG, SYSCONFIG_NETWORK_SCRIPTS, ROUTE_RE)
     file_output(CAP_NETWORK_CONFIG, [SYSCONFIG_NETWORK, RESOLV_CONF, NSSWITCH_CONF, HOSTS])
     file_output(CAP_NETWORK_CONFIG, [NTP_CONF, IPTABLES_CONFIG, HOSTS_ALLOW, HOSTS_DENY])
-    file_output(CAP_NETWORK_CONFIG, [OPENVSWITCH_CONF_DB])
 
     cmd_output(CAP_NETWORK_INFO, [IFCONFIG, '-a'])
     cmd_output(CAP_NETWORK_INFO, [ROUTE, '-n'])
@@ -575,6 +574,9 @@ exclude those logs from the archive.
     tree_output(CAP_NETWORK_INFO, PROC_NET_VLAN_DIR)
     cmd_output(CAP_NETWORK_INFO, [TC, '-s', 'qdisc'])
     file_output(CAP_NETWORK_INFO, [PROC_NET_SOFTNET_STAT])
+
+    compact_db()
+    file_output(CAP_NETWORK_STATUS, [OPENVSWITCH_CONF_DB])
     if os.path.exists(OPENVSWITCH_VSWITCHD_PID):
         cmd_output(CAP_NETWORK_STATUS, [OVS_DPCTL, 'show', '-s'])
         for d in dp_list():
@@ -739,6 +741,13 @@ def dp_list():
         return output.getvalue().splitlines()
     return []
 
+def compact_db():
+    output = StringIO.StringIO()
+    max_time = 5
+    procs = [ProcOutput(['ovs-appctl', '-t', 'ovsdb-server',
+             'ovsdb-server/compact', 'Open_vSwitch'], max_time, output)]
+    run_procs([procs])
+
 def fd_usage(cap):
     output = ''
     fd_dict = {}
-- 
1.7.9.5




More information about the dev mailing list