1. 08 8月, 2016 1 次提交
  2. 22 6月, 2016 2 次提交
  3. 23 3月, 2016 2 次提交
    • V
      util: move declarations out of qemu-common.h · f348b6d1
      Veronia Bahaa 提交于
      Move declarations out of qemu-common.h for functions declared in
      utils/ files: e.g. include/qemu/path.h for utils/path.c.
      Move inline functions out of qemu-common.h and into new files (e.g.
      include/qemu/bcd.h)
      Signed-off-by: NVeronia Bahaa <veroniabahaa@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f348b6d1
    • 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
  4. 29 1月, 2016 1 次提交
    • P
      usb: Clean up includes · e532b2e0
      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-20-git-send-email-peter.maydell@linaro.org
      e532b2e0
  5. 13 1月, 2016 2 次提交
    • M
      error: Use error_prepend() where it makes obvious sense · e43bfd9c
      Markus Armbruster 提交于
      Done with this Coccinelle semantic patch
      
          @@
          expression FMT, E1, E2;
          expression list ARGS;
          @@
          -    error_setg(E1, FMT, ARGS, error_get_pretty(E2));
          +    error_propagate(E1, E2);/*###*/
          +    error_prepend(E1, FMT/*@@@*/, ARGS);
      
      followed by manual cleanup, first because I can't figure out how to
      make Coccinelle transform strings, and second to get rid of now
      superfluous error_propagate().
      
      We now use or propagate the original error whole instead of just its
      message obtained with error_get_pretty().  This avoids suppressing its
      hint (see commit 50b7b000), but I can't see how the errors touched in
      this commit could come with hints.  It also improves the message
      printed with &error_abort when we screw up (see commit 1e9b65bb).
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      e43bfd9c
    • M
      error: Use error_reportf_err() where it makes obvious sense · c29b77f9
      Markus Armbruster 提交于
      Done with this Coccinelle semantic patch
      
          @@
          expression FMT, E, S;
          expression list ARGS;
          @@
          -    error_report(FMT, ARGS, error_get_pretty(E));
          +    error_reportf_err(E, FMT/*@@@*/, ARGS);
          (
          -    error_free(E);
          |
      	 exit(S);
          |
      	 abort();
          )
      
      followed by a replace of '%s"/*@@@*/' by '"' and some line rewrapping,
      because I can't figure out how to make Coccinelle transform strings.
      
      We now use the error whole instead of just its message obtained with
      error_get_pretty().  This avoids suppressing its hint (see commit
      50b7b000), but I can't see how the errors touched in this commit could
      come with hints.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1450452927-8346-12-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      c29b77f9
  6. 20 10月, 2015 1 次提交
  7. 23 6月, 2015 1 次提交
  8. 17 3月, 2015 2 次提交
  9. 18 2月, 2015 6 次提交
    • M
      hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() · 1ce6be24
      Markus Armbruster 提交于
      Some are called do_info_SUBCOMMAND() (old ones, usually), some
      hmp_info_SUBCOMMAND(), some SUBCOMMAND_info(), sometimes SUBCOMMAND
      pointlessly differs in spelling.
      
      Normalize to hmp_info_SUBCOMMAND(), where SUBCOMMAND is exactly the
      subcommand name with '-' replaced by '_'.
      
      Exceptions:
      
      * sun4m_irq_info(), sun4m_pic_info() renamed to sun4m_hmp_info_irq(),
        sun4m_hmp_info_pic().
      
      * lm32_irq_info(), lm32_pic_info() renamed to lm32_hmp_info_irq(),
        lm32_hmp_info_pic().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      1ce6be24
    • M
      usb: Change usb_create_simple() to abort on failure · 599655c9
      Markus Armbruster 提交于
      Instead of returning null pointer.  Matches pci_create_simple(),
      isa_create_simple(), sysbus_create_simple().  It's unused since the
      previous commit, but I'll put it to use again shortly.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      599655c9
    • M
      usb: Suppress bogus error when automatic usb-hub creation fails · bd8b92d5
      Markus Armbruster 提交于
      USBDevice's realize method usb_qdev_realize() automatically creates a
      usb-hub when only one port is left.  Creating devices in realize
      methods is questionable, but works.
      
      If usb-hub creation fails, an error is reported to stderr, but the
      failure is otherwise ignored.  We then create the actual device using
      the last port, which may well succeed.
      
      Example:
      
          $ qemu -nodefaults -S -display none -machine usb=on -monitor stdio
          QEMU 2.2.50 monitor - type 'help' for more information
          (qemu) device_add usb-mouse
          [Repeat 36 times]
          (qemu) info usb
            Device 0.0, Port 1, Speed 12 Mb/s, Product QEMU USB Mouse
            Device 0.0, Port 2, Speed 12 Mb/s, Product QEMU USB Hub
            Device 0.0, Port 2.1, Speed 12 Mb/s, Product QEMU USB Mouse
          [More mice and hubs omitted...]
            Device 0.0, Port 2.8.8.8.8.7, Speed 12 Mb/s, Product QEMU USB Mouse
          (qemu) device_add usb-mouse
          usb hub chain too deep
          Failed to initialize USB device 'usb-hub'
          (qemu) info usb
          [...]
            Device 0.0, Port 2.8.8.8.8.7, Speed 12 Mb/s, Product QEMU USB Mouse
            Device 0.0, Port 2.8.8.8.8.8, Speed 12 Mb/s, Product QEMU USB Mouse
      
      Despite the "Failed" message, the command actually succeeded.
      
      In QMP, it's worse.  When adding the 37th mouse via QMP, the command
      fails with
      
          {"error": {"class": "GenericError", "desc": "usb hub chain too deep"}}
      
      Additionally, "Failed to initialize USB device 'usb-hub'" is reported
      on stderr.  Despite the command failure, the device was created.  This
      is wrong.
      
      Fix by avoiding qdev_init() for usb-hub creation, so we can ignore
      errors cleanly.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      bd8b92d5
    • M
      usb: Do not prefix error_setg() messages with "Error: " · 06f22eb7
      Markus Armbruster 提交于
      Because it produces beauties like
      
          (qemu) usb_add mouse
          Failed to initialize USB device 'usb-mouse': Error: tried to attach usb device QEMU USB Mouse to a bus with no free ports
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      06f22eb7
    • M
      usb: Improve -usbdevice error reporting a bit · 3bc36a40
      Markus Armbruster 提交于
      Most LegacyUSBFactory usbdevice_init() methods realize with
      qdev_init_nofail(), even though their caller usbdevice_create() can
      handle failure.  Okay if it really can't fail (I didn't check), but
      somewhat brittle.
      
      usb_msd_init() and usb_bt_init() call qdev_init().  The latter
      additionally reports an error when qdev_init() fails.
      
      Realization failure produces multiple error reports: a specific one
      from qdev_init(), and generic ones from usb_bt_init(),
      usb_create_simple(), usbdevice_create() and usb_parse().
      
      Remove realization from the usbdevice_init() methods.  Realize in
      usbdevice_create(), and produce exactly one error message there.  You
      still get another one from usb_parse().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3bc36a40
    • M
  10. 15 10月, 2014 1 次提交
  11. 23 9月, 2014 3 次提交
  12. 29 8月, 2014 2 次提交
  13. 14 5月, 2014 2 次提交
  14. 06 5月, 2014 1 次提交
  15. 16 1月, 2014 1 次提交
    • G
      usb: add support for microsoft os descriptors · 5319dc7b
      Gerd Hoffmann 提交于
      This patch adds support for special usb descriptors used by microsoft
      windows.  They allow more fine-grained control over driver binding and
      adding entries to the registry for configuration.
      
      As this is a guest-visible change the "msos-desc" compat property
      has been added to turn this off for 1.7 + older
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      5319dc7b
  16. 26 11月, 2013 1 次提交
  17. 06 11月, 2013 1 次提交
  18. 10 9月, 2013 1 次提交
  19. 31 8月, 2013 2 次提交
  20. 24 6月, 2013 1 次提交
  21. 23 4月, 2013 1 次提交
  22. 03 4月, 2013 1 次提交
  23. 17 1月, 2013 1 次提交
  24. 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
  25. 07 1月, 2013 1 次提交
    • H
      usb: Add an usb_device_ep_stopped USBDevice method · f79738b0
      Hans de Goede 提交于
      Some usb devices (host or network redirection) can benefit from knowing when
      the guest stops using an endpoint. Redirection may involve submitting packets
      independently from the guest (in combination with a fifo buffer between the
      redirection code and the guest), to ensure that buffers of the real usb device
      are timely emptied. This is done for example for isoc traffic and for interrupt
      input endpoints. But when the (re)submission of packets is done by the device
      code, then how does it know when to stop this?
      
      For isoc endpoints this is handled by detecting a set interface (change alt
      setting) command, which works well for isoc endpoints. But for interrupt
      endpoints currently the redirection code never stops receiving data from
      the device, which is less then ideal.
      
      However the controller emulation is aware when a guest looses interest, as
      then the qh for the endpoint gets unlinked (ehci, ohci, uhci) or the endpoint
      is explicitly stopped (xhci). This patch adds a new ep_stopped USBDevice
      method and modifies the hcd code to call this on queue unlink / ep stop.
      
      This makes it possible for the redirection code to properly stop receiving
      interrupt input (*) data when the guest no longer has interest in it.
      
      *) And in the future also buffered bulk input.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      f79738b0
  26. 19 12月, 2012 1 次提交