On 03/20/2014 07:28 AM, Ming Lei wrote:
On ARM/ARM64 VM, ISA bus isn't supported, so use virtio serial port
for console redirection.

Signed-off-by: Ming Lei <[email protected]>
---
  virttest/qemu_vm.py |   10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py
index 79b3d4e..304a3f8 100644
--- a/virttest/qemu_vm.py
+++ b/virttest/qemu_vm.py
@@ -430,8 +430,13 @@ class VM(virt_vm.BaseVM):
              cmd += _add_option("path", filename)
              cmd += _add_option("server", "NO_EQUAL_STRING")
              cmd += _add_option("nowait", "NO_EQUAL_STRING")
-            cmd += " -device isa-serial"
-            cmd += _add_option("chardev", serial_id)
+            if is_platform_bus is False:

This comparison is better expressed as:

    if not is_platform_bus:

+                cmd += " -device isa-serial"
+                cmd += _add_option("chardev", serial_id)
+            else:
+                cmd += " -device virtio-serial-device"
+                cmd += " -device virtconsole"
+                cmd += _add_option("chardev", serial_id)
              return cmd

          def add_virtio_port(devices, name, bus, filename, porttype, chardev,
@@ -1064,6 +1069,7 @@ class VM(virt_vm.BaseVM):
          vdisk = 0
          scsi_disk = 0
          self.last_boot_index = 0
+        is_platform_bus = params.get('pci_bus') == "platform"
          if params.get("kernel"):
              self.last_boot_index = 1



_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to