1. 18 7月, 2017 2 次提交
  2. 14 7月, 2017 3 次提交
  3. 13 7月, 2017 2 次提交
  4. 28 6月, 2017 2 次提交
  5. 20 6月, 2017 2 次提交
  6. 19 6月, 2017 1 次提交
  7. 02 6月, 2017 1 次提交
  8. 21 4月, 2017 1 次提交
  9. 25 1月, 2017 1 次提交
  10. 16 11月, 2016 1 次提交
  11. 27 7月, 2016 1 次提交
  12. 13 7月, 2016 1 次提交
  13. 08 7月, 2016 2 次提交
  14. 17 6月, 2016 1 次提交
    • E
      qdev: Use GList for global properties · f9a8b553
      Eduardo Habkost 提交于
      If the same GlobalProperty struct is registered twice, the list
      entry gets corrupted, making tqe_next points to itself, and
      qdev_prop_set_globals() gets stuck in a loop. The bug can be
      easily reproduced by running:
      
        $ qemu-system-x86_64 -rtc-td-hack -rtc-td-hack
      
      Change global_props to use GList instead of queue.h, making the
      code simpler and able to deal with properties being registered
      twice.
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      f9a8b553
  15. 23 3月, 2016 2 次提交
    • M
      hw/pci/pci.h: Don't include qemu-common.h · a7c4d9c7
      Markus Armbruster 提交于
      qemu-common.h should only be included by .c files.  Its file comment
      explains why: "No header file should depend on qemu-common.h, as this
      would easily lead to circular header dependencies."
      
      hw/pci/pci.h includes qemu-common.h, but its users only need pcibus_t
      and PCIHostDeviceAddress from it.  Move them to hw/pci/pci.h and drop
      the ill-advised include.  Include hw/pci/pci.h where the moved stuff
      is now missing.  Except we can't in target-i386/kvm_i386.h, because
      that would break the i386-linux-user compile.  Add
      PCIHostDeviceAddress to qemu/typedefs.h instead.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a7c4d9c7
    • 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
  16. 22 3月, 2016 1 次提交
  17. 09 2月, 2016 3 次提交
    • E
      qapi: Drop unused 'kind' for struct/enum visit · 337283df
      Eric Blake 提交于
      visit_start_struct() and visit_type_enum() had a 'kind' argument
      that was usually set to either the stringized version of the
      corresponding qapi type name, or to NULL (although some clients
      didn't even get that right).  But nothing ever used the argument.
      It's even hard to argue that it would be useful in a debugger,
      as a stack backtrace also tells which type is being visited.
      
      Therefore, drop the 'kind' argument as dead.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-22-git-send-email-eblake@redhat.com>
      [Harmless rebase mistake cleaned up]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      337283df
    • E
      qom: Swap 'name' next to visitor in ObjectPropertyAccessor · d7bce999
      Eric Blake 提交于
      Similar to the previous patch, it's nice to have all functions
      in the tree that involve a visitor and a name for conversion to
      or from QAPI to consistently stick the 'name' parameter next
      to the Visitor parameter.
      
      Done by manually changing include/qom/object.h and qom/object.c,
      then running this Coccinelle script and touching up the fallout
      (Coccinelle insisted on adding some trailing whitespace).
      
          @ rule1 @
          identifier fn;
          typedef Object, Visitor, Error;
          identifier obj, v, opaque, name, errp;
          @@
           void fn
          - (Object *obj, Visitor *v, void *opaque, const char *name,
          + (Object *obj, Visitor *v, const char *name, void *opaque,
             Error **errp) { ... }
      
          @@
          identifier rule1.fn;
          expression obj, v, opaque, name, errp;
          @@
           fn(obj, v,
          -   opaque, name,
          +   name, opaque,
              errp)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d7bce999
    • E
      qapi: Swap visit_* arguments for consistent 'name' placement · 51e72bc1
      Eric Blake 提交于
      JSON uses "name":value, but many of our visitor interfaces were
      called with visit_type_FOO(v, &value, name, errp).  This can be
      a bit confusing to have to mentally swap the parameter order to
      match JSON order.  It's particularly bad for visit_start_struct(),
      where the 'name' parameter is smack in the middle of the
      otherwise-related group of 'obj, kind, size' parameters! It's
      time to do a global swap of the parameter ordering, so that the
      'name' parameter is always immediately after the Visitor argument.
      
      Additional reason in favor of the swap: the existing include/qjson.h
      prefers listing 'name' first in json_prop_*(), and I have plans to
      unify that file with the qapi visitors; listing 'name' first in
      qapi will minimize churn to the (admittedly few) qjson.h clients.
      
      Later patches will then fix docs, object.h, visitor-impl.h, and
      those clients to match.
      
      Done by first patching scripts/qapi*.py by hand to make generated
      files do what I want, then by running the following Coccinelle
      script to affect the rest of the code base:
       $ spatch --sp-file script `git grep -l '\bvisit_' -- '**/*.[ch]'`
      I then had to apply some touchups (Coccinelle insisted on TAB
      indentation in visitor.h, and botched the signature of
      visit_type_enum() by rewriting 'const char *const strings[]' to
      the syntactically invalid 'const char*const[] strings').  The
      movement of parameters is sufficient to provoke compiler errors
      if any callers were missed.
      
          // Part 1: Swap declaration order
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_start_struct
          -(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type bool, TV, T1;
          identifier ARG1;
          @@
           bool visit_optional
          -(TV v, T1 ARG1, const char *name)
          +(TV v, const char *name, T1 ARG1)
           { ... }
      
          @@
          type TV, TErr, TObj, T1;
          identifier OBJ, ARG1;
          @@
           void visit_get_next_type
          -(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_type_enum
          -(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj;
          identifier OBJ;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
           void VISIT_TYPE
          -(TV v, TObj OBJ, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, TErr errp)
           { ... }
      
          // Part 2: swap caller order
          @@
          expression V, NAME, OBJ, ARG1, ARG2, ERR;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
          (
          -visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR)
          +visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -visit_optional(V, ARG1, NAME)
          +visit_optional(V, NAME, ARG1)
          |
          -visit_get_next_type(V, OBJ, ARG1, NAME, ERR)
          +visit_get_next_type(V, NAME, OBJ, ARG1, ERR)
          |
          -visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR)
          +visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -VISIT_TYPE(V, OBJ, NAME, ERR)
          +VISIT_TYPE(V, NAME, OBJ, ERR)
          )
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-19-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      51e72bc1
  18. 29 1月, 2016 1 次提交
  19. 26 1月, 2016 1 次提交
    • J
      fdc: Add fallback option · a73275dd
      John Snow 提交于
      Currently, QEMU chooses a drive type automatically based on the inserted
      media. If there is no disk inserted, it chooses a 1.44MB drive type.
      
      Change this behavior to be configurable, but leave it defaulted to 1.44.
      
      This is not earnestly intended to be used by a user or a management
      library, but rather exists so that pre-2.6 board types can configure it
      to be a legacy value.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-8-git-send-email-jsnow@redhat.com
      a73275dd
  20. 13 1月, 2016 2 次提交
  21. 11 9月, 2015 1 次提交
  22. 13 7月, 2015 1 次提交
  23. 23 6月, 2015 3 次提交
  24. 01 6月, 2015 1 次提交
  25. 10 3月, 2015 1 次提交
  26. 26 2月, 2015 1 次提交
    • M
      qdev: Don't exit when running into bad -global · 25f8dd96
      Markus Armbruster 提交于
      -global lets you set a nice booby-trap for yourself:
      
          $ qemu-system-x86_64 -nodefaults -S -display none -usb -monitor stdio -global usb-mouse.usb_version=l
          QEMU 2.1.94 monitor - type 'help' for more information
          (qemu) device_add usb-mouse
          Parameter 'usb_version' expects an int64 value or range
          $ echo $?
          1
      
      Not nice.  Until commit 31962700 we even abort()ed.
      
      The same error triggers if you manage to screw up a machine type's
      compat_props.  To demonstrate, change HW_COMPAT_2_1's entry to
      
                  .driver   = "usb-mouse",\
                  .property = "usb_version",\
                  .value    = "1", \
      
      Then run
      
          $ qemu-system-x86_64 -usb -M pc-i440fx-2.1 -device usb-mouse
          upstream-qemu: -device usb-mouse: Parameter 'usb_version' expects an int64 value or range
          $ echo $?
          1
      
      One of our creatively cruel error messages.
      
      Since this is actually a coding error, we *should* abort() here.
      Replace the error by an assertion failure in this case.
      
      But turn the fatal error into a mere warning when the faulty
      GlobalProperty comes from the user.  Looks like this:
      
          $ qemu-system-x86_64 -nodefaults -S -display none -usb -monitor stdio -global usb-mouse.usb_version=l
          QEMU 2.1.94 monitor - type 'help' for more information
          (qemu) device_add usb-mouse
          Warning: global usb-mouse.usb_version=l ignored (Parameter 'usb_version' expects an int64 value or range)
          (qemu)
      
      This is consistent with how we handle similarly unusable -global in
      qdev_prop_check_globals().
      
      You could argue that the error should make device_add fail.  Would be
      harder, because we're running within TypeInfo's instance_post_init()
      method device_post_init(), which can't fail.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      
      25f8dd96
  27. 20 10月, 2014 1 次提交
    • M
      hw: Convert from BlockDriverState to BlockBackend, mostly · 4be74634
      Markus Armbruster 提交于
      Device models should access their block backends only through the
      block-backend.h API.  Convert them, and drop direct includes of
      inappropriate headers.
      
      Just four uses of BlockDriverState are left:
      
      * The Xen paravirtual block device backend (xen_disk.c) opens images
        itself when set up via xenbus, bypassing blockdev.c.  I figure it
        should go through qmp_blockdev_add() instead.
      
      * Device model "usb-storage" prompts for keys.  No other device model
        does, and this one probably shouldn't do it, either.
      
      * ide_issue_trim_cb() uses bdrv_aio_discard() instead of
        blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
        which has only the BlockDriverState.
      
      * PC87312State has an unused BlockDriverState[] member.
      
      The next two commits take care of the latter two.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be74634