1. 02 11月, 2015 2 次提交
    • E
      qapi: Unbox base members · ddf21908
      Eric Blake 提交于
      Rather than storing a base class as a pointer to a box, just
      store the fields of that base class in the same order, so that
      a child struct can be directly cast to its parent.  This gives
      less malloc overhead, less pointer dereferencing, and even less
      generated code.  Compare to the earlier commit 1e6c1616 "qapi:
      Generate a nicer struct for flat unions" (although that patch
      had fewer places to change, as less of qemu was directly using
      qapi structs for flat unions).  It also allows us to turn on
      automatic type-safe wrappers for upcasting to the base class
      of a struct.
      
      Changes to the generated code look like this in qapi-types.h:
      
      | struct SpiceChannel {
      |-    SpiceBasicInfo *base;
      |+    /* Members inherited from SpiceBasicInfo: */
      |+    char *host;
      |+    char *port;
      |+    NetworkAddressFamily family;
      |+    /* Own members: */
      |     int64_t connection_id;
      
      as well as additional upcast functions like qapi_SpiceChannel_base().
      Meanwhile, changes to qapi-visit.c look like:
      
      | static void visit_type_SpiceChannel_fields(Visitor *v, SpiceChannel **obj, Error **errp)
      | {
      |     Error *err = NULL;
      |
      |-    visit_type_implicit_SpiceBasicInfo(v, &(*obj)->base, &err);
      |+    visit_type_SpiceBasicInfo_fields(v, (SpiceBasicInfo **)obj, &err);
      |     if (err) {
      
      (the cast is necessary, since our upcast wrappers only deal with a
      single pointer, not pointer-to-pointer); plus the wholesale
      elimination of some now-unused visit_type_implicit_FOO() functions.
      
      Without boxing, the corner case of one empty struct having
      another empty struct as its base type now requires inserting a
      dummy member (previously, the 'Base *base' member sufficed).
      
      And now that we no longer consume a 'base' member in the generated
      C struct, we can delete the former negative struct-base-clash-base
      test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1445898903-12082-11-git-send-email-eblake@redhat.com>
      [Commit message tweaked slightly]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      ddf21908
    • E
      tests/qapi-schema: Test for reserved names, empty struct · 19767083
      Eric Blake 提交于
      Add some testsuite coverage to ensure future patches are on
      the right track:
      
      Our current C representation of qapi arrays is done by appending
      'List' to the element name; but we are not preventing the
      creation of an object type with the same name.  Add
      reserved-type-list.json to test this.  Then rename
      enum-union-clash.json to reserved-type-kind.json to cover the
      reservation that we DO detect, and shorten it to match the fact
      that the name is reserved even if there is no clash.
      
      We are failing to detect a collision between a dictionary member
      and the implicit 'has_*' flag for another optional member. The
      easiest fix would be for a future patch to reserve the entire
      "has[-_]" namespace for member names (the collision is also
      possible for branch names within flat unions, but only as long as
      branch names can collide with (non-variant) members; however,
      since future patches are about to remove that, it is not worth
      testing here). Add reserved-member-has.json to test this.
      
      A similar collision exists between a dictionary member where
      c_name() munges what might otherwise be a reserved name to start
      with 'q_', and another member explicitly starts with "q[-_]".
      Again, the easiest solution for a future patch will be reserving
      the entire namespace, but here for commands as well as members.
      Add reserved-member-q.json and reserved-command-q.json to test
      this; separate tests since arguably our munging of command 'unix'
      to 'qmp_q_unix()' could be done without a q_, which is different
      than the munging of a member 'unix' to 'foo.q_unix'.
      
      Finally, our testsuite does not have any compilation coverage
      of struct inheritance with empty qapi structs.  Update
      qapi-schema-test.json to test this.
      
      Note that there is currently no technical reason to forbid type
      name patterns from member names, or member name patterns from
      types, since the two are not in the same namespace in C and
      won't collide; but it's not worth adding positive tests of these
      corner cases at this time, especially while there is other churn
      pending in patches that rearrange which collisions actually
      happen.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1445898903-12082-2-git-send-email-eblake@redhat.com>
      [Commit message tweaked slightly]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      19767083
  2. 29 10月, 2015 1 次提交
    • V
      tests/vhost-user-bridge: add vhost-user bridge application · 3595e2eb
      Victor Kaplansky 提交于
      The test existing in QEMU for vhost-user feature is good for
      testing the management protocol, but does not allow actual
      traffic. This patch proposes Vhost-User Bridge application, which
      can serve the QEMU community as a comprehensive test by running
      real internet traffic by means of vhost-user interface.
      
      Essentially the Vhost-User Bridge is a very basic vhost-user
      backend for QEMU. It runs as a standalone user-level process.
      For packet processing Vhost-User Bridge uses an additional QEMU
      instance with a backend configured by "-net socket" as a shared
      VLAN.  This way another QEMU virtual machine can effectively
      serve as a shared bus by means of UDP communication.
      
      For a more simple setup, the another QEMU instance running the
      SLiRP backend can be the same QEMU instance running vhost-user
      client.
      
      This Vhost-User Bridge implementation is very preliminary.  It is
      missing many features. I has been studying vhost-user protocol
      internals, so I've written vhost-user-bridge bit by bit as I
      progressed through the protocol.  Most probably its internal
      architecture will change significantly.
      
      To run Vhost-User Bridge application:
      
      1. Build vhost-user-bridge with a regular procedure. This will
      create a vhost-user-bridge executable under tests directory:
      
          $ configure; make tests/vhost-user-bridge
      
      2. Ensure the machine has hugepages enabled in kernel with
      command line like:
      
          default_hugepagesz=2M hugepagesz=2M hugepages=2048
      
      3. Run Vhost-User Bridge with:
      
          $ tests/vhost-user-bridge
      
      The above will run vhost-user server listening for connections
      on UNIX domain socket /tmp/vubr.sock, and will try to connect
      by UDP to VLAN bridge to localhost:5555, while listening on
      localhost:4444
      
      Run qemu with a virtio-net backed by vhost-user:
      
          $ qemu \
              -enable-kvm -m 512 -smp 2 \
              -object memory-backend-file,id=mem,size=512M,mem-path=/dev/hugepages,share=on \
              -numa node,memdev=mem -mem-prealloc \
              -chardev socket,id=char0,path=/tmp/vubr.sock \
              -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \
              -device virtio-net-pci,netdev=mynet1 \
              -net none \
              -net socket,vlan=0,udp=localhost:4444,localaddr=localhost:5555 \
              -net user,vlan=0 \
              disk.img
      
      vhost-user-bridge was tested very lightly: it's able to bringup a
      linux on client VM with the virtio-net driver, and execute transmits
      and receives to the internet. I tested with "wget redhat.com",
      "dig redhat.com".
      
      PS. I've consulted DPDK's code for vhost-user during Vhost-User
      Bridge implementation.
      Signed-off-by: NVictor Kaplansky <victork@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      3595e2eb
  3. 26 10月, 2015 1 次提交
  4. 25 10月, 2015 1 次提交
  5. 23 10月, 2015 1 次提交
    • D
      configure: avoid polluting global CFLAGS with tasn1 flags · 90246037
      Daniel P. Berrange 提交于
      The previous commit
      
        commit 9a2fd434
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Mon Apr 13 14:01:39 2015 +0100
      
          crypto: add sanity checking of TLS x509 credentials
      
      defined new variables $TEST_LIBS and $TEST_CFLAGS and
      used them in tests/Makefile to augment $LIBS and $CFLAGS.
      
      Unfortunately this overlooks the fact that tests/Makefile
      is not executed via recursive-make, it is just pulled into
      the top level Makefile via an include statement. So rather
      than just augmenting the compiler/linker flags for tests
      it polluted the global flags.
      
      This is thought to be behind a reported failure when
      building the pixman module as a sub-module, since global
      $CFLAGS are passed down to configure in pixman.
      
      This change removes the $TEST_LIBS and $TEST_CFLAGS
      replacing them with $TASN1_LIBS and $TASN1_CFLAGS,
      setting only against specific objects/executables
      that need them.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      90246037
  6. 20 10月, 2015 1 次提交
    • M
      tests: add a local test for guest agent · 62c39b30
      Marc-André Lureau 提交于
      Add some local guest agent tests, as it is better than nothing, only
      when CONFIG_POSIX (using unix sockets).
      
      With the QGA_TEST_SIDE_EFFECTING environment variable, it will include
      tests with side effects, such as freezing/thawing the FS or changing the
      time.
      
      (a better test would involve a managed VM (or container), but it might
      be better to leave that off to autotest/avocado)
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      * use mkdtemp() in placeof g_mkdtemp() for glib 2.22 compat
      * drop redundant/conflicting compat defines for
        g_assert_{true,false}, since glib-compat has them now.
      * build fixes for OSX: use PRId64 instead of glib formats, drop
        g_spawn_default usage for glib compat
      * assert connect_qga() doesn't fail
      * only enable test-qga for linux hosts
      * allow get-memory-block-info* to fail
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      62c39b30
  7. 15 10月, 2015 5 次提交
  8. 13 10月, 2015 3 次提交
    • E
      qapi: Add tests for empty unions · 8d25dd10
      Eric Blake 提交于
      The documentation claims that alternates are useful for
      allowing two or more types, although nothing enforces this.
      Meanwhile, it is silent on whether empty unions are allowed.
      In practice, the generated code will compile, in part because
      we have a 'void *data' branch; but attempting to visit such a
      type will cause an abort().  While there's no technical reason
      that a degenerate union could not be made to work, it's harder
      to justify the time spent in chasing known (the current
      abort() during visit) and unknown corner cases, than it would
      be to just outlaw them.  A future patch will probably take the
      approach of forbidding them; in the meantime, we can at least
      add testsuite coverage to make it obvious where things stand.
      
      In addition to adding tests to expose the problems, we also
      need to adjust existing tests that are meant to test something
      else, but which could fail for the wrong reason if we reject
      degenerate alternates/unions.
      
      Note that empty structs are explicitly supported (for example,
      right now they are the only way to specify that one branch of a
      flat union adds no additional members), and empty enums are
      covered by the testsuite as working (even if they do not seem
      to have much use).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1443565276-4535-8-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      8d25dd10
    • E
      qapi: Test for various name collisions · d220fbcd
      Eric Blake 提交于
      Expose some weaknesses in the generator: we don't always forbid
      the generation of structs that contain multiple members that map
      to the same C or QMP name.  This has already been marked FIXME in
      qapi.py in commit d90675fa, but having more tests will make sure
      future patches produce desired behavior; and updating existing
      patches to better document things doesn't hurt, either.  Some of
      these collisions are already caught in the old-style parser
      checks, but ultimately we want all collisions to be caught in the
      new-style QAPISchema*.check() methods.
      
      This patch focuses on C struct members, and does not consider
      collisions between commands and events (affecting C function
      names), or even collisions between generated C type names with
      user type names (for things like automatic FOOList struct
      representing array types or FOOKind for an implicit enum).
      
      There are two types of struct collisions we want to catch:
       1) Collision between two keys in a JSON object. qapi.py prevents
          that within a single struct (see test duplicate-key), but it is
          possible to have collisions between a type's members and its
          base type's members (existing tests struct-base-clash,
          struct-base-clash-deep), and its flat union variant members
          (renamed test flat-union-clash-member).
       2) Collision between two members of the C struct that is generated
          for a given QAPI type:
          a) Multiple QAPI names map to the same C name (new test
             args-name-clash)
          b) A QAPI name maps to a C name that is used for another purpose
             (new tests flat-union-clash-branch, struct-base-clash-base,
             union-clash-data). We already fixed some such cases in commit
             0f61af3e and 1e6c1616, but more remain.
          c) Two C names generated for other purposes clash
             (updated test alternate-clash, new test union-clash-branches,
             union-clash-type, flat-union-clash-type)
      
      Ultimately, if we need to have a flat union where a tag value
      clashes with a base member name, we could change the generator to
      name the union (using 'foo.u.value' rather than 'foo.value') or
      otherwise munge the C name corresponding to tag values.  But
      unless such a need arises, it will probably be easier to just
      forbid these collisions.
      
      Some of these negative tests will be deleted later, and positive
      tests added to qapi-schema-test.json in their place, when the
      generator code is reworked to avoid particular code generation
      collisions in class 2).
      
      [Note that viewing this patch with git rename detection enabled
      may see some confusion due to renaming some tests while adding
      others, but where the content is similar enough that git picks
      the wrong pre- and post-patch files to associate]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1443565276-4535-6-git-send-email-eblake@redhat.com>
      [Improve commit message and comments a bit, drop an unrelated test]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d220fbcd
    • E
      qapi: Sort qapi-schema tests · 1ffe818a
      Eric Blake 提交于
      Recent changes to qapi have provided quite a bit of churn in
      the makefile, because we are inconsistent on what order test
      names appear in, and on whether to re-wrap the list of tests or
      just add arbitrary line lengths.  Writing the list in a sorted
      fashion, one test per line, will make future patches easier
      to see what tests are being added or removed by a patch.
      
      Although it is tempting to use $(wildcard qapi-schema/*.json)
      for a more compact listing, such an approach would risk picking
      up leftover garbage .json files in the directory; so keeping
      the list explicit is safer for ensuring reproducible tarballs
      and test results.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1443565276-4535-2-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      1ffe818a
  9. 12 10月, 2015 1 次提交
  10. 09 10月, 2015 2 次提交
    • M
      device-introspect-test: New, covering device introspection · 2d1abb85
      Markus Armbruster 提交于
      The test doesn't check that the output makes any sense, only that QEMU
      survives.  Useful since we've had an astounding number of crash bugs
      around there.
      
      In fact, we have a bunch of them right now: a few devices crash or
      hang, and some leave dangling pointers behind.  The test skips testing
      the broken parts.  The next commits will fix them up, and drop the
      skipping.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1443689999-12182-8-git-send-email-armbru@redhat.com>
      2d1abb85
    • M
      tests: Fix how qom-test is run · e253c287
      Markus Armbruster 提交于
      We want to run qom-test for every architecture, without having to
      manually add it to every architecture's list of tests.  Commit 3687d532
      accomplished this by adding it to every architecture's list
      automatically.
      
      However, some architectures inherit their tests from others, like this:
      
          check-qtest-x86_64-y = $(check-qtest-i386-y)
          check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
          check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
      
      For such architectures, we ended up running the (slow!) test twice.
      Commit 2b8419cb attempted to avoid this by adding the test only when
      it's not already present.  Works only as long as we consider adding
      the test to the architectures on the left hand side *after* the ones
      on the right hand side: x86_64 after i386, microblazeel after
      microblaze, xtensaeb after xtensa.
      
      Turns out we consider them in $(SYSEMU_TARGET_LIST) order.  Defined as
      
          SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
             $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
      
      On my machine, this results in the oder xtensa, x86_64, microblazeel,
      microblaze, i386.  Consequently, qom-test runs twice for microblazeel
      and x86_64.
      
      Replace this complex and flawed machinery with a much simpler one: add
      generic tests (currently just qom-test) to check-qtest-generic-y
      instead of check-qtest-$(target)-y for every target, then run
      $(check-qtest-generic-y) for every target.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NAndreas Färber <afaerber@suse.de>
      Message-Id: <1443689999-12182-5-git-send-email-armbru@redhat.com>
      e253c287
  11. 06 10月, 2015 1 次提交
  12. 21 9月, 2015 3 次提交
    • 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: 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
  13. 15 9月, 2015 7 次提交
    • D
      crypto: introduce new module for handling TLS sessions · d321e1e5
      Daniel P. Berrange 提交于
      Introduce a QCryptoTLSSession object that will encapsulate
      all the code for setting up and using a client/sever TLS
      session. This isolates the code which depends on the gnutls
      library, avoiding #ifdefs in the rest of the codebase, as
      well as facilitating any possible future port to other TLS
      libraries, if desired. It makes use of the previously
      defined QCryptoTLSCreds object to access credentials to
      use with the session. It also includes further unit tests
      to validate the correctness of the TLS session handshake
      and certificate validation. This is functionally equivalent
      to the current TLS session handling code embedded in the
      VNC server, and will obsolete it.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d321e1e5
    • D
      crypto: add sanity checking of TLS x509 credentials · 9a2fd434
      Daniel P. Berrange 提交于
      If the administrator incorrectly sets up their x509 certificates,
      the errors seen at runtime during connection attempts are very
      obscure and difficult to diagnose. This has been a particular
      problem for people using openssl to generate their certificates
      instead of the gnutls certtool, because the openssl tools don't
      turn on the various x509 extensions that gnutls expects to be
      present by default.
      
      This change thus adds support in the TLS credentials object to
      sanity check the certificates when QEMU first loads them. This
      gives the administrator immediate feedback for the majority of
      common configuration mistakes, reducing the pain involved in
      setting up TLS. The code is derived from equivalent code that
      has been part of libvirt's TLS support and has been seen to be
      valuable in assisting admins.
      
      It is possible to disable the sanity checking, however, via
      the new 'sanity-check' property on the tls-creds object type,
      with a value of 'no'.
      
      Unit tests are included in this change to verify the correctness
      of the sanity checking code in all the key scenarios it is
      intended to cope with. As part of the test suite, the pkix_asn1_tab.c
      from gnutls is imported. This file is intentionally copied from the
      (long since obsolete) gnutls 1.6.3 source tree, since that version
      was still under GPLv2+, rather than the GPLv3+ of gnutls >= 2.0.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      9a2fd434
    • D
      crypto: introduce new base module for TLS credentials · a090187d
      Daniel P. Berrange 提交于
      Introduce a QCryptoTLSCreds class to act as the base class for
      storing TLS credentials. This will be later subclassed to provide
      handling of anonymous and x509 credential types. The subclasses
      will be user creatable objects, so instances can be created &
      deleted via 'object-add' and 'object-del' QMP commands respectively,
      or via the -object command line arg.
      
      If the credentials cannot be initialized an error will be reported
      as a QMP reply, or on stderr respectively.
      
      The idea is to make it possible to represent and manage TLS
      credentials independently of the network service that is using
      them. This will enable multiple services to use the same set of
      credentials and minimize code duplication. A later patch will
      convert the current VNC server TLS code over to use this object.
      
      The representation of credentials will be functionally equivalent
      to that currently implemented in the VNC server with one exception.
      The new code has the ability to (optionally) load a pre-generated
      set of diffie-hellman parameters, if the file dh-params.pem exists,
      whereas the current VNC server will always generate them on startup.
      This is beneficial for admins who wish to avoid the (small) time
      sink of generating DH parameters at startup and/or avoid depleting
      entropy.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a090187d
    • D
      qom: allow QOM to be linked into tools binaries · 0c7012e0
      Daniel P. Berrange 提交于
      The qom objects are currently added to common-obj-y
      which is only linked into the system emulators. The
      later crypto patches will depend on QOM infrastructure
      and will also be used from tools binaries. Thus the QOM
      objects are moved into a new qom-obj-y variable which
      can be referenced when linking tools, system emulators
      and tests.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      0c7012e0
    • D
      crypto: move crypto objects out of libqemuutil.la · fb37726d
      Daniel P. Berrange 提交于
      Future patches will be adding more crypto related APIs which
      rely on QOM infrastructure. This creates a problem, because
      QOM relies on library constructors to register objects. When
      you have a file in a static .a library though which is only
      referenced by a constructor the linker is dumb and will drop
      that file when linking to the final executable :-( The only
      workaround for this is to link the .a library to the executable
      using the -Wl,--whole-archive flag, but this creates its own
      set of problems because QEMU is relying on lazy linking for
      libqemuutil.a. Using --whole-archive majorly increases the
      size of final executables as they now contain a bunch of
      object code they don't actually use.
      
      The least bad option is to thus not include the crypto objects
      in libqemuutil.la, and instead define a crypto-obj-y variable
      that is referenced directly by all the executables that need
      this code (tools + softmmu, but not qemu-ga). We avoid pulling
      entire of crypto-obj-y into the userspace emulators as that
      would force them to link to gnutls too, which is not required.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      fb37726d
    • D
      tests: remove repetition in unit test object deps · b124533e
      Daniel P. Berrange 提交于
      Most of the unit tests have identical sets of object deps.
      For example all block unit tests need to depend on
      
       $(block-obj-y) libqemuutil.a libqemustub.a
      
      Currently each unit test repeats this list of test deps.
      This list of deps will grow as future patches add more
      modules to the build, so define some common variables
      that can be used by all unit tests to remove the
      repetition.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b124533e
    • D
      qapi: allow override of default enum prefix naming · 351d36e4
      Daniel P. Berrange 提交于
      The camel_to_upper() method applies some heuristics to turn
      a mixed case type name into an all-uppercase name. This is
      used for example, to generate enum constant name prefixes.
      
      The heuristics don't also generate a satisfactory name
      though. eg
      
        { 'enum': 'QCryptoTLSCredsEndpoint',
          'data': ['client', 'server']}
      
      Results in Q_CRYPTOTLS_CREDS_ENDPOINT_CLIENT. This has
      an undesirable _ after the initial Q and is missing an
      _ between the CRYPTO & TLS strings.
      
      Rather than try to add more and more heuristics to try
      to cope with this, simply allow the QAPI schema to
      specify the desired enum constant prefix explicitly.
      
      eg
      
        { 'enum': 'QCryptoTLSCredsEndpoint',
          'prefix': 'QCRYPTO_TLS_CREDS_ENDPOINT',
          'data': ['client', 'server']}
      
      Now gives the QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT name.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      351d36e4
  14. 07 9月, 2015 1 次提交
  15. 04 9月, 2015 5 次提交
  16. 04 8月, 2015 1 次提交
  17. 28 7月, 2015 1 次提交
  18. 21 7月, 2015 1 次提交
    • S
      tests: Fix broken targets check-report-qtest-* · 47c71996
      Stefan Weil 提交于
      They need QTEST_QEMU_IMG. Without it, the tests raise an assertion:
      
      $ make -C bin check-report-qtest-i386.xml
      make: Entering directory 'bin'
      GTESTER check-report-qtest-i386.xml
      blkdebug: Suspended request 'A'
      blkdebug: Resuming request 'A'
      ahci-test: tests/libqos/libqos.c:162:
       mkimg: Assertion `qemu_img_path' failed.
      main-loop: WARNING: I/O thread spun for 1000 iterations
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1437231284-17455-1-git-send-email-sw@weilnetz.de
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      47c71996
  19. 08 7月, 2015 2 次提交