Skip to content
Snippets Groups Projects
  1. Sep 27, 2022
  2. Sep 07, 2022
  3. Sep 01, 2022
  4. Jul 29, 2022
  5. Jul 20, 2022
  6. Jul 19, 2022
  7. Jul 18, 2022
  8. Jun 29, 2022
  9. Jun 28, 2022
  10. Jun 24, 2022
    • Xie Yongji's avatar
      vduse-blk: Add name option · 779d82e1
      Xie Yongji authored
      
      Currently we use 'id' option as the name of VDUSE device.
      It's a bit confusing since we use one value for two different
      purposes: the ID to identfy the export within QEMU (must be
      distinct from any other exports in the same QEMU process, but
      can overlap with names used by other processes), and the VDUSE
      name to uniquely identify it on the host (must be distinct from
      other VDUSE devices on the same host, but can overlap with other
      export types like NBD in the same process). To make it clear,
      this patch adds a separate 'name' option to specify the VDUSE
      name for the vduse-blk export instead.
      
      Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
      Message-Id: <20220614051532.92-7-xieyongji@bytedance.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      779d82e1
    • Xie Yongji's avatar
      vduse-blk: Add serial option · 0862a087
      Xie Yongji authored
      
      Add a 'serial' option to allow user to specify this value
      explicitly. And the default value is changed to an empty
      string as what we did in "hw/block/virtio-blk.c".
      
      Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
      Message-Id: <20220614051532.92-6-xieyongji@bytedance.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      0862a087
    • Xie Yongji's avatar
      vduse-blk: Implement vduse-blk export · 2a2359b8
      Xie Yongji authored
      
      This implements a VDUSE block backends based on
      the libvduse library. We can use it to export the BDSs
      for both VM and container (host) usage.
      
      The new command-line syntax is:
      
      $ qemu-storage-daemon \
          --blockdev file,node-name=drive0,filename=test.img \
          --export vduse-blk,node-name=drive0,id=vduse-export0,writable=on
      
      After the qemu-storage-daemon started, we need to use
      the "vdpa" command to attach the device to vDPA bus:
      
      $ vdpa dev add name vduse-export0 mgmtdev vduse
      
      Also the device must be removed via the "vdpa" command
      before we stop the qemu-storage-daemon.
      
      Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20220523084611.91-7-xieyongji@bytedance.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      2a2359b8
  11. Jun 22, 2022
  12. Jun 15, 2022
  13. Jun 14, 2022
    • Paolo Bonzini's avatar
      block: add more commands to preconfig mode · f55ba801
      Paolo Bonzini authored
      
      Of the block device commands, those that are available outside system
      emulators do not require a fully constructed machine by definition.
      Allow running them before machine initialization has concluded.
      
      Of the ones that are available inside system emulation, allow querying
      the PR managers, and setting up accounting and throttling.
      
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f55ba801
    • Paolo Bonzini's avatar
      qmp: add filtering of statistics by name · cf7405bc
      Paolo Bonzini authored
      
      Allow retrieving only a subset of statistics.  This can be useful
      for example in order to plot a subset of the statistics many times
      a second: KVM publishes ~40 statistics for each vCPU on x86; retrieving
      and serializing all of them would be useless.
      
      Another use will be in HMP in the following patch; implementing the
      filter in the backend is easy enough that it was deemed okay to make
      this a public interface.
      
      Example:
      
      { "execute": "query-stats",
        "arguments": {
          "target": "vcpu",
          "vcpus": [ "/machine/unattached/device[2]",
                     "/machine/unattached/device[4]" ],
          "providers": [
            { "provider": "kvm",
              "names": [ "l1d_flush", "exits" ] } } }
      
      { "return": {
          "vcpus": [
            { "path": "/machine/unattached/device[2]"
              "providers": [
                { "provider": "kvm",
                  "stats": [ { "name": "l1d_flush", "value": 41213 },
                             { "name": "exits", "value": 74291 } ] } ] },
            { "path": "/machine/unattached/device[4]"
              "providers": [
                { "provider": "kvm",
                  "stats": [ { "name": "l1d_flush", "value": 16132 },
                             { "name": "exits", "value": 57922 } ] } ] } ] } }
      
      Extracted from a patch by Mark Kanda.
      
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cf7405bc
    • Paolo Bonzini's avatar
      qmp: add filtering of statistics by provider · 068cc51d
      Paolo Bonzini authored
      
      Allow retrieving the statistics from a specific provider only.
      This can be used in the future by HMP commands such as "info
      sync-profile" or "info profile".  The next patch also adds
      filter-by-provider capabilities to the HMP equivalent of
      query-stats, "info stats".
      
      Example:
      
      { "execute": "query-stats",
        "arguments": {
          "target": "vm",
          "providers": [
            { "provider": "kvm" } ] } }
      
      The QAPI is a bit more verbose than just a list of StatsProvider,
      so that it can be subsequently extended with filtering of statistics
      by name.
      
      If a provider is specified more than once in the filter, each request
      will be included separately in the output.
      
      Extracted from a patch by Mark Kanda.
      
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      068cc51d
    • Paolo Bonzini's avatar
      qmp: add filtering of statistics by target vCPU · 467ef823
      Paolo Bonzini authored
      
      Introduce a simple filtering of statistics, that allows to retrieve
      statistics for a subset of the guest vCPUs.  This will be used for
      example by the HMP monitor, in order to retrieve the statistics
      for the currently selected CPU.
      
      Example:
      { "execute": "query-stats",
        "arguments": {
          "target": "vcpu",
          "vcpus": [ "/machine/unattached/device[2]",
                     "/machine/unattached/device[4]" ] } }
      
      Extracted from a patch by Mark Kanda.
      
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      467ef823
    • Mark Kanda's avatar
      kvm: Support for querying fd-based stats · cc01a3f4
      Mark Kanda authored
      
      Add support for querying fd-based KVM stats - as introduced by Linux kernel
      commit:
      
      cb082bfab59a ("KVM: stats: Add fd-based API to read binary stats data")
      
      This allows the user to analyze the behavior of the VM without access
      to debugfs.
      
      Signed-off-by: default avatarMark Kanda <mark.kanda@oracle.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cc01a3f4
    • Mark Kanda's avatar
      qmp: Support for querying stats · b9f88dc0
      Mark Kanda authored
      
      Gathering statistics is important for development, for monitoring and
      for performance measurement.  There are tools such as kvm_stat that do
      this and they rely on the _user_ knowing the interesting data points
      rather than the tool (which can treat them as opaque).
      
      The commands introduced in this commit introduce QMP support for
      querying stats; the goal is to take the capabilities of these tools
      and making them available throughout the whole virtualization stack,
      so that one can observe, monitor and measure virtual machines without
      having shell access + root on the host that runs them.
      
      query-stats returns a list of all stats per target type (only VM
      and vCPU to start); future commits add extra options for specifying
      stat names, vCPU qom paths, and providers.  All these are used by the
      HMP command "info stats".  Because of the development usecases around
      statistics, a good HMP interface is important.
      
      query-stats-schemas returns a list of stats included in each target
      type, with an option for specifying the provider.  The concepts in the
      schema are based on the KVM binary stats' own introspection data, just
      translated to QAPI.
      
      There are two reasons to have a separate schema that is not tied to
      the QAPI schema.  The first is the contents of the schemas: the new
      introspection data provides different information than the QAPI data,
      namely unit of measurement, how the numbers are gathered and change
      (peak/instant/cumulative/histogram), and histogram bucket sizes.
      There's really no reason to have this kind of metadata in the QAPI
      introspection schema (except possibly for the unit of measure, but
      there's a very weak justification).
      
      Another reason is the dynamicity of the schema.  The QAPI introspection
      data is very much static; and while QOM is somewhat more dynamic,
      generally we consider that to be a bug rather than a feature these days.
      On the other hand, the statistics that are exposed by QEMU might be
      passed through from another source, such as KVM, and the disadvantages of
      manually updating the QAPI schema for outweight the benefits from vetting
      the statistics and filtering out anything that seems "too unstable".
      Running old QEMU with new kernel is a supported usecase; if old QEMU
      cannot expose statistics from a new kernel, or if a kernel developer
      needs to change QEMU before gathering new info from the new kernel,
      then that is a poor user interface.
      
      The framework provides a method to register callbacks for these QMP
      commands.  Most of the work in fact is done by the callbacks, and a
      large majority of this patch is new QAPI structs and commands.
      
      Examples (with KVM stats):
      
      - Query all VM stats:
      
      { "execute": "query-stats", "arguments" : { "target": "vm" } }
      
      { "return": [
           { "provider": "kvm",
             "stats": [
                { "name": "max_mmu_page_hash_collisions", "value": 0 },
                { "name": "max_mmu_rmap_size", "value": 0 },
                { "name": "nx_lpage_splits", "value": 148 },
                ... ] },
           { "provider": "xyz",
             "stats": [ ... ] }
      ] }
      
      - Query all vCPU stats:
      
      { "execute": "query-stats", "arguments" : { "target": "vcpu" } }
      
      { "return": [
           { "provider": "kvm",
             "qom_path": "/machine/unattached/device[0]"
             "stats": [
                { "name": "guest_mode", "value": 0 },
                { "name": "directed_yield_successful", "value": 0 },
                { "name": "directed_yield_attempted", "value": 106 },
                ... ] },
           { "provider": "kvm",
             "qom_path": "/machine/unattached/device[1]"
             "stats": [
                { "name": "guest_mode", "value": 0 },
                { "name": "directed_yield_successful", "value": 0 },
                { "name": "directed_yield_attempted", "value": 106 },
                ... ] },
      ] }
      
      - Retrieve the schemas:
      
      { "execute": "query-stats-schemas" }
      
      { "return": [
          { "provider": "kvm",
            "target": "vcpu",
            "stats": [
               { "name": "guest_mode",
                 "unit": "none",
                 "base": 10,
                 "exponent": 0,
                 "type": "instant" },
              { "name": "directed_yield_successful",
                 "unit": "none",
                 "base": 10,
                 "exponent": 0,
                 "type": "cumulative" },
              ... ]
          },
          { "provider": "kvm",
            "target": "vm",
            "stats": [
              { "name": "max_mmu_page_hash_collisions",
                 "unit": "none",
                 "base": 10,
                 "exponent": 0,
                 "type": "peak" },
              ... ]
          },
          { "provider": "xyz",
            "target": "vm",
            "stats": [ ... ]
          }
      ] }
      
      Signed-off-by: default avatarMark Kanda <mark.kanda@oracle.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b9f88dc0
  14. Jun 09, 2022
  15. Jun 06, 2022
  16. Jun 03, 2022
    • Thomas Huth's avatar
      ui: Switch "-display sdl" to use the QAPI parser · 9eafdeea
      Thomas Huth authored
      
      The "-display sdl" option still uses a hand-crafted parser for its
      parameters since we didn't want to drag an interface we considered
      somewhat flawed into the QAPI schema. Since the flaws are gone now,
      it's time to QAPIfy.
      
      This introduces the new "DisplaySDL" QAPI struct that is used to hold
      the parameters that are unique to the SDL display. The only specific
      parameter is currently "grab-mod" that is used to specify the required
      modifier keys to escape from the mouse grabbing mode.
      
      Message-Id: <20220519155625.1414365-3-thuth@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      9eafdeea
  17. May 26, 2022
  18. May 17, 2022
Loading