arm/arm64: pci: Add pci-testdev PCI device operation test
Suggested-by: Andrew Jones <drjones@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Message-Id: <7d7e8f320a5de2f9201c3d21f88dc63520ea41aa.1478512824.git.agordeev@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/arm/run b/arm/run
index a2f35ef..1ee6231 100755
--- a/arm/run
+++ b/arm/run
@@ -67,8 +67,13 @@
chr_testdev='-device virtio-serial-device'
chr_testdev+=' -device virtconsole,chardev=ctd -chardev testdev,id=ctd'
+pci_testdev=
+if $qemu $M -device '?' 2>&1 | grep pci-testdev > /dev/null; then
+ pci_testdev="-device pci-testdev"
+fi
+
M+=",accel=$ACCEL"
-command="$qemu $M -cpu $processor $chr_testdev"
+command="$qemu $M -cpu $processor $chr_testdev $pci_testdev"
command+=" -display none -serial stdio -kernel"
command="$(timeout_cmd) $command"
echo $command "$@"