1. 24 10月, 2016 6 次提交
  2. 18 10月, 2016 1 次提交
  3. 10 10月, 2016 5 次提交
  4. 14 9月, 2016 2 次提交
    • D
      hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all · 6ab3fc32
      Daniel P. Berrange 提交于
      The qemu_chr_fe_write method will return -1 on EAGAIN if the
      chardev backend write would block. Almost no callers of the
      qemu_chr_fe_write() method check the return value, instead
      blindly assuming data was successfully sent. In most cases
      this will lead to silent data loss on interactive consoles,
      but in some cases (eg RNG EGD) it'll just cause corruption
      of the protocol being spoken.
      
      We unfortunately can't fix the virtio-console code, due to
      a bug in the Linux guest drivers, which would cause the
      entire Linux kernel to hang if we delay processing of the
      incoming data in any way. Fixing this requires first fixing
      the guest driver to not hold spinlocks while writing to the
      hvc device backend.
      
      Fixes bug: https://bugs.launchpad.net/qemu/+bug/1586756Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1473170165-540-4-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6ab3fc32
    • D
      sclpconsolelm: remove bogus check for -EAGAIN · 7983e829
      Daniel P. Berrange 提交于
      The write_console_data() method in sclpconsole-lm.c checks
      whether the return value of qemu_chr_fe_write() has the
      value of -EAGAIN and if so then increments the buffer offset
      by the value of EAGAIN. Fortunately qemu_chr_fe_write() will
      never return EAGAIN directly, rather it returns -1 with
      errno set to EAGAIN, so this broken code path was not
      reachable. The behaviour on EAGAIN was stil bad though,
      causing the write_console_data() to busy_wait repeatedly
      calling qemu_chr_fe_write() with no sleep between iters.
      
      Just remove all this loop logic and replace with a call
      to qemu_chr_fe_write_all().
      Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1473170165-540-3-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7983e829
  5. 08 9月, 2016 1 次提交
  6. 12 8月, 2016 1 次提交
  7. 11 8月, 2016 1 次提交
    • D
      virtio-console: set frontend open permanently for console devs · bce6261e
      Daniel P. Berrange 提交于
      The virtio-console.c file handles both serial consoles
      and interactive consoles, since they're backed by the
      same device model.
      
      Since serial devices are expected to be reliable and
      need to notify the guest when the backend is opened
      or closed, the virtio-console.c file wires up support
      for chardev events. This affects both serial consoles
      and interactive consoles, using a network connection
      based chardev backend such as 'socket', but not when
      using a PTY based backend or plain 'file' backends.
      
      When the host side is not connected the handle_output()
      method in virtio-serial-bus.c will drop any data sent
      by the guest, before it even reaches the virtio-console.c
      code. This means that if the chardev has a logfile
      configured, the data will never get logged.
      
      Consider for example, configuring a x86_64 guest with a
      plain UART serial port
      
        -chardev socket,id=charserial1,host=127.0.0.1,port=9001,server,nowait,logfile=console1.log,logappend=on
        -device isa-serial,chardev=charserial1,id=serial1
      
      vs a s390 guest which has to use the virtio-console port
      
        -chardev socket,id=charconsole1,host=127.0.0.1,port=9000,server,nowait,logfile=console2.log,logappend=on
        -device virtconsole,chardev=charconsole1,id=console1
      
      The isa-serial one gets data written to the log regardless
      of whether a client is connected, while the virtioconsole
      one only gets data written to the log when a client is
      connected.
      
      There is no need for virtio-serial-bus.c to aggressively
      drop the data for console devices, as the chardev code is
      prefectly capable of discarding the data itself.
      
      So this patch changes virtconsole devices so that they
      are always marked as having the host side open. This
      ensures that the guest OS will always send any data it
      has (Linux virtio-console hvc driver actually ignores
      the host open state and sends data regardless, but we
      should not rely on that), and also prevents the
      virtio-serial-bus code prematurely discarding data.
      
      The behaviour of virtserialport devices is *not* changed,
      only virtconsole, because for the former, it is important
      that the guest OSknow exactly when the host side is opened
      / closed so it can do any protocol re-negotiation that may
      be required.
      
      Fixes bug: https://bugs.launchpad.net/qemu/+bug/1599214Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1470241360-3574-2-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      bce6261e
  8. 22 7月, 2016 2 次提交
  9. 12 7月, 2016 1 次提交
  10. 29 6月, 2016 6 次提交
  11. 27 6月, 2016 1 次提交
  12. 21 6月, 2016 2 次提交
  13. 17 6月, 2016 1 次提交
  14. 07 6月, 2016 1 次提交
  15. 06 6月, 2016 5 次提交
  16. 29 5月, 2016 4 次提交