1. 19 1月, 2018 1 次提交
    • C
      vhost-user-blk: introduce a new vhost-user-blk host device · 00343e4b
      Changpeng Liu 提交于
      This commit introduces a new vhost-user device for block, it uses a
      chardev to connect with the backend, same with Qemu virito-blk device,
      Guest OS still uses the virtio-blk frontend driver.
      
      To use it, start QEMU with command line like this:
      
      qemu-system-x86_64 \
          -chardev socket,id=char0,path=/path/vhost.socket \
          -device vhost-user-blk-pci,chardev=char0,num-queues=2, \
                  bootindex=2... \
      
      Users can use different parameters for `num-queues` and `bootindex`.
      
      Different with exist Qemu virtio-blk host device, it makes more easy
      for users to implement their own I/O processing logic, such as all
      user space I/O stack against hardware block device. It uses the new
      vhost messages(VHOST_USER_GET_CONFIG) to get block virtio config
      information from backend process.
      Signed-off-by: NChangpeng Liu <changpeng.liu@intel.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      00343e4b
  2. 16 1月, 2018 1 次提交
    • E
      maint: Fix macros with broken 'do/while(0); ' usage · 2562755e
      Eric Blake 提交于
      The point of writing a macro embedded in a 'do { ... } while (0)'
      loop (particularly if the macro has multiple statements or would
      otherwise end with an 'if' statement) is so that the macro can be
      used as a drop-in statement with the caller supplying the
      trailing ';'.  Although our coding style frowns on brace-less 'if':
        if (cond)
          statement;
        else
          something else;
      that is the classic case where failure to use do/while(0) wrapping
      would cause the 'else' to pair with any embedded 'if' in the macro
      rather than the intended outer 'if'.  But conversely, if the macro
      includes an embedded ';', then the same brace-less coding style
      would now have two statements, making the 'else' a syntax error
      rather than pairing with the outer 'if'.  Thus, even though our
      coding style with required braces is not impacted, ending a macro
      with ';' makes our code harder to port to projects that use
      brace-less styles.
      
      The change should have no semantic impact.  I was not able to
      fully compile-test all of the changes (as some of them are
      examples of the ugly bit-rotting debug print statements that are
      completely elided by default, and I didn't want to recompile
      with the necessary -D witnesses - cleaning those up is left as a
      bite-sized task for another day); I did, however, audit that for
      all files touched, all callers of the changed macros DID supply
      a trailing ';' at the callsite, and did not appear to be used
      as part of a brace-less conditional.
      
      Found mechanically via: $ git grep -B1 'while (0);' | grep -A1 \\\\
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20171201232433.25193-7-eblake@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2562755e
  3. 22 12月, 2017 1 次提交
  4. 19 12月, 2017 5 次提交
  5. 15 12月, 2017 1 次提交
  6. 14 12月, 2017 4 次提交
  7. 27 10月, 2017 2 次提交
  8. 15 10月, 2017 1 次提交
  9. 06 10月, 2017 1 次提交
  10. 27 9月, 2017 1 次提交
  11. 21 9月, 2017 1 次提交
  12. 19 9月, 2017 2 次提交
  13. 04 9月, 2017 1 次提交
  14. 29 8月, 2017 1 次提交
    • D
      nvme: Fix get/set number of queues feature, again · cdd34637
      Dan Aloni 提交于
      The number of queues that should be return by the admin command should:
      
        1) Only mention the number of non-admin queues.
        2) It is zero-based, meaning that '0 == one non-admin queue',
           '1 == two non-admin queues', and so forth.
      
      Because our `num_queues` means the number of queues _plus_ the admin
      queue, then the right calculation for the number returned from the admin
      command is `num_queues - 2`, combining the two requirements mentioned.
      
      The issue was discovered by reducing num_queues from 64 to 8 and running
      a Linux VM with an SMP parameter larger than that (e.g. 22). It tries to
      utilize all queues, and therefore fails with an invalid queue number
      when trying to queue I/Os on the last queue.
      Signed-off-by: NDan Aloni <dan@kernelim.com>
      CC: Alex Friedman <alex@e8storage.com>
      CC: Keith Busch <keith.busch@intel.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      cdd34637
  15. 10 8月, 2017 1 次提交
  16. 31 7月, 2017 1 次提交
  17. 15 7月, 2017 3 次提交
  18. 14 7月, 2017 1 次提交
  19. 29 6月, 2017 1 次提交
  20. 28 6月, 2017 4 次提交
  21. 26 6月, 2017 1 次提交
  22. 20 6月, 2017 1 次提交
  23. 26 5月, 2017 1 次提交
  24. 17 5月, 2017 3 次提交
    • E
      pflash_cfi01: Remove user_creatable flag · c1ce65f7
      Eduardo Habkost 提交于
      TYPE_CFI_PFLASH01 devices need to be mapped by
      pflash_cfi01_register() (or equivalent) and can't be used with
      -device. Remove user_creatable from the device class.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-7-ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      c1ce65f7
    • E
      fdc: Remove user_creatable flag from sysbus-fdc & SUNW,fdtwo · 8ca97a1f
      Eduardo Habkost 提交于
      sysbus-fdc and SUNW,fdtwo devices need IRQs to be wired and mmio
      to be mapped, and can't be used with -device. Unset
      user_creatable on their device classes.
      
      Cc: John Snow <jsnow@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Cc: Thomas Huth <thuth@redhat.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-6-ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      8ca97a1f
    • E
      sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE · e4f4fb1e
      Eduardo Habkost 提交于
      commit 33cd52b5 unset
      cannot_instantiate_with_device_add_yet in TYPE_SYSBUS, making all
      sysbus devices appear on "-device help" and lack the "no-user"
      flag in "info qdm".
      
      To fix this, we can set user_creatable=false by default on
      TYPE_SYS_BUS_DEVICE, but this requires setting
      user_creatable=true explicitly on the sysbus devices that
      actually work with -device.
      
      Fortunately today we have just a few has_dynamic_sysbus=1
      machines: virt, pc-q35-*, ppce500, and spapr.
      
      virt, ppce500, and spapr have extra checks to ensure just a few
      device types can be instantiated:
      
      * virt supports only TYPE_VFIO_CALXEDA_XGMAC, TYPE_VFIO_AMD_XGBE.
      * ppce500 supports only TYPE_ETSEC_COMMON.
      * spapr supports only TYPE_SPAPR_PCI_HOST_BRIDGE.
      
      This patch sets user_creatable=true explicitly on those 4 device
      classes.
      
      Now, the more complex cases:
      
      pc-q35-*: q35 has no sysbus device whitelist yet (which is a
      separate bug). We are in the process of fixing it and building a
      sysbus whitelist on q35, but in the meantime we can fix the
      "-device help" and "info qdm" bugs mentioned above. Also, despite
      not being strictly necessary for fixing the q35 bug, reducing the
      list of user_creatable=true devices will help us be more
      confident when building the q35 whitelist.
      
      xen: We also have a hack at xen_set_dynamic_sysbus(), that sets
      has_dynamic_sysbus=true at runtime when using the Xen
      accelerator. This hack is only used to allow xen-backend devices
      to be dynamically plugged/unplugged.
      
      This means today we can use -device with the following 22 device
      types, that are the ones compiled into the qemu-system-x86_64 and
      qemu-system-i386 binaries:
      
      * allwinner-ahci
      * amd-iommu
      * cfi.pflash01
      * esp
      * fw_cfg_io
      * fw_cfg_mem
      * generic-sdhci
      * hpet
      * intel-iommu
      * ioapic
      * isabus-bridge
      * kvmclock
      * kvm-ioapic
      * kvmvapic
      * SUNW,fdtwo
      * sysbus-ahci
      * sysbus-fdc
      * sysbus-ohci
      * unimplemented-device
      * virtio-mmio
      * xen-backend
      * xen-sysdev
      
      This patch adds user_creatable=true explicitly to those devices,
      temporarily, just to keep 100% compatibility with existing
      behavior of q35. Subsequent patches will remove
      user_creatable=true from the devices that are really not meant to
      user-creatable on any machine, and remove the FIXME comment from
      the ones that are really supposed to be user-creatable. This is
      being done in separate patches because we still don't have an
      obvious list of devices that will be whitelisted by q35, and I
      would like to get each device reviewed individually.
      
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Beniamino Galvani <b.galvani@gmail.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Frank Blaschka <frank.blaschka@de.ibm.com>
      Cc: Gabriel L. Somlo <somlo@cmu.edu>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: John Snow <jsnow@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Pierre Morel <pmorel@linux.vnet.ibm.com>
      Cc: Prasad J Pandit <pjp@fedoraproject.org>
      Cc: qemu-arm@nongnu.org
      Cc: qemu-block@nongnu.org
      Cc: qemu-ppc@nongnu.org
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Shannon Zhao <zhaoshenglong@huawei.com>
      Cc: sstabellini@kernel.org
      Cc: Thomas Huth <thuth@redhat.com>
      Cc: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-3-ehabkost@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [ehabkost: Small changes at sysbus_device_class_init() comments]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e4f4fb1e