1. 01 6月, 2018 1 次提交
  2. 09 2月, 2018 1 次提交
  3. 23 1月, 2018 1 次提交
  4. 22 12月, 2017 1 次提交
  5. 19 12月, 2017 2 次提交
  6. 15 10月, 2017 1 次提交
  7. 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
  8. 26 6月, 2017 1 次提交
  9. 26 5月, 2017 1 次提交
  10. 11 5月, 2017 1 次提交
  11. 01 3月, 2017 1 次提交
  12. 01 2月, 2017 1 次提交
    • C
      pci: Convert msix_init() to Error and fix callers · ee640c62
      Cao jin 提交于
      msix_init() reports errors with error_report(), which is wrong when
      it's used in realize().  The same issue was fixed for msi_init() in
      commit 1108b2f8. In order to make the API change as small as possible,
      leave the return value check to later patch.
      
      For some devices(like e1000e, vmxnet3, nvme) who won't fail because of
      msix_init's failure, suppress the error report by passing NULL error
      object.
      
      Bonus: add comment for msix_init.
      
      CC: Jiri Pirko <jiri@resnulli.us>
      CC: Gerd Hoffmann <kraxel@redhat.com>
      CC: Dmitry Fleytman <dmitry@daynix.com>
      CC: Jason Wang <jasowang@redhat.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      CC: Hannes Reinecke <hare@suse.de>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Alex Williamson <alex.williamson@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Marcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NCao jin <caoj.fnst@cn.fujitsu.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ee640c62
  13. 28 10月, 2016 2 次提交
  14. 05 8月, 2016 2 次提交
  15. 13 7月, 2016 1 次提交
  16. 12 7月, 2016 1 次提交
  17. 26 5月, 2016 1 次提交
  18. 23 3月, 2016 1 次提交
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  19. 02 2月, 2016 1 次提交
    • L
      nvme: generate OpenFirmware device path in the "bootorder" fw_cfg file · a907ec52
      Laszlo Ersek 提交于
      Background on QEMU boot indices
      -------------------------------
      
      Normally, the "bootindex" property is configured for bootable devices
      with:
      
        DEVICE_instance_init()
          device_add_bootindex_property(..., "bootindex", ...)
            object_property_add(..., device_get_bootindex,
                                device_set_bootindex, ...)
      
      and when the bootindex is set on the QEMU command line, with
      
        -device DEVICE,...,bootindex=N
      
      the setter that was configured above is invoked:
      
        device_set_bootindex()
          /* parse boot index */
          visit_type_int32()
      
          /* verify unicity */
          check_boot_index()
      
          /* store parsed boot index */
          ...
      
          /* insert device path to boot order */
          add_boot_device_path()
      
      In the last step, add_boot_device_path() ensures that an OpenFirmware
      device path will show up in the "bootorder" fw_cfg file, at a position
      corresponding to the device's boot index. Thus guest firmware (SeaBIOS and
      OVMF) can try to boot off the device with the right priority.
      
      NVMe boot index
      ---------------
      
      In QEMU commit 33739c71,
      
        nvma: ide: add bootindex to qom property
      
      the following generic setters / getters:
      - device_set_bootindex()
      - device_get_bootindex()
      
      were open-coded for NVMe, under the names
      - nvme_set_bootindex()
      - nvme_get_bootindex()
      
      Plus nvme_instance_init() was added to configure the "bootindex" property
      manually, designating the open-coded getter & setter, rather than calling
      device_add_bootindex_property().
      
      Crucially, nvme_set_bootindex() avoided the final add_boot_device_path()
      call. This fact is spelled out in the message of commit 33739c71, and
      it was presumably the entire reason for all of the code duplication.
      
      Now, Vladislav filed an RFE for OVMF
      <https://github.com/tianocore/edk2/issues/48>; OVMF should boot off NVMe
      devices. It is simple to build edk2's existent NvmExpressDxe driver into
      OVMF, but the boot order matching logic in OVMF can only handle NVMe if
      the "bootorder" fw_cfg file includes such devices.
      
      Therefore this patch converts the NVMe device model to
      device_set_bootindex() all the way.
      
      Device paths
      ------------
      
      device_set_bootindex() accepts an optional parameter called "suffix". When
      present, it is expected to take the form of an OpenFirmware device path
      node, and it gets appended as last node to the otherwise auto-generated
      OFW path.
      
      For NVMe, the auto-generated part is
      
        /pci@i0cf8/pci8086,5845@6[,1]
             ^     ^            ^  ^
             |     |            PCI slot and (present when nonzero)
             |     |            function of the NVMe controller, both hex
             |     "driver name" component, built from PCI vendor & device IDs
             PCI root at system bus port, PIO
      
      to which here we append the suffix
      
        /namespace@1,0
                   ^ ^
                   | big endian (MSB at lowest address) numeric interpretation
                   | of the 64-bit IEEE Extended Unique Identifier, aka EUI-64,
                   | hex
                   32-bit NVMe namespace identifier, aka NSID, hex
      
      resulting in the OFW device path
      
        /pci@i0cf8/pci8086,5845@6[,1]/namespace@1,0
      
      The reason for including the NSID and the EUI-64 is that an NVMe device
      can in theory produce several different namespaces (distinguished by
      NSID). Additionally, each of those may (optionally) have an EUI-64 value.
      
      For now, QEMU only provides namespace 1.
      
      Furthermore, QEMU doesn't even represent the EUI-64 as a standalone field;
      it is embedded (and left unused) inside the "NvmeIdNs.res30" array, at the
      last eight bytes. (Which is fine, since EUI-64 can be left zero-filled if
      unsupported by the device.)
      
      Based on the above, we set the "unit address" part of the last
      ("namespace") node to fixed "1,0".
      
      OVMF will then map the above OFW device path to the following UEFI device
      path fragment, for boot order processing:
      
        PciRoot(0x0)/Pci(0x6,0x1)/NVMe(0x1,00-00-00-00-00-00-00-00)
                ^        ^   ^    ^    ^   ^
                |        |   |    |    |   octets of the EUI-64 in address order
                |        |   |    |    NSID
                |        |   |    NVMe namespace messaging device path node
                |        PCI slot and function
                PCI root bridge
      
      Cc: Keith Busch <keith.busch@intel.com> (supporter:nvme)
      Cc: Kevin Wolf <kwolf@redhat.com> (supporter:Block layer core)
      Cc: qemu-block@nongnu.org (open list:nvme)
      Cc: Gonglei <arei.gonglei@huawei.com>
      Cc: Vladislav Vovchenko <vladislav.vovchenko@sk.com>
      Cc: Feng Tian <feng.tian@intel.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Kevin O'Connor <kevin@koconnor.net>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Acked-by: NGonglei <arei.gonglei@huawei.com>
      Acked-by: NKeith Busch <keith.busch@intel.com>
      Tested-by: NVladislav Vovchenko <vladislav.vovchenko@sk.com>
      Message-id: 1453850483-27511-1-git-send-email-lersek@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      a907ec52
  20. 20 1月, 2016 1 次提交
  21. 12 11月, 2015 1 次提交
  22. 07 9月, 2015 1 次提交
  23. 14 7月, 2015 2 次提交
  24. 23 6月, 2015 1 次提交
  25. 22 5月, 2015 1 次提交
  26. 30 4月, 2015 1 次提交
    • D
      Enable NVMe start controller for Windows guest. · 4a4d614f
      Daniel Stekloff 提交于
      Windows seems to send two separate calls to NVMe controller configuration. The
      first sends configuration info and the second the enable bit. I couldn't
      enable the Windows 8.1 in-box NVMe driver with base Qemu. I made the
      following change to store the configuration data and then handle enable and
      NVMe driver works on Windows 8.1.
      
      I am not a Windows expert and I'm not entirely sure this is the correct
      approach. I'm offering it for anyone who wishes to use NVMe on Windows 8.1
      using Qemu.
      
      I have tested this change with Linux and Windows guests with NVMe devices.
      Signed-off-by: NDaniel Stekloff <dan@wendan.org>
      Acked-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4a4d614f
  27. 27 3月, 2015 1 次提交
  28. 10 3月, 2015 1 次提交
  29. 13 1月, 2015 2 次提交
  30. 10 12月, 2014 1 次提交
  31. 17 11月, 2014 1 次提交
  32. 20 10月, 2014 1 次提交
    • M
      hw: Convert from BlockDriverState to BlockBackend, mostly · 4be74634
      Markus Armbruster 提交于
      Device models should access their block backends only through the
      block-backend.h API.  Convert them, and drop direct includes of
      inappropriate headers.
      
      Just four uses of BlockDriverState are left:
      
      * The Xen paravirtual block device backend (xen_disk.c) opens images
        itself when set up via xenbus, bypassing blockdev.c.  I figure it
        should go through qmp_blockdev_add() instead.
      
      * Device model "usb-storage" prompts for keys.  No other device model
        does, and this one probably shouldn't do it, either.
      
      * ide_issue_trim_cb() uses bdrv_aio_discard() instead of
        blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
        which has only the BlockDriverState.
      
      * PC87312State has an unused BlockDriverState[] member.
      
      The next two commits take care of the latter two.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be74634
  33. 15 10月, 2014 1 次提交
  34. 10 9月, 2014 2 次提交
    • B
      block: Make the block accounting functions operate on BlockAcctStats · 5366d0c8
      Benoît Canet 提交于
      This is the next step for decoupling block accounting functions from
      BlockDriverState.
      In a future commit the BlockAcctStats structure will be moved from
      BlockDriverState to the device models structures.
      
      Note that bdrv_get_stats was introduced so device models can retrieve the
      BlockAcctStats structure of a BlockDriverState without being aware of it's
      layout.
      This function should go away when BlockAcctStats will be embedded in the device
      models structures.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Keith Busch <keith.busch@intel.com>
      CC: Anthony Liguori <aliguori@amazon.com>
      CC: "Michael S. Tsirkin" <mst@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Michael Tokarev <mjt@tls.msk.ru>
      CC: John Snow <jsnow@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Alexander Graf <agraf@suse.de>
      CC: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5366d0c8
    • B
      block: rename BlockAcctType members to start with BLOCK_ instead of BDRV_ · 28298fd3
      Benoît Canet 提交于
      The middle term goal is to move the BlockAcctStats structure in the device models.
      (Capturing I/O accounting statistics in the device models is good for billing)
      This patch make a small step in this direction by removing a reference to BDRV.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Keith Busch <keith.busch@intel.com>
      CC: Anthony Liguori <aliguori@amazon.com>
      CC: "Michael S. Tsirkin" <mst@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: John Snow <jsnow@redhat.com>
      CC: Richard Henderson <rth@twiddle.net>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Alexander Graf <agraf@suse.de>i
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      28298fd3