Skip to content
Snippets Groups Projects
  1. Jan 15, 2021
  2. Jan 13, 2021
  3. Dec 19, 2020
    • Markus Armbruster's avatar
      string-output-visitor: Fix to use sufficient precision · 54addb01
      Markus Armbruster authored
      
      The string output visitor should serialize numbers so that the string
      input visitor deserializes them back to the same number.  It fails to
      do so.
      
      print_type_number() uses format %f.  This is prone to nasty rounding
      errors.  For instance, numbers between 0 and 0.0000005 get flushed to
      zero.
      
      We currently use this visitor only for HMP info migrate, info network,
      info qtree, and info memdev.  No double values occur there as far as I
      can tell.
      
      Fix anyway by formatting with %.17g.  17 decimal digits always suffice
      for IEEE double.
      
      See also recent commit "qobject: Fix qnum_to_string() to use
      sufficient precision".
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-9-armbru@redhat.com>
      54addb01
  4. Dec 18, 2020
  5. Dec 15, 2020
  6. Dec 11, 2020
    • Hanna Reitz's avatar
      fuse: Allow growable exports · 4fba06d5
      Hanna Reitz authored
      
      These will behave more like normal files in that writes beyond the EOF
      will automatically grow the export size.
      
      As an optimization, keep the RESIZE permission for growable exports so
      we do not have to take it for every post-EOF write.  (This permission is
      not released when the export is destroyed, because at that point the
      BlockBackend is destroyed altogether anyway.)
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201027190600.192171-5-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      4fba06d5
    • Hanna Reitz's avatar
      fuse: Allow exporting BDSs via FUSE · 0c9b70d5
      Hanna Reitz authored
      
      block-export-add type=fuse allows mounting block graph nodes via FUSE on
      some existing regular file.  That file should then appears like a raw
      disk image, and accesses to it result in accesses to the exported BDS.
      
      Right now, we only implement the necessary block export functions to set
      it up and shut it down.  We do not implement any access functions, so
      accessing the mount point only results in errors.  This will be
      addressed by a followup patch.
      
      We keep a hash table of exported mount points, because we want to be
      able to detect when users try to use a mount point twice.  This is
      because we invoke stat() to check whether the given mount point is a
      regular file, but if that file is served by ourselves (because it is
      already used as a mount point), then this stat() would have to be served
      by ourselves, too, which is impossible to do while we (as the caller)
      are waiting for it to settle.  Therefore, keep track of mount point
      paths to at least catch the most obvious instances of that problem.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201027190600.192171-3-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      0c9b70d5
  7. Dec 10, 2020
  8. Nov 17, 2020
  9. Nov 09, 2020
  10. Nov 04, 2020
  11. Nov 03, 2020
  12. Nov 01, 2020
  13. Oct 30, 2020
    • Eric Blake's avatar
      nbd: Add 'qemu-nbd -A' to expose allocation depth · dbc7b014
      Eric Blake authored
      
      Allow the server to expose an additional metacontext to be requested
      by savvy clients.  qemu-nbd adds a new option -A to expose the
      qemu:allocation-depth metacontext through NBD_CMD_BLOCK_STATUS; this
      can also be set via QMP when using block-export-add.
      
      qemu as client is hacked into viewing the key aspects of this new
      context by abusing the already-experimental x-dirty-bitmap option to
      collapse all depths greater than 2, which results in a tri-state value
      visible in the output of 'qemu-img map --output=json' (yes, that means
      x-dirty-bitmap is now a bit of a misnomer, but I didn't feel like
      renaming it as it would introduce a needless break of back-compat,
      even though we make no compat guarantees with x- members):
      
      unallocated (depth 0) => "zero":false, "data":true
      local (depth 1)       => "zero":false, "data":false
      backing (depth 2+)    => "zero":true,  "data":true
      
      libnbd as client is probably a nicer way to get at the information
      without having to decipher such hacks in qemu as client. ;)
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20201027050556.269064-11-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      dbc7b014
    • Eric Blake's avatar
      nbd: Update qapi to support exporting multiple bitmaps · cbad81ce
      Eric Blake authored
      
      Since 'block-export-add' is new to 5.2, we can still tweak the
      interface; there, allowing 'bitmaps':['str'] is nicer than
      'bitmap':'str'.  This wires up the qapi and qemu-nbd changes to permit
      passing multiple bitmaps as distinct metadata contexts that the NBD
      client may request, but the actual support for more than one will
      require a further patch to the server.
      
      Note that there are no changes made to the existing deprecated
      'nbd-server-add' command; this required splitting the QAPI type
      BlockExportOptionsNbd, which fortunately does not affect QMP
      introspection.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20201027050556.269064-5-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarPeter Krempa <pkrempa@redhat.com>
      cbad81ce
  14. Oct 23, 2020
    • Stefan Hajnoczi's avatar
      block/export: add vhost-user-blk multi-queue support · d9b495f9
      Stefan Hajnoczi authored
      
      Allow the number of queues to be configured using --export
      vhost-user-blk,num-queues=N. This setting should match the QEMU --device
      vhost-user-blk-pci,num-queues=N setting but QEMU vhost-user-blk.c lowers
      its own value if the vhost-user-blk backend offers fewer queues than
      QEMU.
      
      The vhost-user-blk-server.c code is already capable of multi-queue. All
      virtqueue processing runs in the same AioContext. No new locking is
      needed.
      
      Add the num-queues=N option and set the VIRTIO_BLK_F_MQ feature bit.
      Note that the feature bit only announces the presence of the num_queues
      configuration space field. It does not promise that there is more than 1
      virtqueue, so we can set it unconditionally.
      
      I tested multi-queue by running a random read fio test with numjobs=4 on
      an -smp 4 guest. After the benchmark finished the guest /proc/interrupts
      file showed activity on all 4 virtio-blk MSI-X. The /sys/block/vda/mq/
      directory shows that Linux blk-mq has 4 queues configured.
      
      An automated test is included in the next commit.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20201001144604.559733-2-stefanha@redhat.com
      [Fixed accidental tab characters as suggested by Markus Armbruster
      --Stefan]
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      d9b495f9
    • Stefan Hajnoczi's avatar
      block/export: add iothread and fixed-iothread options · f51d23c8
      Stefan Hajnoczi authored
      
      Make it possible to specify the iothread where the export will run. By
      default the block node can be moved to other AioContexts later and the
      export will follow. The fixed-iothread option forces strict behavior
      that prevents changing AioContext while the export is active. See the
      QAPI docs for details.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20200929125516.186715-5-stefanha@redhat.com
      [Fix stray '#' character in block-export.json and add missing "(since:
      5.2)" as suggested by Eric Blake.
      --Stefan]
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      f51d23c8
    • Stefan Hajnoczi's avatar
      block/export: convert vhost-user-blk server to block export API · 90fc91d5
      Stefan Hajnoczi authored
      
      Use the new QAPI block exports API instead of defining our own QOM
      objects.
      
      This is a large change because the lifecycle of VuBlockDev needs to
      follow BlockExportDriver. QOM properties are replaced by QAPI options
      objects.
      
      VuBlockDev is renamed VuBlkExport and contains a BlockExport field.
      Several fields can be dropped since BlockExport already has equivalents.
      
      The file names and meson build integration will be adjusted in a future
      patch. libvhost-user should probably be built as a static library that
      is linked into QEMU instead of as a .c file that results in duplicate
      compilation.
      
      The new command-line syntax is:
      
        $ qemu-storage-daemon \
            --blockdev file,node-name=drive0,filename=test.img \
            --export vhost-user-blk,node-name=drive0,id=export0,unix-socket=/tmp/vhost-user-blk.sock
      
      Note that unix-socket is optional because we may wish to accept chardevs
      too in the future.
      
      Markus noted that supported address families are not explicit in the
      QAPI schema. It is unlikely that support for more address families will
      be added since file descriptor passing is required and few address
      families support it. If a new address family needs to be added, then the
      QAPI 'features' syntax can be used to advertize them.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20200924151549.913737-12-stefanha@redhat.com
      [Skip test on big-endian host architectures because this device doesn't
      support them yet (as already mentioned in a code comment).
      --Stefan]
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      90fc91d5
    • Philippe Mathieu-Daudé's avatar
      block/nvme: Add driver statistics for access alignment and hw errors · f25e7ab2
      Philippe Mathieu-Daudé authored
      
      Keep statistics of some hardware errors, and number of
      aligned/unaligned I/O accesses.
      
      QMP example booting a full RHEL 8.3 aarch64 guest:
      
      { "execute": "query-blockstats" }
      {
          "return": [
              {
                  "device": "",
                  "node-name": "drive0",
                  "stats": {
                      "flush_total_time_ns": 6026948,
                      "wr_highest_offset": 3383991230464,
                      "wr_total_time_ns": 807450995,
                      "failed_wr_operations": 0,
                      "failed_rd_operations": 0,
                      "wr_merged": 3,
                      "wr_bytes": 50133504,
                      "failed_unmap_operations": 0,
                      "failed_flush_operations": 0,
                      "account_invalid": false,
                      "rd_total_time_ns": 1846979900,
                      "flush_operations": 130,
                      "wr_operations": 659,
                      "rd_merged": 1192,
                      "rd_bytes": 218244096,
                      "account_failed": false,
                      "idle_time_ns": 2678641497,
                      "rd_operations": 7406,
                  },
                  "driver-specific": {
                      "driver": "nvme",
                      "completion-errors": 0,
                      "unaligned-accesses": 2959,
                      "aligned-accesses": 4477
                  },
                  "qdev": "/machine/peripheral-anon/device[0]/virtio-backend"
              }
          ]
      }
      
      Suggested-by: default avatarStefan Hajnoczi <stefanha@gmail.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20201001162939.1567915-1-philmd@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      f25e7ab2
  15. Oct 21, 2020
  16. Oct 15, 2020
    • Kevin Wolf's avatar
      keyval: Parse help options · 8bf12c4f
      Kevin Wolf authored
      
      This adds a special meaning for 'help' and '?' as options to the keyval
      parser. Instead of being an error (because of a missing value) or a
      value for an implied key, they now request help, which is a new boolean
      output of the parser in addition to the QDict.
      
      A new parameter 'p_help' is added to keyval_parse() that contains on
      return whether help was requested. If NULL is passed, requesting help
      results in an error and all other cases work like before.
      
      Turning previous error cases into help is a compatible extension. The
      behaviour potentially changes for implied keys: They could previously
      get 'help' as their value, which is now interpreted as requesting help.
      
      This is not a problem in practice because 'help' and '?' are not a valid
      values for the implied key of any option parsed with keyval_parse():
      
      * audiodev: union Audiodev, implied key "driver" is enum AudiodevDriver,
        "help" and "?" are not among its values
      
      * display: union DisplayOptions, implied key "type" is enum
        DisplayType, "help" and "?" are not among its values
      
      * blockdev: union BlockdevOptions, implied key "driver is enum
        BlockdevDriver, "help" and "?" are not among its values
      
      * export: union BlockExport, implied key "type" is enum BlockExportType,
        "help" and "?" are not among its values
      
      * monitor: struct MonitorOptions, implied key "mode" is enum MonitorMode,
        "help" and "?" are not among its values
      
      * nbd-server: struct NbdServerOptions, no implied key.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201011073505.1185335-5-armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      8bf12c4f
  17. Oct 14, 2020
    • Robert Hoo's avatar
      cpu: Introduce CPU model deprecation API · 61ad65d0
      Robert Hoo authored
      
      Implement the ability of marking some versions deprecated. When
      that CPU model is chosen, print a warning.  The warning message
      can be customized, e.g. suggesting an alternative CPU model to be
      used instead.
      
      The deprecation message will be printed by x86_cpu_list_entry(),
      e.g. '-cpu help'.
      
      QMP command 'query-cpu-definitions' will return a bool value
      indicating the deprecation status.
      
      Signed-off-by: default avatarRobert Hoo <robert.hu@linux.intel.com>
      Message-Id: <1600758855-80046-1-git-send-email-robert.hu@linux.intel.com>
      [ehabkost: reword commit message]
      [ehabkost: Handle NULL cpu_type]
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      61ad65d0
  18. Oct 12, 2020
  19. Oct 09, 2020
  20. Oct 06, 2020
Loading