1. 18 12月, 2018 1 次提交
  2. 14 12月, 2018 2 次提交
  3. 13 11月, 2018 2 次提交
    • P
      blockdev: Consistently use snapshot_node_name in external_snapshot_prepare() · d52e1a0e
      Peter Maydell 提交于
      In the function external_snapshot_prepare() we have a
      BlockdevSnapshotSync struct, which has the usual combination
      of has_snapshot_node_name and snapshot_node_name fields for an
      optional field. We set up a local variable
              const char *snapshot_node_name =
                  s->has_snapshot_node_name ? s->snapshot_node_name : NULL;
      
      and then mostly use "if (!snapshot_node_name)" for checking
      whether we have a snapshot node name. The exception is that in
      one place we check s->has_snapshot_node_name instead. This
      confuses Coverity (CID 1396473), which thinks it might be
      possible to get here with s->has_snapshot_node_name true but
      snapshot_node_name NULL, and warns that the call to
      qdict_put_str() will segfault in that case.
      
      Make the code consistent and unconfuse Coverity by using
      the same check for this conditional that we do in the rest
      of the surrounding code.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d52e1a0e
    • Z
      blockdev: handle error on block latency histogram set error · 63d5341f
      zhenwei pi 提交于
      Function block_latency_histogram_set may return error, but qapi ignore this.
      This can be reproduced easily by qmp command:
      virsh qemu-monitor-command INSTANCE '{"execute":"x-block-latency-histogram-set",
      "arguments":{"device":"drive-virtio-disk1","boundaries":[10,200,40]}}'
      In fact this command does not work, but we still get success result.
      
      qmp_x_block_latency_histogram_set is a batch setting API, report error ASAP.
      Signed-off-by: Nzhenwei pi <pizhenwei@bytedance.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      63d5341f
  4. 05 11月, 2018 2 次提交
    • K
      block: Make auto-read-only=on default for -drive · 9384a444
      Kevin Wolf 提交于
      While we want machine interfaces like -blockdev and QMP blockdev-add to
      add as little auto-detection as possible so that management tools are
      explicit about their needs, -drive is a convenience option for human
      users. Enabling auto-read-only=on by default there enables users to use
      read-only images for read-only guest devices without having to specify
      read-only=on explicitly. If they try to attach the image to a read-write
      device, they will still get an error message.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      9384a444
    • K
      block: Add auto-read-only option · e35bdc12
      Kevin Wolf 提交于
      If a management application builds the block graph node by node, the
      protocol layer doesn't inherit its read-only option from the format
      layer any more, so it must be set explicitly.
      
      Backing files should work on read-only storage, but at the same time, a
      block job like commit should be able to reopen them read-write if they
      are on read-write storage. However, without option inheritance, reopen
      only changes the read-only option for the root node (typically the
      format layer), but not the protocol layer, so reopening fails (the
      format layer wants to get write permissions, but the protocol layer is
      still read-only).
      
      A simple workaround for the problem in the management tool would be to
      open the protocol layer always read-write and to make only the format
      layer read-only for backing files. However, sometimes the file is
      actually stored on read-only storage and we don't know whether the image
      can be opened read-write (for example, for NBD it depends on the server
      we're trying to connect to). This adds an option that makes QEMU try to
      open the image read-write, but allows it to degrade to a read-only mode
      without returning an error.
      
      The documentation for this option is consciously phrased in a way that
      allows QEMU to switch to a better model eventually: Instead of trying
      when the image is first opened, making the read-only flag dynamic and
      changing it automatically whenever the first BLK_PERM_WRITE user is
      attached or the last one is detached would be much more useful
      behaviour.
      
      Unfortunately, this more useful behaviour is also a lot harder to
      implement, and libvirt needs a solution now before it can switch to
      -blockdev, so let's start with this easier approach for now.
      
      Instead of adding a new auto-read-only option, turning the existing
      read-only into an enum (with a bool alternate for compatibility) was
      considered, but it complicated the implementation to the point that it
      didn't seem to be worth it.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      e35bdc12
  5. 30 10月, 2018 10 次提交
  6. 19 10月, 2018 1 次提交
    • M
      blockdev: Convert drive_new() to Error · c4f26c9f
      Markus Armbruster 提交于
      Calling error_report() from within a function that takes an Error **
      argument is suspicious.  drive_new() calls error_report() even though
      it can run within drive_init_func(), which takes an Error ** argument.
      drive_init_func()'s caller main(), via qemu_opts_foreach(), is fine
      with it, but clean it up anyway:
      
      * Convert drive_new() to Error
      
      * Update add_init_drive() to report the error received from
        drive_new()
      
      * Make main() pass &error_fatal through qemu_opts_foreach(),
        drive_init_func() to drive_new()
      
      * Make default_drive() pass &error_abort through qemu_opts_foreach(),
        drive_init_func() to drive_new()
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20181017082702.5581-34-armbru@redhat.com>
      c4f26c9f
  7. 25 9月, 2018 8 次提交
  8. 15 8月, 2018 4 次提交
  9. 10 7月, 2018 4 次提交
  10. 03 7月, 2018 1 次提交
  11. 18 6月, 2018 1 次提交
  12. 15 6月, 2018 4 次提交