1. 20 1月, 2016 3 次提交
  2. 13 1月, 2016 1 次提交
    • 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
  3. 18 12月, 2015 8 次提交
  4. 17 12月, 2015 1 次提交
    • E
      qapi: Don't let implicit enum MAX member collide · 7fb1cf16
      Eric Blake 提交于
      Now that we guarantee the user doesn't have any enum values
      beginning with a single underscore, we can use that for our
      own purposes.  Renaming ENUM_MAX to ENUM__MAX makes it obvious
      that the sentinel is generated.
      
      This patch was mostly generated by applying a temporary patch:
      
      |diff --git a/scripts/qapi.py b/scripts/qapi.py
      |index e6d014b..b862ec9 100644
      |--- a/scripts/qapi.py
      |+++ b/scripts/qapi.py
      |@@ -1570,6 +1570,7 @@ const char *const %(c_name)s_lookup[] = {
      |     max_index = c_enum_const(name, 'MAX', prefix)
      |     ret += mcgen('''
      |     [%(max_index)s] = NULL,
      |+// %(max_index)s
      | };
      | ''',
      |                max_index=max_index)
      
      then running:
      
      $ cat qapi-{types,event}.c tests/test-qapi-types.c |
          sed -n 's,^// \(.*\)MAX,s|\1MAX|\1_MAX|g,p' > list
      $ git grep -l _MAX | xargs sed -i -f list
      
      The only things not generated are the changes in scripts/qapi.py.
      
      Rejecting enum members named 'MAX' is now useless, and will be dropped
      in the next patch.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      [Rebased to current master, commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      7fb1cf16
  5. 02 11月, 2015 1 次提交
    • E
      block: Convert to new qapi union layout · 6a8f9661
      Eric Blake 提交于
      We have two issues with our qapi union layout:
      1) Even though the QMP wire format spells the tag 'type', the
      C code spells it 'kind', requiring some hacks in the generator.
      2) The C struct uses an anonymous union, which places all tag
      values in the same namespace as all non-variant members. This
      leads to spurious collisions if a tag value matches a non-variant
      member's name.
      
      Make the conversion to the new layout for block-related code.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1445898903-12082-16-git-send-email-eblake@redhat.com>
      [Commit message tweaked slightly]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      6a8f9661
  6. 16 10月, 2015 2 次提交
  7. 14 9月, 2015 11 次提交
  8. 05 9月, 2015 1 次提交
  9. 08 7月, 2015 1 次提交
  10. 07 7月, 2015 1 次提交
  11. 23 6月, 2015 1 次提交
  12. 12 6月, 2015 1 次提交
    • M
      qcow2: Add DEFAULT_L2_CACHE_CLUSTERS · bc85ef26
      Max Reitz 提交于
      If a relatively large cluster size is chosen, the default of 1 MB L2
      cache is not really appropriate. In this case, unless overridden by the
      user, the default cache size should not be determined by its size in
      bytes but by the number of L2 tables (clusters) it is supposed to
      contain.
      
      Note that without this patch, MIN_L2_CACHE_SIZE will effectively take
      over the same role. However, providing space for just two L2 tables is
      not enough to be the default.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      bc85ef26
  13. 22 5月, 2015 1 次提交
    • D
      qcow2/qcow: protect against uninitialized encryption key · 8336aafa
      Daniel P. Berrange 提交于
      When a qcow[2] file is opened, if the header reports an
      encryption method, this is used to set the 'crypt_method_header'
      field on the BDRVQcow[2]State struct, and the 'encrypted' flag
      in the BDRVState struct.
      
      When doing I/O operations, the 'crypt_method' field on the
      BDRVQcow[2]State struct is checked to determine if encryption
      needs to be applied.
      
      The crypt_method_header value is copied into crypt_method when
      the bdrv_set_key() method is called.
      
      The QEMU code which opens a block device is expected to always
      do a check
      
         if (bdrv_is_encrypted(bs)) {
             bdrv_set_key(bs, ....key...);
         }
      
      If code forgets to do this, then 'crypt_method' is never set
      and so when I/O is performed, QEMU writes plain text data
      into a sector which is expected to contain cipher text, or
      when reading, will return cipher text instead of plain
      text.
      
      Change the qcow[2] code to consult bs->encrypted when deciding
      whether encryption is required, and assert(s->crypt_method)
      to protect against cases where the caller forgets to set the
      encryption key.
      
      Also put an assert in the set_key methods to protect against
      the case where the caller sets an encryption key on a block
      device that does not have encryption
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8336aafa
  14. 28 4月, 2015 3 次提交
  15. 08 4月, 2015 1 次提交
  16. 13 3月, 2015 1 次提交
  17. 10 3月, 2015 2 次提交