1. 06 7月, 2016 5 次提交
    • E
      opts-visitor: Favor new visit_free() function · 09204eac
      Eric Blake 提交于
      Now that we have a polymorphic visit_free(), we no longer need
      opts_visitor_cleanup(); which in turn means we no longer need
      to return a subtype from opts_visitor_new() nor a public upcast
      function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-6-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      09204eac
    • E
      qapi: Add new visit_free() function · 2c0ef9f4
      Eric Blake 提交于
      Making each visitor provide its own (awkwardly-named) FOO_cleanup()
      is unusual, when we can instead have a polymorphic visit_free()
      interface.  Over the next few patches, we can use the polymorphic
      functions to eliminate the need for a FOO_get_visitor() function
      for accessing specific visitor functionality, once everything can
      be accessed directly through the Visitor* interfaces.
      
      The dealloc visitor is the first one converted to completely use
      the new entry point, since qapi_dealloc_visitor_cleanup() was the
      only reason that qapi_dealloc_get_visitor() existed, and only
      generated and testsuite code was even using it.  With the new
      visit_free() entry point in place, we no longer need to expose
      the QapiDeallocVisitor subtype through qapi_dealloc_visitor_new(),
      and can get by with less generated code, with diffs that look like:
      
      | void qapi_free_ACPIOSTInfo(ACPIOSTInfo *obj)
      | {
      |-    QapiDeallocVisitor *qdv;
      |     Visitor *v;
      |
      |     if (!obj) {
      |         return;
      |     }
      |
      |-    qdv = qapi_dealloc_visitor_new();
      |-    v = qapi_dealloc_get_visitor(qdv);
      |+    v = qapi_dealloc_visitor_new();
      |     visit_type_ACPIOSTInfo(v, NULL, &obj, NULL);
      |-    qapi_dealloc_visitor_cleanup(qdv);
      |+    visit_free(v);
      |}
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-5-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      2c0ef9f4
    • E
      qapi: Add parameter to visit_end_* · 1158bb2a
      Eric Blake 提交于
      Rather than making the dealloc visitor track of stack of pointers
      remembered during visit_start_* in order to free them during
      visit_end_*, it's a lot easier to just make all callers pass the
      same pointer to visit_end_*.  The generated code has access to the
      same pointer, while all other users are doing virtual walks and
      can pass NULL.  The dealloc visitor is then greatly simplified.
      
      All three visit_end_*() functions intentionally take a void**,
      even though the visit_start_*() functions differ between void**,
      GenericList**, and GenericAlternate**.  This is done for several
      reasons: when doing a virtual walk, passing NULL doesn't care
      what the type is, but when doing a generated walk, we already
      have to cast the caller's specific FOO* to call visit_start,
      while using void** lets us use visit_end without a cast. Also,
      an upcoming patch will add a clone visitor that wants to use
      the same implementation for all three visit_end callbacks,
      which is made easier if all three share the same signature.
      
      For visitors with already track per-object state (the QMP visitors
      via a stack, and the string visitors which do not allow nesting),
      add an assertion that the caller is indeed passing the same
      pointer to paired calls.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-4-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      1158bb2a
    • E
      qemu-img: Don't leak errors when outputting JSON · 911ee36d
      Eric Blake 提交于
      If our JSON output ever encounters an error, we would just silently
      leak the error object.  Instead, assert that our usage won't fail.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-3-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      911ee36d
    • E
      qapi: Improve use of qmp/types.h · c7eb39cb
      Eric Blake 提交于
      'qjson.h' is not a QObject subtype; include this file directly in
      .c files that are using it, rather than abusing qmp/types.h for
      that purpose.
      
      Meanwhile, for files that include a list of individual QObject
      subtypes, it's easier to just use qmp/types.h for that purpose.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-2-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      c7eb39cb
  2. 05 7月, 2016 31 次提交
  3. 04 7月, 2016 4 次提交
    • P
      Merge remote-tracking branch 'remotes/berrange/tags/pull-qcrypto-2016-07-04-1' into staging · 0d7e96c9
      Peter Maydell 提交于
      Merge qcrypto 2016/07/04 v1
      
      # gpg: Signature made Mon 04 Jul 2016 15:54:26 BST
      # gpg:                using RSA key 0xBE86EBB415104FDF
      # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>"
      # gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>"
      # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF
      
      * remotes/berrange/tags/pull-qcrypto-2016-07-04-1:
        crypto: allow default TLS priority to be chosen at build time
        crypto: add support for TLS priority string override
        crypto: implement sha224, sha384, sha512 and ripemd160 hashes
        crypto: switch hash code to use nettle/gcrypt directly
        crypto: rename OUT to out in xts test to avoid clash on MinGW
        crypto: fix handling of iv generator hash defaults
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0d7e96c9
    • G
      Revert "bios: Add fast variant of SeaBIOS for use with -kernel on x86." · 3b1154ff
      Gerd Hoffmann 提交于
      This reverts commit 4e04ab6a.
      
      Also remove pc-bios/bios-fast.bin.
      
      Commit was merged by mistake.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3b1154ff
    • D
      crypto: allow default TLS priority to be chosen at build time · a1c5e949
      Daniel P. Berrange 提交于
      Modern gnutls can use a global config file to control the
      crypto priority settings for TLS connections. For example
      the priority string "@SYSTEM" instructs gnutls to find the
      priority setting named "SYSTEM" in the global config file.
      
      Latest gnutls GIT codebase gained the ability to reference
      multiple priority strings in the config file, with the first
      one that is found to existing winning. This means it is now
      possible to configure QEMU out of the box with a default
      priority of "@QEMU,SYSTEM", which says to look for the
      settings "QEMU" first, and if not found, use the "SYSTEM"
      settings.
      
      To make use of this facility, we introduce the ability to
      set the QEMU default priority at build time via a new
      configure argument.  It is anticipated that distro vendors
      will set this when building QEMU to a suitable value for
      use with distro crypto policy setup. eg current Fedora
      would run
      
       ./configure --tls-priority=@SYSTEM
      
      while future Fedora would run
      
       ./configure --tls-priority=@QEMU,SYSTEM
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a1c5e949
    • D
      crypto: add support for TLS priority string override · 13f12430
      Daniel P. Berrange 提交于
      The gnutls default priority is either "NORMAL" (most historical
      versions of gnutls) which is a built-in label in gnutls code,
      or "@SYSTEM" (latest gnutls on Fedora at least) which refers
      to an admin customizable entry in a gnutls config file.
      
      Regardless of which default is used by a distro, they are both
      global defaults applying to all applications using gnutls. If
      a single application on the system needs to use a weaker set
      of crypto priorities, this potentially forces the weakness onto
      all applications. Or conversely if a single application wants a
      strong default than all others, it can't do this via the global
      config file.
      
      This adds an extra parameter to the tls credential object which
      allows the mgmt app / user to explicitly provide a priority
      string to QEMU when configuring TLS.
      
      For example, to use the "NORMAL" priority, but disable SSL 3.0
      one can now configure QEMU thus:
      
        $QEMU -object tls-creds-x509,id=tls0,dir=/home/berrange/qemutls,\
                      priority="NORMAL:-VERS-SSL3.0" \
              ..other args...
      
      If creating tls-creds-anon, whatever priority the user specifies
      will always have "+ANON-DH" appended to it, since that's mandatory
      to make the anonymous credentials work.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      13f12430