1. 24 10月, 2016 2 次提交
  2. 14 9月, 2016 1 次提交
    • 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
  3. 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
  4. 29 1月, 2016 1 次提交
  5. 29 5月, 2015 1 次提交
  6. 30 6月, 2014 1 次提交
    • R
      serial: poll the serial console with G_IO_HUP · e02bc6de
      Roger Pau Monne 提交于
      On FreeBSD polling a master pty while the other end is not connected
      with G_IO_OUT only results in an endless wait. This is different from
      the Linux behaviour, that returns immediately. In order to demonstrate
      this, I have the following example code:
      
      http://xenbits.xen.org/people/royger/test_poll.c
      
      When executed on Linux:
      
      $ ./test_poll
      In callback
      
      On FreeBSD instead, the callback never gets called:
      
      $ ./test_poll
      
      So, in order to workaround this, poll the source with G_IO_HUP (which
      makes the code behave the same way on both Linux and FreeBSD).
      Signed-off-by: NRoger Pau Monné <roger.pau@citrix.com>
      Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      Cc: Michael Tokarev <mjt@tls.msk.ru>
      Cc: "Andreas Färber" <afaerber@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: xen-devel@lists.xenproject.org
      [Add hw/char/cadence_uart.c too. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e02bc6de
  7. 27 6月, 2014 1 次提交
  8. 14 3月, 2014 1 次提交
  9. 13 3月, 2014 2 次提交
  10. 02 8月, 2013 1 次提交
  11. 16 4月, 2013 3 次提交
  12. 09 4月, 2013 2 次提交
  13. 27 3月, 2013 3 次提交
  14. 09 3月, 2013 2 次提交
  15. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  16. 11 1月, 2013 1 次提交
    • A
      Make all static TypeInfos const · 8c43a6f0
      Andreas Färber 提交于
      Since 39bffca2 (qdev: register all
      types natively through QEMU Object Model), TypeInfo as used in
      the common, non-iterative pattern is no longer amended with information
      and should therefore be const.
      
      Fix the documented QOM examples:
      
       sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h
      
      Since frequently the wrong examples are being copied by contributors of
      new devices, fix all types in the tree:
      
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c
      
      This also avoids to piggy-back these changes onto real functional
      changes or other refactorings.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8c43a6f0
  17. 19 12月, 2012 2 次提交
  18. 15 2月, 2012 1 次提交
  19. 04 2月, 2012 1 次提交
    • A
      qdev: register all types natively through QEMU Object Model · 39bffca2
      Anthony Liguori 提交于
      This was done in a mostly automated fashion.  I did it in three steps and then
      rebased it into a single step which avoids repeatedly touching every file in
      the tree.
      
      The first step was a sed-based addition of the parent type to the subclass
      registration functions.
      
      The second step was another sed-based removal of subclass registration functions
      while also adding virtual functions from the base class into a class_init
      function as appropriate.
      
      Finally, a python script was used to convert the DeviceInfo structures and
      qdev_register_subclass functions to TypeInfo structures, class_init functions,
      and type_register_static calls.
      
      We are almost fully converted to QOM after this commit.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      39bffca2
  20. 28 1月, 2012 2 次提交
  21. 14 1月, 2012 1 次提交
  22. 22 12月, 2011 2 次提交
  23. 22 8月, 2011 3 次提交
  24. 24 7月, 2011 1 次提交
  25. 18 7月, 2011 2 次提交
  26. 27 5月, 2011 1 次提交