1. 05 2月, 2018 1 次提交
  2. 25 1月, 2018 2 次提交
  3. 19 1月, 2018 7 次提交
  4. 22 12月, 2017 1 次提交
    • L
      virtio-pci: Don't force Subsystem Vendor ID = Vendor ID · f2bc54de
      Ladi Prosek 提交于
      The statement being removed doesn't change anything as virtio PCI devices already
      have Subsystem Vendor ID set to pci_default_sub_vendor_id (0x1af4), same as Vendor
      ID. And the Virtio spec does not require the two to be equal, either:
      
        "The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY reflect the PCI
        Vendor and Device ID of the environment (for informational purposes by the driver)."
      
      Background:
      
      Following the recent virtio-win licensing change, several vendors are planning to
      ship their own certified version of Windows guest Virtio drivers, potentially taking
      advantage of Windows Update as a distribution channel. It is therefore critical that
      each vendor uses their own PCI Subsystem Vendor ID for Virtio devices to prevent
      drivers from other vendors binding to it.
      
      This would be trivially done by adding:
      
        k->subsystem_vendor_id = ...
      
      to virtio_pci_class_init(). Except for the problematic statement deleted by this
      patch, which reverts the Subsystem Vendor ID back to 0x1af4 for legacy devices for
      no good reason.
      Signed-off-by: NLadi Prosek <lprosek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      f2bc54de
  5. 20 12月, 2017 1 次提交
  6. 18 12月, 2017 2 次提交
  7. 06 12月, 2017 1 次提交
  8. 02 12月, 2017 4 次提交
  9. 16 11月, 2017 1 次提交
    • L
      fix: unrealize virtio device if we fail to hotplug it · 7abea552
      linzhecheng 提交于
      If we fail to hotplug virtio-blk device and then suspend
      or shutdown VM, qemu is likely to crash.
      
      Re-production steps:
      1. Run VM named vm001
      2. Create a virtio-blk.xml which contains wrong configurations:
      <disk device="lun" rawio="yes" type="block">
        <driver cache="none" io="native" name="qemu" type="raw" />
        <source dev="/dev/mapper/11-dm" />
        <target bus="virtio" dev="vdx" />
      </disk>
      3. Run command : virsh attach-device vm001 virtio-blk.xml
      error: Failed to attach device from blk-scsi.xml
      error: internal error: unable to execute QEMU command 'device_add': Please set scsi=off for virtio-blk devices in order to use virtio 1.0
      it means hotplug virtio-blk device failed.
      4. Suspend or shutdown VM will leads to qemu crash
      
      Problem happens in virtio_vmstate_change which is called by
      vm_state_notify:
      vdev’s parent_bus is NULL, so qdev_get_parent_bus(DEVICE(vdev)) will crash.
      virtio_vmstate_change is added to the list vm_change_state_head at virtio_blk_device_realize(virtio_init),
      but after hotplug virtio-blk failed, virtio_vmstate_change will not be removed from vm_change_state_head.
      Adding unrealize function of virtio-blk device can solve this problem.
      Signed-off-by: Nlinzhecheng <linzhecheng@huawei.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      7abea552
  10. 15 10月, 2017 5 次提交
  11. 27 9月, 2017 2 次提交
  12. 19 9月, 2017 2 次提交
    • E
      osdep.h: Prohibit disabling assert() in supported builds · 262a69f4
      Eric Blake 提交于
      We already have several files that knowingly require assert()
      to work, sometimes because refactoring the code for proper
      error handling has not been tackled yet; there are probably
      other files that have a similar situation but with no comments
      documenting the same.  In fact, we have places in migration
      that handle untrusted input with assertions, where disabling
      the assertions risks a worse security hole than the current
      behavior of losing the guest to SIGABRT when migration fails
      because of the assertion.  Promote our current per-file
      safety-valve to instead be project-wide, and expand it to also
      cover glib's g_assert().
      
      Note that we do NOT want to encourage 'assert(side-effects);'
      (that is a bad practice that prevents copy-and-paste of code to
      other projects that CAN disable assertions; plus it costs
      unnecessary reviewer mental cycles to remember whether a project
      special-cases the crippling of asserts); and we would LIKE to
      fix migration to not rely on asserts (but that takes a big code
      audit).  But in the meantime, we DO want to send a message
      that anyone that disables assertions has to tweak code in order
      to compile, making it obvious that they are taking on additional
      risk that we are not going to support.  At the same time, leave
      comments mentioning NDEBUG in files that we know still need to
      be scrubbed, so there is at least something to grep for.
      
      It would be possible to come up with some other mechanism for
      doing runtime checking by default, but which does not abort
      the program on failure, while leaving side effects in place
      (unlike how crippling assert() avoids even the side effects),
      perhaps under the name q_verify(); but it was not deemed worth
      the effort (developers should not have to learn a replacement
      when the standard C macro works just fine, and it would be a lot
      of churn for little gain).  The patch specifically uses #error
      rather than #warn so that a user is forced to tweak the header
      to acknowledge the issue, even when not using a -Werror
      compilation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      
      Message-Id: <20170911211320.25385-1-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      262a69f4
    • A
      Convert single line fprintf(.../n) to warn_report() · 2ab4b135
      Alistair Francis 提交于
      Convert all the single line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \
          {} +
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters.
      
      The #include lines were manually updated to allow the code to compile.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips]
      Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2ab4b135
  13. 08 9月, 2017 1 次提交
    • A
      vhost: Release memory references on cleanup · ee4c1128
      Alex Williamson 提交于
      vhost registers a MemoryListener where it adds and removes references
      to MemoryRegions as the MemoryRegionSections pass through.  The
      region_add callback is invoked for each existing section when the
      MemoryListener is registered, but unregistering the MemoryListener
      performs no reciprocal region_del callback.  It's therefore the
      owner of the MemoryListener's responsibility to cleanup any persistent
      changes, such as these memory references, after unregistering.
      
      The consequence of this bug is that if we have both a vhost device
      and a vfio device, the vhost device will reference any mmap'd MMIO of
      the vfio device via this MemoryListener.  If the vhost device is then
      removed, those references remain outstanding.  If we then attempt to
      remove the vfio device, it never gets finalized and the only way to
      release the kernel file descriptors is to terminate the QEMU process.
      
      Fixes: dfde4e6e ("memory: add ref/unref calls")
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: qemu-stable@nongnu.org # v1.6.0+
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ee4c1128
  14. 31 8月, 2017 1 次提交
  15. 03 8月, 2017 1 次提交
  16. 02 8月, 2017 2 次提交
  17. 01 8月, 2017 1 次提交
  18. 31 7月, 2017 1 次提交
  19. 14 7月, 2017 4 次提交