From 55f6ef4a5e485de3c1ba0751273d3ec3c06a2363 Mon Sep 17 00:00:00 2001 From: Sascha Bischoff Date: Thu, 5 Nov 2015 14:12:19 +0000 Subject: [PATCH] Gem5Device: Remove VirtIO device rebinding to align with gem5 - Remove the unbind and rebind for the VirtIO 9P mount method as gem5 now checkpoints the basic state of the device. This allows us to just mount it assuming that checkpoint have been created correctly. --- wlauto/devices/android/gem5/__init__.py | 38 ++++++------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/wlauto/devices/android/gem5/__init__.py b/wlauto/devices/android/gem5/__init__.py index 5a63d0f2..7eb3303e 100644 --- a/wlauto/devices/android/gem5/__init__.py +++ b/wlauto/devices/android/gem5/__init__.py @@ -318,35 +318,6 @@ class Gem5Device(AndroidDevice): self.sckt.setecho(False) self.sync_gem5_shell() - def mount_virtio(self): - """ - Mount the VirtIO device in the simulated system. - - We cannot assume any state for the VirtIO device in gem5 as it is not - serialised when checkpointing the system. Therefore, we unbind and - rebind the VirtIO device to force the driver to re-initialize the - device, prior to using it. We then mount the folder on the host system - using the VirtIo device. - """ - self.logger.info("Mounting VirtIO device in simulated system") - - # We always unbind, then re-bind the device. This ensures that the - # driver is re-loaded and that the device is re-initialized. Hence, this - # should work for both checkpointed and non-checkpointed gem5 systems. - vio_info = self.gem5_shell('ls /sys/bus/pci/drivers/virtio-pci/').strip().split() - mounts = [] - for f in vio_info: - if len(f.split(':')) > 1: - mounts.append(f.strip()) - - # Unbind and rebind all of the - for mount in mounts: - self.gem5_shell('echo -n "{}" > /sys/bus/pci/drivers/virtio-pci/unbind'.format(mount)) - self.gem5_shell('echo -n "{}" > /sys/bus/pci/drivers/virtio-pci/bind'.format(mount)) - - mount_command = "mount -t 9p -o trans=virtio,version=9p2000.L,aname={} gem5 /mnt/obb".format(self.temp_dir) - self.gem5_shell('busybox {}'.format(mount_command)) - def disconnect(self): """ Close and disconnect from the gem5 simulation. Additionally, we remove @@ -762,3 +733,12 @@ class Gem5Device(AndroidDevice): self.gem5_util("checkpoint") if end_simulation: self.disconnect() + + def mount_virtio(self): + """ + Mount the VirtIO device in the simulated system. + """ + self.logger.info("Mounting VirtIO device in simulated system") + + mount_command = "mount -t 9p -o trans=virtio,version=9p2000.L,aname={} gem5 /mnt/obb".format(self.temp_dir) + self.gem5_shell('busybox {}'.format(mount_command))