xenserver: Avoid printing log messages to the console from scripts.
authorBen Pfaff <blp@nicira.com>
Thu, 14 May 2009 23:13:30 +0000 (16:13 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 14 May 2009 23:13:30 +0000 (16:13 -0700)
Log messages from cfg-mode tended to overwrite random bits of the xsconsole
screen.

Bug #1315.

xenserver/etc_xapi.d_plugins_vswitch-cfg-update
xenserver/etc_xensource_scripts_vif
xenserver/opt_xensource_libexec_interface-reconfigure
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureNiciraVSwitch.py

index dc7b4a17b42920c7289091e2c869f96f93f16381..8d2545875248ab6e85316c5d98d8f9986864c108 100755 (executable)
@@ -102,7 +102,8 @@ def vswitchCfgQuery(key):
     return output
 
 def vswitchCfgMod(action_args):
-    cmd = [cfg_mod, "--config-file=" + vswitchd_cfg_filename] + action_args
+    cmd = [cfg_mod, "-vANY:console:emer",
+           "--config-file=" + vswitchd_cfg_filename] + action_args
     exitcode = subprocess.call(cmd)
     if exitcode != 0:
         log.error("cfg-mod failed with exit code "
index 670c22fdcd6f200e3934c42b5d81a4391d6f5a67..3331242304b7e504a3d7145a0b276117a41a1c28 100755 (executable)
@@ -121,7 +121,8 @@ remove)
        xenstore-rm "${HOTPLUG}/hotplug"
        vif=vif${DOMID}.${DEVID}
        logger -t scripts-vif "${vif} has been removed"
-       $cfg-mod -F /etc/vswitchd.conf --del-match="bridge.*.port=${vif}" \
+       $cfg-mod -vANY:console:emer -F /etc/vswitchd.conf \
+            --del-match="bridge.*.port=${vif}" \
            --del-match="vlan.${vif}.[!0-9]*"
        ;;
 esac
index 3ec7826240b3f452694d48925aaffddb61611eca..0f9acef452ab43d89bc54671af02571f55dbaa83 100755 (executable)
@@ -743,7 +743,8 @@ def configure_netdev(pif):
             print 'failed.'
 
 def modify_config(commands):
-    run_command(['/root/vswitch/bin/cfg-mod', '-F', '/etc/vswitchd.conf']
+    run_command(['/root/vswitch/bin/cfg-mod', '-vANY:console:emer',
+                 '-F', '/etc/vswitchd.conf']
                 + commands + ['-c'])
     run_command(['/sbin/service', 'vswitch', 'reload'])
 
index eef2af9eb9f053cfd5fefa1a34da04110116271e..2664106627307a66831e65ab26acd3a7a99f1f16 100644 (file)
@@ -77,7 +77,8 @@ class VSwitchConfig:
 
     @staticmethod
     def Get(key):
-        cmd = [cfg_mod, "--config-file=" + vswitchd_cfg_filename, "-q", key]
+        cmd = [cfg_mod, "-vANY:console:emer", "-F", vswitchd_cfg_filename,
+               "-q", key]
         output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
         if len(output) == 0 or output[0] == None:
             output = ""