From: Wei Yang<[email protected]>

In client/virt/virt_utils.py, we assign the ioctl command value
according to its arch.
---
 client/virt/virt_utils.py |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/client/virt/virt_utils.py b/client/virt/virt_utils.py
index 7759b2d..b6df74e 100644
--- a/client/virt/virt_utils.py
+++ b/client/virt/virt_utils.py
@@ -11,6 +11,8 @@ from autotest_lib.client.bin import utils, os_dep
 from autotest_lib.client.common_lib import error, logging_config
 from autotest_lib.client.common_lib import logging_manager, git
 import rss_client, aexpect
+import platform
+
 try:
     import koji
     KOJI_INSTALLED = True
@@ -23,14 +25,22 @@ SIOCGIFHWADDR = 0x8927
 SIOCSIFFLAGS = 0x8914
 SIOCGIFINDEX = 0x8933
 SIOCBRADDIF = 0x89a2
+ARCH = platform.machine()
 # From linux/include/linux/if_tun.h
-TUNSETIFF = 0x400454ca
-TUNGETIFF = 0x800454d2
-TUNGETFEATURES = 0x800454cf
-IFF_UP = 0x1
+if ARCH == "ppc64":
+       TUNSETIFF      = 0x800454ca
+       TUNGETIFF      = 0x400454d2
+       TUNGETFEATURES = 0x400454cf
+else:
+       TUNSETIFF      = 0x400454ca
+       TUNGETIFF      = 0x800454d2
+       TUNGETFEATURES = 0x800454cf
 IFF_TAP = 0x0002
 IFF_NO_PI = 0x1000
 IFF_VNET_HDR = 0x4000
+# From linux/include/linux/if.h
+IFF_UP = 0x1
+
 
 def _lock_file(filename):
     f = open(filename, "w")
-- 
1.7.7

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to