1. 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
  2. 23 3月, 2016 2 次提交
    • P
      hw: explicitly include qemu-common.h and cpu.h · 4771d756
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4771d756
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  3. 29 1月, 2016 1 次提交
    • P
      ppc: Clean up includes · 0d75590d
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-6-git-send-email-peter.maydell@linaro.org
      0d75590d
  4. 07 7月, 2015 3 次提交
  5. 09 3月, 2015 1 次提交
  6. 16 6月, 2014 1 次提交
  7. 08 11月, 2013 1 次提交
  8. 02 9月, 2013 1 次提交
    • A
      pseries: Fix stalls on hypervisor virtual console · 7770b6f7
      Anton Blanchard 提交于
      A number of users are reporting stalls when using the pseries
      hypervisor virtual console.
      
      A simple test case is to paste 15 or 17 characters at a time
      into the console. Pasting 15 characters at a time works fine
      but pasting 17 characters hangs for a random amount of time.
      Other activity (network, qemu monitor etc) unblocks it.
      
      If qemu-char tries to send more than 16 characters at once,
      vty_can_receive returns false. At this point we have to
      wait for the guest to consume that output. Everything is good
      so far.
      
      The problem occurs when the the guest does consume the output.
      We need to signal back to the qemu-char layer that we are
      ready for more input. Without this we block until something
      else kicks us (eg network activity).
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      7770b6f7
  9. 29 7月, 2013 1 次提交
  10. 27 4月, 2013 1 次提交
  11. 16 4月, 2013 1 次提交
  12. 09 4月, 2013 2 次提交
  13. 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
  14. 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
  15. 19 12月, 2012 1 次提交
  16. 31 10月, 2012 1 次提交
  17. 16 8月, 2012 1 次提交
    • A
      pseries: Rework irq assignment to avoid carrying qemu_irqs around · a307d594
      Alexey Kardashevskiy 提交于
      Currently, the interfaces in the pseries machine code for assignment
      and setup of interrupts pass around qemu_irq objects.  That was done
      in an attempt not to be too closely linked to the specific XICS
      interrupt controller.  However interactions with the device tree setup
      made that attempt rather futile, and XICS is part of the PAPR spec
      anyway, so this really just meant we had to carry both the qemu_irq
      pointers and the XICS irq numbers around.
      
      This mess will just get worse when we add upcoming PCI MSI support,
      since that will require tracking a bunch more interrupt.  Therefore,
      this patch reworks the spapr code to just use XICS irq numbers
      (roughly equivalent to GSIs on x86) and only retrieve the qemu_irq
      pointers from the XICS code when we need them (a trivial lookup).
      
      This is a reworked and generalized version of an earlier spapr_pci
      specific patch from Alexey Kardashevskiy.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      [agraf: fix checkpath warning]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a307d594
  18. 28 6月, 2012 1 次提交
  19. 18 6月, 2012 1 次提交
  20. 02 5月, 2012 1 次提交
    • D
      pseries: Implement automatic PAPR VIO address allocation · d601fac4
      David Gibson 提交于
      PAPR virtual IO (VIO) devices require a unique, but otherwise arbitrary,
      "address" used as a token to the hypercalls which manipulate them.
      
      Currently the pseries machine code does an ok job of allocating these
      addresses when the legacy -net nic / -serial and so forth options are used
      but will fail to allocate them properly when using -device.
      
      Specifically, you can use -device if all addresses are explicitly assigned.
      Without explicit assignment, only one VIO device of each type (network,
      console, SCSI) will be assigned properly, any further ones will attempt
      to take the same address leading to a fatal error.
      
      This patch fixes the situation by adding a proper address allocator to the
      VIO "bus" code.  This is used both by -device and the legacy options and
      default devices.  Addresses can still be explicitly assigned with -device
      options if desired.
      
      This patch changes the (guest visible) numbering of VIO devices, but since
      their addresses are discovered using the device tree and already differ
      from the numbering found on existing PowerVM systems, this does not break
      compatibility.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d601fac4
  21. 15 4月, 2012 1 次提交
    • D
      pseries: Consolidate hack for RTAS display-character usage · 5f2e2ba2
      David Gibson 提交于
      Currently the pseries machine contains not one but two somewhat ugly hacks
      to allow printing of early debug messages before the guest has properly
      read the device tree.
      
      First, we special case H_PUT_TERM_CHAR so that a vtermno of 0 (usually
      invalid) will look for a suitable vty and use that.  This supports Linux's
      early debug code which will use H_PUT_TERM_CHAR with vtermno==0 before
      reading the device tree.  Second, we support the RTAS display-character call.
      This takes no vtermno so we assume the address of the default first VTY.
      
      This patch makes things more consistent by folding the second hack into the
      first.  Now, display-character uses the existing vty_lookup() function to
      do the same search for a suitable VTY.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      5f2e2ba2
  22. 15 3月, 2012 1 次提交
  23. 15 2月, 2012 1 次提交
  24. 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
  25. 28 1月, 2012 3 次提交
  26. 03 1月, 2012 3 次提交
  27. 18 11月, 2011 3 次提交
  28. 06 10月, 2011 2 次提交
    • P
      spapr: prepare for qdevification of irq · 77c7ea5e
      Paolo Bonzini 提交于
      Restructure common properties for sPAPR devices so that IRQ definitions
      can be added in one place.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      77c7ea5e
    • P
      spapr: proper qdevification · 277f9acf
      Paolo Bonzini 提交于
      Right now the spapr devices cannot be instantiated with -device,
      because the IRQs need to be passed to the spapr_*_create functions.
      Do this instead in the bus's init wrapper.
      
      This is particularly important with the conversion from scsi-disk
      to scsi-{cd,hd} that Markus made.  After his patches, if you
      specify a scsi-cd device attached to an if=none drive, the default
      VSCSI controller will not be created and, without qdevification,
      you will not be able to add yours.
      
      NOTE from agraf: added small compile fix
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      277f9acf
  29. 22 8月, 2011 1 次提交