1. 25 9月, 2014 3 次提交
  2. 22 9月, 2014 6 次提交
  3. 11 9月, 2014 1 次提交
  4. 10 9月, 2014 4 次提交
    • B
      block: Make the block accounting functions operate on BlockAcctStats · 5366d0c8
      Benoît Canet 提交于
      This is the next step for decoupling block accounting functions from
      BlockDriverState.
      In a future commit the BlockAcctStats structure will be moved from
      BlockDriverState to the device models structures.
      
      Note that bdrv_get_stats was introduced so device models can retrieve the
      BlockAcctStats structure of a BlockDriverState without being aware of it's
      layout.
      This function should go away when BlockAcctStats will be embedded in the device
      models structures.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Keith Busch <keith.busch@intel.com>
      CC: Anthony Liguori <aliguori@amazon.com>
      CC: "Michael S. Tsirkin" <mst@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Michael Tokarev <mjt@tls.msk.ru>
      CC: John Snow <jsnow@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Alexander Graf <agraf@suse.de>
      CC: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5366d0c8
    • B
      block: Extract the block accounting code · 5e5a94b6
      Benoît Canet 提交于
      The plan is to add new accounting metrics (latency, invalid requests, failed
      requests, queue depth) and block.c is overpopulated so it will be better to work
      in a separate module.
      
      Moreover the long term plan is to have statistics in each of the BDS of the graph
      for metrology purpose; this means that the device model statistics must move from
      the topmost BDS to the device model.
      
      So we need to decouple the statistic code from BlockDriverState.
      
      This is another argument for the extraction of the code in a separate module.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Benoit Canet <benoit@irqsave.net>
      CC: Fam Zheng <famz@redhat.com>
      CC: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5e5a94b6
    • B
      block: Extract the BlockAcctStats structure · 0ddd0ad9
      Benoît Canet 提交于
      Extract the block accounting statistics into a structure so the block device
      models can hold them in the future.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0ddd0ad9
    • L
      block: extend BLOCK_IO_ERROR event with nospace indicator · c7c2ff0c
      Luiz Capitulino 提交于
      Management software, such as RHEV's vdsm, want to be able to allocate
      disk space on demand. The basic use case is to start a VM with a small
      disk and then the disk is enlarged when QEMU hits a ENOSPC condition.
      
      To this end, the management software has to be notified when QEMU
      encounters ENOSPC. The solution implemented by this commit is simple:
      it extends the BLOCK_IO_ERROR with a 'nospace' key, which is true
      when QEMU is stopped due to ENOSPC.
      
      Note that support for querying this event is already present in
      query-block by means of the 'io-status' key. Also, the new 'nospace'
      BLOCK_IO_ERROR field shares the same semantics with 'io-status',
      which basically means that werror= has to be set to either
      'stop' or 'enospc' to enable 'nospace'.
      
      Finally, this commit also updates the 'io-status' key doc in the
      schema with a list of supported device models.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c7c2ff0c
  5. 08 9月, 2014 1 次提交
  6. 29 8月, 2014 2 次提交
  7. 28 8月, 2014 1 次提交
  8. 20 8月, 2014 2 次提交
    • M
      block: Add bdrv_refresh_filename() · 91af7014
      Max Reitz 提交于
      Some block devices may not have a filename in their BDS; and for some,
      there may not even be a normal filename at all. To work around this, add
      a function which tries to construct a valid filename for the
      BDS.filename field.
      
      If a filename exists or a block driver is able to reconstruct a valid
      filename (which is placed in BDS.exact_filename), this can directly be
      used.
      
      If no filename can be constructed, we can still construct an options
      QDict which is then converted to a JSON object and prefixed with the
      "json:" pseudo protocol prefix. The QDict is placed in
      BDS.full_open_options.
      
      For most block drivers, this process can be done automatically; those
      that need special handling may define a .bdrv_refresh_filename() method
      to fill BDS.exact_filename and BDS.full_open_options themselves.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      91af7014
    • M
      block: Use g_new() & friends where that makes obvious sense · 5839e53b
      Markus Armbruster 提交于
      g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
      for two reasons.  One, it catches multiplication overflowing size_t.
      Two, it returns T * rather than void *, which lets the compiler catch
      more type errors.
      
      Patch created with Coccinelle, with two manual changes on top:
      
      * Add const to bdrv_iterate_format() to keep the types straight
      
      * Convert the allocation in bdrv_drop_intermediate(), which Coccinelle
        inexplicably misses
      
      Coccinelle semantic patch:
      
          @@
          type T;
          @@
          -g_malloc(sizeof(T))
          +g_new(T, 1)
          @@
          type T;
          @@
          -g_try_malloc(sizeof(T))
          +g_try_new(T, 1)
          @@
          type T;
          @@
          -g_malloc0(sizeof(T))
          +g_new0(T, 1)
          @@
          type T;
          @@
          -g_try_malloc0(sizeof(T))
          +g_try_new0(T, 1)
          @@
          type T;
          expression n;
          @@
          -g_malloc(sizeof(T) * (n))
          +g_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc(sizeof(T) * (n))
          +g_try_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_malloc0(sizeof(T) * (n))
          +g_new0(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc0(sizeof(T) * (n))
          +g_try_new0(T, n)
          @@
          type T;
          expression p, n;
          @@
          -g_realloc(p, sizeof(T) * (n))
          +g_renew(T, p, n)
          @@
          type T;
          expression p, n;
          @@
          -g_try_realloc(p, sizeof(T) * (n))
          +g_try_renew(T, p, n)
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5839e53b
  9. 15 8月, 2014 12 次提交
  10. 18 7月, 2014 1 次提交
  11. 14 7月, 2014 2 次提交
  12. 09 7月, 2014 2 次提交
  13. 07 7月, 2014 1 次提交
  14. 01 7月, 2014 2 次提交