1. 13 3月, 2014 28 次提交
  2. 04 3月, 2014 1 次提交
  3. 30 1月, 2014 3 次提交
    • O
      qemu: Fix the error message for scsi host device's shareable checking · f406aa25
      Osier Yang 提交于
      This fixes the wrong argument order.
      f406aa25
    • O
      util: Add one argument for several scsi utils · 10c9ceff
      Osier Yang 提交于
      To support passing the path of the test data to the utils, one
      more argument is added to virSCSIDeviceGetSgName,
      virSCSIDeviceGetDevName, and virSCSIDeviceNew, and the related
      code is changed accordingly.
      
      Later tests for the scsi utils will be based on this patch.
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      10c9ceff
    • O
      qemu: Don't fail if the SCSI host device is shareable between domains · fd243fc4
      Osier Yang 提交于
      It doesn't make sense to fail if the SCSI host device is specified
      as "shareable" explicitly between domains (NB, it works if and only
      if the device is specified as "shareable" for *all* domains,
      otherwise it fails).
      
      To fix the problem, this patch introduces an array for virSCSIDevice
      struct, which records all the names of domain which are using the
      device (note that the recorded domains must specify the device as
      shareable).  And the change on the data struct brings on many
      subsequent changes in the code.
      
      Prior to this patch, the "shareable" tag didn't work as expected,
      it actually work like "non-shareable".  So this patch also added notes
      in formatdomain.html to declare the fact.
      
      * src/util/virscsi.h:
        - Remove virSCSIDeviceGetUsedBy
        - Change definition of virSCSIDeviceGetUsedBy and virSCSIDeviceListDel
        - Add virSCSIDeviceIsAvailable
      
      * src/util/virscsi.c:
        - struct virSCSIDevice: Change "used_by" to be an array; Add
          "n_used_by" as the array count
        - virSCSIDeviceGetUsedBy: Removed
        - virSCSIDeviceFree: frees the "used_by" array
        - virSCSIDeviceSetUsedBy: Copy the domain name to avoid potential
          memory corruption
        - virSCSIDeviceIsAvailable: New
        - virSCSIDeviceListDel: Change the logic, for device which is already
          in the list, just remove the corresponding entry in "used_by". And
          since it's only used in one place, we can safely removing the code
          to find out the dev in the list first.
        - Copyright updating
      
      * src/libvirt_private.sys:
        - virSCSIDeviceGetUsedBy: Remove
        - virSCSIDeviceIsAvailable: New
      
      * src/qemu/qemu_hostdev.c:
        - qemuUpdateActiveScsiHostdevs: Check if the device existing before
          adding it to the list;
        - qemuPrepareHostdevSCSIDevices: Error out if the not all domains
          use the device as "shareable"; Also don't try to add the device
          to the activeScsiHostdevs list if it already there; And make
          more sensible error w.r.t the current "shareable" value in
          driver->activeScsiHostdevs.
        - qemuDomainReAttachHostScsiDevices: Change the logic according
          to the changes on helpers.
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      fd243fc4
  4. 23 1月, 2014 1 次提交
    • O
      util: Add "shareable" field for virSCSIDevice struct · 2b66504d
      Osier Yang 提交于
      Unlike the host devices of other types, SCSI host device XML supports
      "shareable" tag. This patch introduces it for the virSCSIDevice struct
      for a later patch use (to detect if the SCSI device is shareable when
      preparing the SCSI host device in QEMU driver).
      2b66504d
  5. 03 12月, 2013 1 次提交
    • L
      qemu: default to vfio for nodedev-detach · 47b9aae0
      Laine Stump 提交于
      This patch resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1035188
      
      Commit f094aaac changed the PCI device assignment in qemu domains
      to default to using VFIO rather than legacy KVM device assignment
      (when VFIO is available). It didn't change which driver was used by
      default for virNodeDeviceDetachFlags(), though, so that API (and the
      virsh nodedev-detach command) was still binding to the pci-stub
      driver, used by legacy KVM assignment, by default.
      
      This patch publicizes (only within the qemu module, though, so no
      additions to the symbol exports are needed) the functions that check
      for presence of KVM and VFIO device assignment, then uses those
      functions to decide what to do when no driver is specified for
      virNodeDeviceDetachFlags(); if the vfio driver is loaded, the device
      will be bound to vfio-pci, or if legacy KVM assignment is supported on
      this system, the device will be bound to pci-stub; if neither method
      is available, the detach will fail.
      47b9aae0
  6. 05 11月, 2013 1 次提交
    • J
      Resolve Coverity issue regarding not checking return value · 56690455
      John Ferlan 提交于
      Coverity complains that the call to virPCIDeviceDetach() in
      qemuPrepareHostdevPCIDevices() doesn't check status return like
      other calls.  Seems this just was lurking until a recent change
      to this module resulted in Coverity looking harder and finding
      the issue.  Introduced by 'a4efb2e3' when function was called
      'pciReAttachDevice()'
      
      Just added a ignore_value() since it doesn't appear to matter
      if the call fails since we're on a failure path already.
      56690455
  7. 21 10月, 2013 1 次提交
    • L
      qemu: simplify calling qemuDomainHostdevNetConfigRestore · 7a600cf7
      Laine Stump 提交于
      This function was called in three places, and in each the call was
      qualified by a slightly different conditional. In reality, this
      function should only be called for a hostdev if all of the following
      are true:
      
        1) mode='subsystem'
        2) type='pci'
        3) there is a parent device definition which is an <interface>
           (VIR_DOMAIN_DEVICE_NET)
      
      We can simplify the callers and make them more consistent by checking
      these conditions at the top ov qemuDomainHostdevNetConfigRestore and
      returning 0 if one of them isn't satisfied.
      
      The location of the call to qemuDomainHostdevNetConfigRestore() has
      also been changed in the hot-plug case - it is moved into the caller
      of its previous location (i.e. from qemuDomainRemovePCIHostDevice() to
      qemuDomainRemoveHostDevice()). This was done to be more consistent
      about which functions pay attention to whether or not this is one of
      the special <interface> hostdevs or just a normal hostdev -
      qemuDomainRemoveHostDevice() already contained a call to
      networkReleaseActualDevice() and virDomainNetDefFree(), so it makes
      sense for it to also handle the resetting of the device's MAC address
      and vlan tag (which is what's done by
      qemuDomainHostdevNetConfigRestore()).
      7a600cf7
  8. 15 10月, 2013 1 次提交
    • E
      maint: avoid 'const fooPtr' in qemu · 9a520a59
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in src/qemu.
      
      * src/qemu/qemu_bridge_filter.h (networkAllowMacOnPort)
      (networkDisallowMacOnPort): Use intended type.
      * src/qemu/qemu_bridge_filter.c (networkAllowMacOnPort)
      (networkDisallowMacOnPort): Likewise.
      * src/qemu/qemu_command.c (qemuBuildTPMBackendStr)
      (qemuBuildTPMDevStr, qemuBuildCpuArgStr)
      (qemuBuildObsoleteAccelArg, qemuBuildMachineArgStr)
      (qemuBuildSmpArgStr, qemuBuildNumaArgStr): Likewise.
      * src/qemu/qemu_conf.c (qemuSharedDeviceEntryCopy): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSaveImageStartVM): Likewise.
      * src/qemu/qemu_hostdev.c
      (qemuDomainHostdevNetConfigVirtPortProfile): Likewise.
      * src/qemu/qemu_monitor_json.c
      (qemuMonitorJSONAttachCharDevCommand): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9a520a59
  9. 10 10月, 2013 3 次提交
    • M
      qemu: Init @pcidevs in qemuPrepareHostdevPCIDevices · 9c228e08
      Michal Privoznik 提交于
      At the beginning of the function qemuPrepareHostdevPCICheckSupport() is
      called. After that @pcidevs is initialized. However, if the very first
      command fails, we go to 'cleanup' label where virObjectUnref(pcidevs) is
      called. Obviously, it is called before @pcidevs was able to get
      initialized. Compiler warns about it:
      
        CC       qemu/libvirt_driver_qemu_impl_la-qemu_hostdev.lo
      qemu/qemu_hostdev.c: In function 'qemuPrepareHostdevPCIDevices':
      qemu/qemu_hostdev.c:824:19: error: 'pcidevs' may be used uninitialized in this function [-Werror=maybe-uninitialized]
           virObjectUnref(pcidevs);
                         ^
      cc1: all warnings being treated as errors
      9c228e08
    • P
      qemu: Prefer VFIO for PCI device passthrough · f094aaac
      Peter Krempa 提交于
      Prefer using VFIO (if available) to the legacy KVM device passthrough.
      
      With this patch a PCI passthrough device without the driver configured
      will be started with VFIO if it's available on the host. If not legacy
      KVM passthrough is checked and error is reported if it's not available.
      f094aaac
    • P
      qemu: hostdev: Add checks if PCI passthrough is available in the host · 467b561a
      Peter Krempa 提交于
      Add code to check availability of PCI passhthrough using VFIO and the
      legacy KVM passthrough and use it when starting VMs and hotplugging
      devices to live machine.
      467b561a