1. 03 2月, 2016 1 次提交
    • M
      blockdev: Fix 'change' for slot devices · 12c7ec87
      Max Reitz 提交于
      'change' and related operations did not work when used on guest devices
      featuring removable media but no actual tray, because
      blk_dev_is_tray_open() always returned false for them and the
      blockdev-{insert,remove}-medium commands required it to return true.
      
      Fix this by making blockdev-{insert,remove}-medium work on tray-less
      devices. Also, blockdev-{open,close}-tray are now explicitly no-ops when
      invoked on such devices, and blk_dev_change_media_cb() is instead
      called by blockdev-{insert,remove}-medium (for tray-less devices only).
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Cc: qemu-stable <qemu-stable@nongnu.org>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Message-id: 1454096953-31773-3-git-send-email-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      12c7ec87
  2. 20 1月, 2016 1 次提交
  3. 13 1月, 2016 1 次提交
    • M
      error: Use error_reportf_err() where it makes obvious sense · c29b77f9
      Markus Armbruster 提交于
      Done with this Coccinelle semantic patch
      
          @@
          expression FMT, E, S;
          expression list ARGS;
          @@
          -    error_report(FMT, ARGS, error_get_pretty(E));
          +    error_reportf_err(E, FMT/*@@@*/, ARGS);
          (
          -    error_free(E);
          |
      	 exit(S);
          |
      	 abort();
          )
      
      followed by a replace of '%s"/*@@@*/' by '"' and some line rewrapping,
      because I can't figure out how to make Coccinelle transform strings.
      
      We now use the 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.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1450452927-8346-12-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      c29b77f9
  4. 08 1月, 2016 4 次提交
  5. 18 12月, 2015 2 次提交
    • K
      block: Move cache options into options QDict · 91a097e7
      Kevin Wolf 提交于
      This adds the cache mode options to the QDict, so that they can be
      specified for child nodes (e.g. backing.cache.direct=off).
      
      The cache modes are not removed from the flags at this point; instead,
      options and flags are kept in sync. If the user specifies both flags and
      options, the options take precedence.
      
      Child node inherit cache modes as options now, they don't use flags any
      more.
      
      Note that this forbids specifying the cache mode for empty drives. It
      didn't make sense anyway to specify it there, because it didn't have any
      effect. blockdev_init() considers the cache options now bdrv_open()
      options and therefore doesn't create an empty drive any more but calls
      into bdrv_open(). This in turn will fail with no driver and filename
      specified.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      91a097e7
    • K
      blockdev: Set 'format' indicates non-empty drive · 39c4ae94
      Kevin Wolf 提交于
      Creating an empty drive while specifying 'format' doesn't make sense.
      The specified format driver would simply be ignored.
      
      Make a set 'format' option an indication that a non-empty drive should
      be created. This makes 'format' consistent with 'driver' and allows
      using it with a block driver that doesn't need any other options (like
      null-co/null-aio).
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      39c4ae94
  6. 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
  7. 11 12月, 2015 1 次提交
  8. 18 11月, 2015 2 次提交
  9. 17 11月, 2015 1 次提交
  10. 12 11月, 2015 7 次提交
  11. 11 11月, 2015 14 次提交
  12. 09 11月, 2015 1 次提交
  13. 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
  14. 24 10月, 2015 3 次提交