[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] The console can't capture user's input. Is it readonly or read/write?

Hi Daniel,

Since there's no machine serial port for FSL PowerPC board, I just use '-serial' option for ppc architecture.

@@ -5491,7 +5491,8 @@

             /* Use -chardev with -device if they are available */
             if (qemuCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) &&
-                qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
+                qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE) &&
+                !STREQ(def->os.arch, "ppc")) {
                 virCommandAddArg(cmd, "-chardev");
                 if (!(devstr = qemuBuildChrChardevStr(&serial->source,

The QEMU command is:
# /usr/bin/qemu-system-ppc -name demo -M ppce500v2 -enable-kvm -m 256 -nographic -kernel /media/ram/uImage -initrd /media/ram/ramdisk -append "root=/dev/ram rw console=ttyS0,115200" -serial pty -serial tcp::4445,server

Use virsh to generate XML file as below:
<domain type='kvm'>
  <memory unit='KiB'>262144</memory>
  <currentMemory unit='KiB'>262144</currentMemory>
  <vcpu placement='static'>1</vcpu>
    <type arch='ppc' machine='ppce500v2'>hvm</type>
    <cmdline>root=/dev/ram rw console=ttyS0,115200</cmdline>
  <clock offset='utc'/>
    <serial type='pty'>
      <target port='0'/>
    <serial type='tcp'>
      <source mode='bind' host='' service='4445'/>
      <protocol type='raw'/>
      <target port='1'/>
    <console type='pty'>
      <target type='serial' port='0'/>
    <memballoon model='virtio'/>

# virsh -c qemu:///system define demo.xml
# virsh -c qemu:///system start demo
# virsh -c qemu:///system console demo

It could print the booting message now but still can't capture user's input.
Otherwise users could not login and operate on the guest rootfs or run user space application on guest VM.

Exactly if reset the domain, the console could display the kernel reboot message on domain.
# virsh -c qemu:///system reset dome

It seemed that the console is readonly instead of read/write.
Do you have any suggestion about this issue?

Best Regards,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]