1. 23 9月, 2015 16 次提交
  2. 22 9月, 2015 7 次提交
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-09-22' into staging · 482d7c08
      Peter Maydell 提交于
      Monitor patches
      
      # gpg: Signature made Tue 22 Sep 2015 10:33:34 BST using RSA key ID EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      
      * remotes/armbru/tags/pull-monitor-2015-09-22:
        hmp: Restore "info pci"
        monitor: allow device_del to accept QOM paths
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      482d7c08
    • P
      hmp: Restore "info pci" · abadcbc8
      Paolo Bonzini 提交于
      Dropped by commit da76ee76's
      transition to hmp-commands-info.hx.
      Reported-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1442589509-10806-1-git-send-email-pbonzini@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      abadcbc8
    • D
      monitor: allow device_del to accept QOM paths · 6287d827
      Daniel P. Berrange 提交于
      Currently device_del requires that the client provide the
      device short ID. device_add allows devices to be created
      without giving an ID, at which point there is no way to
      delete them with device_del. The QOM object path, however,
      provides an alternative way to identify the devices.
      
      Allowing device_del to accept an object path ensures all
      devices are deletable regardless of whether they have an
      ID.
      
       (qemu) device_add usb-mouse
       (qemu) qom-list /machine/peripheral-anon
       device[0] (child<usb-mouse>)
       type (string)
       (qemu) device_del /machine/peripheral-anon/device[0]
      
      Devices are required to be marked as hotpluggable
      otherwise an error is raised
      
       (qemu) device_del /machine/unattached/device[4]
       Device 'PIIX3' does not support hotplugging
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1441974836-17476-1-git-send-email-berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Commit message touched up, accidental white-space change dropped]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      6287d827
    • P
      Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150921-1' into staging · 6138fbde
      Peter Maydell 提交于
      spice: surface switch fast path requires same format too.
      
      # gpg: Signature made Mon 21 Sep 2015 10:05:54 BST using RSA key ID D3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      
      * remotes/spice/tags/pull-spice-20150921-1:
        spice: surface switch fast path requires same format too.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6138fbde
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-09-21' into staging · 9e72681d
      Peter Maydell 提交于
      qapi: QMP introspection
      
      # gpg: Signature made Mon 21 Sep 2015 08:59:17 BST using RSA key ID EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      
      * remotes/armbru/tags/pull-qapi-2015-09-21: (26 commits)
        qapi-introspect: Hide type names
        qapi: New QMP command query-qmp-schema for QMP introspection
        qapi: Pseudo-type '**' is now unused, drop it
        qapi-schema: Fix up misleading specification of netdev_add
        qom: Don't use 'gen': false for qom-get, qom-set, object-add
        qapi: Introduce a first class 'any' type
        qapi: Make output visitor return qnull() instead of NULL
        qapi: Improve built-in type documentation
        qapi-commands: De-duplicate output marshaling functions
        qapi: De-duplicate parameter list generation
        qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO()
        qapi-commands: Rearrange code
        qapi-visit: Rearrange code a bit
        qapi: Clean up after recent conversions to QAPISchemaVisitor
        qapi: Replace dirty is_c_ptr() by method c_null()
        qapi-event: Convert to QAPISchemaVisitor, fixing data with base
        qapi-event: Eliminate global variable event_enum_value
        qapi: De-duplicate enum code generation
        qapi-commands: Convert to QAPISchemaVisitor
        qapi-visit: Convert to QAPISchemaVisitor, fixing bugs
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9e72681d
    • P
      Merge remote-tracking branch 'remotes/aurel/tags/pull-tcg-mips-20150921' into staging · 75ebcd7f
      Peter Maydell 提交于
      TCG MIPS queue
      
      - Fixes for 64-bit guests
      - Small cleanups
      
      # gpg: Signature made Sun 20 Sep 2015 23:33:15 BST using RSA key ID 1DDD8C9B
      # gpg: Good signature from "Aurelien Jarno <aurelien@aurel32.net>"
      # gpg:                 aka "Aurelien Jarno <aurelien@jarno.fr>"
      # gpg:                 aka "Aurelien Jarno <aurel32@debian.org>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 7746 2642 A9EF 94FD 0F77  196D BA9C 7806 1DDD 8C9B
      
      * remotes/aurel/tags/pull-tcg-mips-20150921:
        tcg/mips: pass oi to tcg_out_tlb_load
        tcg/mips: move tcg_out_addsub2
        tcg/mips: Fix clobbering of qemu_ld inputs
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      75ebcd7f
    • P
      Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging · d345e0d7
      Peter Maydell 提交于
      Patch queue for ppc - 2015-09-20
      
      Highlights this time around:
      
        - e500: Fix u-boot boot with -M virt by updating to new version
        - e500: fix ATMU reads
        - book3s: Fixes (unaligned exceptions, vector instructions)
        - yet another dbdma ide fix
      
      I'm out taking care of my son for the next 2 months. During that time
      please consider David Gibson the interim ppc queue maintainer. I'm sure
      Aurelien will be more than happy to help him review patches as well ;-).
      
      # gpg: Signature made Sun 20 Sep 2015 21:51:16 BST using RSA key ID 03FEDC60
      # gpg: Good signature from "Alexander Graf <agraf@suse.de>"
      # gpg:                 aka "Alexander Graf <alex@csgraf.de>"
      
      * remotes/agraf/tags/signed-ppc-for-upstream:
        target-ppc: fix xscmpodp and xscmpudp decoding
        target-ppc: fix vcipher, vcipherlast, vncipherlast and vpermxor
        PPC: E500: Update u-boot to commit 79c884d7e4
        target-ppc: Fix SRR0 when taking unaligned exceptions
        PPC: e500 pci host: Fix ATMUs register reads
        mac_dbdma: always clear FLUSH bit once DBDMA channel flush is complete
        kvm_ppc: remove kvmppc_timer_hack
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d345e0d7
  3. 21 9月, 2015 17 次提交
    • M
      qapi-introspect: Hide type names · 1a9a507b
      Markus Armbruster 提交于
      To eliminate the temptation for clients to look up types by name
      (which are not ABI), replace all type names by meaningless strings.
      
      Reduces output of query-schema by 13 out of 85KiB.
      
      As a debugging aid, provide option -u to suppress the hiding.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1442401589-24189-27-git-send-email-armbru@redhat.com>
      1a9a507b
    • M
      qapi: New QMP command query-qmp-schema for QMP introspection · 39a18158
      Markus Armbruster 提交于
      qapi/introspect.json defines the introspection schema.  It's designed
      for QMP introspection, but should do for similar uses, such as QGA.
      
      The introspection schema does not reflect all the rules and
      restrictions that apply to QAPI schemata.  A valid QAPI schema has an
      introspection value conforming to the introspection schema, but the
      converse is not true.
      
      Introspection lowers away a number of schema details, and makes
      implicit things explicit:
      
      * The built-in types are declared with their JSON type.
      
        All integer types are mapped to 'int', because how many bits we use
        internally is an implementation detail.  It could be pressed into
        external interface service as very approximate range information,
        but that's a bad idea.  If we need range information, we better do
        it properly.
      
      * Implicit type definitions are made explicit, and given
        auto-generated names:
      
        - Array types, named by appending "List" to the name of their
          element type, like in generated C.
      
        - The enumeration types implicitly defined by simple union types,
          named by appending "Kind" to the name of their simple union type,
          like in generated C.
      
        - Types that don't occur in generated C.  Their names start with ':'
          so they don't clash with the user's names.
      
      * All type references are by name.
      
      * The struct and union types are generalized into an object type.
      
      * Base types are flattened.
      
      * Commands take a single argument and return a single result.
      
        Dictionary argument or list result is an implicit type definition.
      
        The empty object type is used when a command takes no arguments or
        produces no results.
      
        The argument is always of object type, but the introspection schema
        doesn't reflect that.
      
        The 'gen': false directive is omitted as implementation detail.
      
        The 'success-response' directive is omitted as well for now, even
        though it's not an implementation detail, because it's not used by
        QMP.
      
      * Events carry a single data value.
      
        Implicit type definition and empty object type use, just like for
        commands.
      
        The value is of object type, but the introspection schema doesn't
        reflect that.
      
      * Types not used by commands or events are omitted.
      
        Indirect use counts as use.
      
      * Optional members have a default, which can only be null right now
      
        Instead of a mandatory "optional" flag, we have an optional default.
        No default means mandatory, default null means optional without
        default value.  Non-null is available for optional with default
        (possible future extension).
      
      * Clients should *not* look up types by name, because type names are
        not ABI.  Look up the command or event you're interested in, then
        follow the references.
      
        TODO Should we hide the type names to eliminate the temptation?
      
      New generator scripts/qapi-introspect.py computes an introspection
      value for its input, and generates a C variable holding it.
      
      It can generate awfully long lines.  Marked TODO.
      
      A new test-qmp-input-visitor test case feeds its result for both
      tests/qapi-schema/qapi-schema-test.json and qapi-schema.json to a
      QmpInputVisitor to verify it actually conforms to the schema.
      
      New QMP command query-qmp-schema takes its return value from that
      variable.  Its reply is some 85KiBytes for me right now.
      
      If this turns out to be too much, we have a couple of options:
      
      * We can use shorter names in the JSON.  Not the QMP style.
      
      * Optionally return the sub-schema for commands and events given as
        arguments.
      
        Right now qmp_query_schema() sends the string literal computed by
        qmp-introspect.py.  To compute sub-schema at run time, we'd have to
        duplicate parts of qapi-introspect.py in C.  Unattractive.
      
      * Let clients cache the output of query-qmp-schema.
      
        It changes only on QEMU upgrades, i.e. rarely.  Provide a command
        query-qmp-schema-hash.  Clients can have a cache indexed by hash,
        and re-query the schema only when they don't have it cached.  Even
        simpler: put the hash in the QMP greeting.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      39a18158
    • M
      qapi: Pseudo-type '**' is now unused, drop it · 2d21291a
      Markus Armbruster 提交于
      'gen': false needs to stay for now, because netdev_add is still using
      it.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-25-git-send-email-armbru@redhat.com>
      2d21291a
    • M
      qapi-schema: Fix up misleading specification of netdev_add · b8a98326
      Markus Armbruster 提交于
      It doesn't take a 'props' argument, let alone one in the format
      "NAME=VALUE,..."
      
      The bogus arguments specification doesn't matter due to 'gen': false.
      Clean it up to be incomplete rather than wrong, and document the
      incompleteness.
      
      While there, improve netdev_add usage example in the manual: add a
      device option to show how it's done.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-24-git-send-email-armbru@redhat.com>
      b8a98326
    • M
      qom: Don't use 'gen': false for qom-get, qom-set, object-add · 6eb3937e
      Markus Armbruster 提交于
      With the previous commit, the generated marshalers just work, and save
      us a bit of handwritten code.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-23-git-send-email-armbru@redhat.com>
      6eb3937e
    • M
      qapi: Introduce a first class 'any' type · 28770e05
      Markus Armbruster 提交于
      It's first class, because unlike '**', it actually works, i.e. doesn't
      require 'gen': false.
      
      '**' will go away next.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      28770e05
    • M
      qapi: Make output visitor return qnull() instead of NULL · 6c2f9a15
      Markus Armbruster 提交于
      Before commit 1d10b445, it crashed.  Since then, it returns NULL, with
      a FIXME comment.  The FIXME is valid: code that assumes QObject *
      can't be null exists.  I'm not aware of a way to feed this problematic
      return value to code that actually chokes on null in the current code,
      but the next few commits will create one, failing "make check".
      
      Commit 481b002c solved a very similar problem by introducing a special
      null QObject.  Using this special null QObject is clearly the right
      way to resolve this FIXME, so do that, and update the test
      accordingly.
      
      However, the patch isn't quite right: it messes up the reference
      counting.  After about SIZE_MAX visits, the reference counter
      overflows, failing the assertion in qnull_destroy_obj().  Because
      that's many orders of magnitude more visits of nulls than we expect,
      we take this patch despite its flaws, to get the QMP introspection
      stuff in without further delay.  We'll want to fix it for real before
      the release.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-21-git-send-email-armbru@redhat.com>
      6c2f9a15
    • M
      qapi: Improve built-in type documentation · f133f2db
      Markus Armbruster 提交于
      Clarify how they map to JSON.  Add how they map to C.  Fix the
      reference to StringInputVisitor.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-20-git-send-email-armbru@redhat.com>
      f133f2db
    • M
      qapi-commands: De-duplicate output marshaling functions · 56d92b00
      Markus Armbruster 提交于
      gen_marshal_output() uses its parameter name only for name of the
      generated function.  Name it after the type being marshaled instead of
      its caller, and drop duplicates.
      
      Saves 7 copies of qmp_marshal_output_int() in qemu-ga, and one copy of
      qmp_marshal_output_str() in qemu-system-*.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-19-git-send-email-armbru@redhat.com>
      56d92b00
    • M
      qapi: De-duplicate parameter list generation · 03b4367a
      Markus Armbruster 提交于
      Generated qapi-event.[ch] lose line breaks.  No change otherwise.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-18-git-send-email-armbru@redhat.com>
      03b4367a
    • M
      qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO() · 7fad30f0
      Markus Armbruster 提交于
      These functions marshal both input and output.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-17-git-send-email-armbru@redhat.com>
      7fad30f0
    • M
      qapi-commands: Rearrange code · f1538019
      Markus Armbruster 提交于
      Rename gen_marshal_input() to gen_marshal(), because the generated
      function marshals both arguments and results.
      
      Rename gen_visitor_input_containers_decl() to gen_marshal_vars(), and
      move the other variable declarations there, too.
      
      Rename gen_visitor_input_block() to gen_marshal_input_visit(), and
      rearrange its code slightly.
      
      Rename gen_marshal_input_decl() to gen_marshal_proto(), because the
      result isn't a full declaration, unlike gen_command_decl()'s.
      
      New gen_marshal_decl() actually returns a full declaration.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-16-git-send-email-armbru@redhat.com>
      f1538019
    • M
      qapi-visit: Rearrange code a bit · 60f8546a
      Markus Armbruster 提交于
      Move gen_visit_decl() to a better place.  Inline
      generate_visit_struct_body().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-15-git-send-email-armbru@redhat.com>
      60f8546a
    • M
      qapi: Clean up after recent conversions to QAPISchemaVisitor · e98859a9
      Markus Armbruster 提交于
      Generate just 'FOO' instead of 'struct FOO' when possible.
      
      Drop helper functions that are now unused.
      
      Make pep8 and pylint reasonably happy.
      
      Rename generate_FOO() functions to gen_FOO() for consistency.
      
      Use more consistent and sensible variable names.
      
      Consistently use c_ for mapping keys when their value is a C
      identifier or type.
      
      Simplify gen_enum() and gen_visit_union()
      
      Consistently use single quotes for C text string literals.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1442401589-24189-14-git-send-email-armbru@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      e98859a9
    • M
      qapi: Replace dirty is_c_ptr() by method c_null() · 5710153e
      Markus Armbruster 提交于
      is_c_ptr() looks whether the end of the C text for the type looks like
      a pointer.  Works, but is fragile.
      
      We now have a better tool: use QAPISchemaType method c_null().  The
      initializers for non-pointers become prettier: 0, false or the
      enumeration constant with the value 0 instead of {0}.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-13-git-send-email-armbru@redhat.com>
      5710153e
    • M
      qapi-event: Convert to QAPISchemaVisitor, fixing data with base · 05f43a96
      Markus Armbruster 提交于
      Fixes events whose data is struct with base to include the struct's
      base members.  Test case is qapi-schema-test.json's event
      __org.qemu_x-command:
      
          { 'event': '__ORG.QEMU_X-EVENT', 'data': '__org.qemu_x-Struct' }
      
          { 'struct': '__org.qemu_x-Struct', 'base': '__org.qemu_x-Base',
            'data': { '__org.qemu_x-member2': 'str' } }
      
          { 'struct': '__org.qemu_x-Base',
            'data': { '__org.qemu_x-member1': '__org.qemu_x-Enum' } }
      
      Patch's effect on generated qapi_event_send___org_qemu_x_event():
      
          -void qapi_event_send___org_qemu_x_event(const char *__org_qemu_x_member2,
          +void qapi_event_send___org_qemu_x_event(__org_qemu_x_Enum __org_qemu_x_member1,
          +                                        const char *__org_qemu_x_member2,
                                                   Error **errp)
           {
               QDict *qmp;
          @@ -224,6 +225,10 @@ void qapi_event_send___org_qemu_x_event(
                   goto clean;
               }
      
          +    visit_type___org_qemu_x_Enum(v, &__org_qemu_x_member1, "__org.qemu_x-member1", &local_err);
          +    if (local_err) {
          +        goto clean;
          +    }
               visit_type_str(v, (char **)&__org_qemu_x_member2, "__org.qemu_x-member2", &local_err);
               if (local_err) {
                   goto clean;
      
      Code is generated in a different order now, but that doesn't matter.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      05f43a96
    • M
      qapi-event: Eliminate global variable event_enum_value · 7b24626c
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1442401589-24189-11-git-send-email-armbru@redhat.com>
      7b24626c