Skip to content
Snippets Groups Projects
  1. May 25, 2016
  2. May 19, 2016
  3. May 12, 2016
  4. Apr 05, 2016
    • Kevin Wolf's avatar
      block: Forbid I/O throttling on nodes with multiple parents for 2.6 · 76b22320
      Kevin Wolf authored
      
      As the patches to move I/O throttling to BlockBackend didn't make it in
      time for the 2.6 release, but the release adds new ways of configuring
      VMs whose behaviour would change once the move is done, we need to
      outlaw such configurations temporarily.
      
      The problem exists whenever a BDS has more users than just its BB, for
      example it is used as a backing file for another node. (This wasn't
      possible in 2.5 yet as we introduced node references to specify a
      backing file only recently.) In these cases, the throttling would
      apply to these other users now, but after moving throttling to the
      BlockBackend the other users wouldn't be throttled any more.
      
      This patch prevents making new references to a throttled node as well as
      using monitor commands to throttle a node with multiple parents.
      
      Compared to 2.5 this changes behaviour in some corner cases where
      references were allowed before, like bs->file or Quorum children. It
      seems reasonable to assume that users didn't use I/O throttling on such
      low level nodes. With the upcoming move of throttling into BlockBackend,
      such configurations won't be possible anyway.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      76b22320
  5. Mar 30, 2016
    • Kevin Wolf's avatar
      block: Remove bdrv_(set_)enable_write_cache() · 09cf9db1
      Kevin Wolf authored
      
      The only remaining users were block jobs (mirror and backup) which
      unconditionally enabled WCE on the BlockBackend of the target image. As
      these block jobs don't go through BlockBackend for their I/O requests,
      they aren't affected by this setting anyway but always get a writeback
      mode, so that call can be removed.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      09cf9db1
    • Kevin Wolf's avatar
      block: Remove BDRV_O_CACHE_WB · 61de4c68
      Kevin Wolf authored
      
      The previous patches have successively made blk->enable_write_cache the
      true source for the information whether a writethrough mode must be
      implemented. The corresponding BDRV_O_CACHE_WB is only useless baggage
      we're carrying around, so now's the time to remove it.
      
      At the same time, we remove the 'cache.writeback' option parsing on the
      BDS level as the only effect was setting the BDRV_O_CACHE_WB flag.
      
      This change requires test cases that explicitly enabled the option to
      drop it. Other than that and the change of the error message when
      writethrough is enabled on the BDS level (from "Can't set writethrough
      mode" to "doesn't support the option"), there should be no change in
      behaviour.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      61de4c68
    • Kevin Wolf's avatar
      block: Remove bdrv_parse_cache_flags() · 53e8ae01
      Kevin Wolf authored
      
      All users are converted to bdrv_parse_cache_mode() now.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      53e8ae01
    • Kevin Wolf's avatar
      qemu-io: Use bdrv_parse_cache_mode() in reopen_f() · 19dbecdc
      Kevin Wolf authored
      
      We must forbid changing the WCE flag in bdrv_reopen() in the same patch,
      as otherwise the behaviour would change so that the flag takes
      precedence over the explicitly specified option.
      
      The correct value of the WCE flag depends on the BlockBackend user (e.g.
      guest device) and isn't a decision that the QMP client makes, so this
      change is what we want.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      19dbecdc
    • Kevin Wolf's avatar
      block/qapi: Use blk_enable_write_cache() · c83f9fba
      Kevin Wolf authored
      
      Now that WCE is handled on the BlockBackend level, the flag is
      meaningless for BDSes. As the schema requires us to fill the field,
      we return an enabled write cache for them.
      
      Note that this means that querying the BlockBackend name may return
      writethrough as the cache information, whereas querying the node-name of
      the root of that same BlockBackend will return writeback.
      
      This may appear odd at first, but it actually makes sense because it
      correctly repesents the layer that implements the WCE handling. This
      becomes more apparent when you consider nodes that are the root node of
      multiple BlockBackends, where each BB can have its own WCE setting.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      c83f9fba
    • Kevin Wolf's avatar
      block: Move enable_write_cache to BB level · bfd18d1e
      Kevin Wolf authored
      
      Whether a write cache is used or not is a decision that concerns the
      user (e.g. the guest device) rather than the backend. It was already
      logically part of the BB level as bdrv_move_feature_fields() always kept
      it on top of the BDS tree; with this patch, the core of it (the actual
      flag and the additional flushes) is also implemented there.
      
      Direct callers of bdrv_open() must pass BDRV_O_CACHE_WB now if bs
      doesn't have a BlockBackend attached.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      bfd18d1e
    • Kevin Wolf's avatar
      block: Add bdrv_parse_cache_mode() · baf5602e
      Kevin Wolf authored
      
      It's like bdrv_parse_cache_flags(), except that writethrough mode isn't
      included in the flags, but returned as a separate bool.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      baf5602e
    • Daniel P. Berrangé's avatar
      block: move encryption deprecation warning into qcow code · e6ff69bf
      Daniel P. Berrangé authored
      
      For a couple of releases we have been warning
      
        Encrypted images are deprecated
        Support for them will be removed in a future release.
        You can use 'qemu-img convert' to convert your image to an unencrypted one.
      
      This warning was issued by system emulators, qemu-img, qemu-nbd
      and qemu-io. Such a broad warning was issued because the original
      intention was to rip out all the code for dealing with encryption
      inside the QEMU block layer APIs.
      
      The new block encryption framework used for the LUKS driver does
      not rely on the unloved block layer API for encryption keys,
      instead using the QOM 'secret' object type. It is thus no longer
      appropriate to warn about encryption unconditionally.
      
      When the qcow/qcow2 drivers are converted to use the new encryption
      framework too, it will be practical to keep AES-CBC support present
      for use in qemu-img, qemu-io & qemu-nbd to allow for interoperability
      with older QEMU versions and liberation of data from existing encrypted
      qcow2 files.
      
      This change moves the warning out of the generic block code and
      into the qcow/qcow2 drivers. Further, the warning is set to only
      appear when running the system emulators, since qemu-img, qemu-io,
      qemu-nbd are expected to support qcow2 encryption long term now that
      the maint burden has been eliminated.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      e6ff69bf
    • Daniel P. Berrangé's avatar
      block: add flag to indicate that no I/O will be performed · abb06c5a
      Daniel P. Berrangé authored
      
      When opening an image it is useful to know whether the caller
      intends to perform I/O on the image or not. In the case of
      encrypted images this will allow the block driver to avoid
      having to prompt for decryption keys when we merely want to
      query header metadata about the image. eg qemu-img info
      
      This flag is enforced at the top level only, since even if
      we don't want todo I/O on the 'qcow2' file payload, the
      underlying 'file' driver will still need todo I/O to read
      the qcow2 header, for example.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      abb06c5a
    • Kevin Wolf's avatar
      block: Reject writethrough mode except at the root · 73ac451f
      Kevin Wolf authored
      
      Writethrough mode is going to become a BlockBackend feature rather than
      a BDS one, so forbid it in places where we won't be able to support it
      when the code finally matches the envisioned design.
      
      We only allowed setting the cache mode of non-root nodes after the 2.5
      release, so we're still free to make this change.
      
      The target of block jobs is now always opened in a writeback mode
      because it doesn't have a BlockBackend attached. This makes more sense
      anyway because block jobs know when to flush. If the graph is modified
      on job completion, the original cache mode moves to the new root, so
      for the guest device writethough always stays enabled if it was
      configured this way.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      73ac451f
    • Kevin Wolf's avatar
      block: Make backing files always writeback · b8816a43
      Kevin Wolf authored
      
      First of all, we're generally not writing to backing files, but when we
      do, it's in the context of block jobs which know very well when to flush
      the image.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      b8816a43
Loading