summary refs log tree commit diff stats
path: root/tests/qemu-iotests/qed.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-11-01 13:24:51 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-11-01 13:24:51 +0000
commit8ebf8ea90ecbbb2ef743dccfbfb73e2904cad1f5 (patch)
tree56a5de883941fd7bacf6c485225bedcbad5450f9 /tests/qemu-iotests/qed.py
parent8002fa2bf6d3eddc0b73f8a0b64ac6b3ad1defab (diff)
parente301e65c97142c4d2a2adf35f5a4fa73d65d8a4f (diff)
downloadfocaccia-qemu-8ebf8ea90ecbbb2ef743dccfbfb73e2904cad1f5.tar.gz
focaccia-qemu-8ebf8ea90ecbbb2ef743dccfbfb73e2904cad1f5.zip
Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging
Python queue, 2018-10-30

* Makefile rule for running acceptance tests
  (make check-acceptance) (Cleber Rosa)
* Make iotests compatible with Python 3
  (Max Reitz)
* device-crash-test whitelist update (Thomas Huth)
* Misc cleanups (Cleber Rosa)

# gpg: Signature made Wed 31 Oct 2018 00:28:39 GMT
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/python-next-pull-request:
  scripts/qemu.py: use a more consistent docstring style
  scripts/decodetree.py: fix reference to attributes
  Travis support for the acceptance tests
  Acceptance tests: add make rule for running them
  Bootstrap Python venv for tests
  iotests: Unify log outputs between Python 2 and 3
  iotests: Modify imports for Python 3
  iotests: 'new' module replacement in 169
  iotests: Explicitly bequeath FDs in Python
  iotests: Different iterator behavior in Python 3
  iotests: Use // for Python integer division
  iotests: Use Python byte strings where appropriate
  iotests: Flush in iotests.py's QemuIoInteractive
  iotests: Make nbd-fault-injector flush
  scripts/device-crash-test: Remove devices that are not user_creatable anymore

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/qemu-iotests/qed.py')
-rwxr-xr-xtests/qemu-iotests/qed.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/qemu-iotests/qed.py b/tests/qemu-iotests/qed.py
index ea469b9c48..8adaaf46c4 100755
--- a/tests/qemu-iotests/qed.py
+++ b/tests/qemu-iotests/qed.py
@@ -80,7 +80,7 @@ class QED(object):
 
     def load_l1_table(self):
         self.l1_table = self.read_table(self.header['l1_table_offset'])
-        self.table_nelems = self.header['table_size'] * self.header['cluster_size'] / table_elem_size
+        self.table_nelems = self.header['table_size'] * self.header['cluster_size'] // table_elem_size
 
     def write_table(self, offset, table):
         s = ''.join(pack_table_elem(x) for x in table)
@@ -167,14 +167,14 @@ def cmd_zero_cluster(qed, pos, *args):
         n = int(args[0])
 
     for i in xrange(n):
-        l1_index = pos / qed.header['cluster_size'] / len(qed.l1_table)
+        l1_index = pos // qed.header['cluster_size'] // len(qed.l1_table)
         if qed.l1_table[l1_index] == 0:
             err('no l2 table allocated')
 
         l2_offset = qed.l1_table[l1_index]
         l2_table = qed.read_table(l2_offset)
 
-        l2_index = (pos / qed.header['cluster_size']) % len(qed.l1_table)
+        l2_index = (pos // qed.header['cluster_size']) % len(qed.l1_table)
         l2_table[l2_index] = 1 # zero the data cluster
         qed.write_table(l2_offset, l2_table)
         pos += qed.header['cluster_size']