1. 28 6月, 2013 4 次提交
    • D
      Fix vPort management: FC vHBA creation · 3c0d5e22
      Dennis Chen 提交于
      When creating a virtual FC HBA with virsh/libvirt API, an error message
      will be returned: "error: Node device not found",
      also the 'nodedev-dumpxml' shows wrong information of wwpn & wwnn
      for the new created device.
      
      Signed-off-by: xschen@tnsoft.com.cn
      
      This reverts f90af691 which switched wwpn & wwwn in the wrong place.
      
      https://www.kernel.org/doc/Documentation/scsi/scsi_fc_transport.txt
      3c0d5e22
    • L
      util: fix build error on non-Linux systems · a7578222
      Laine Stump 提交于
      Building on FreeBSD had this linker error:
      
      /work/a/ports/devel/libvirt/work/libvirt-1.1.0/src/.libs/libvirt.so:
         undefined reference to `virPCIDeviceAddressParse'
      
      This was caused by the new use of virPCIDeviceAddressParse in a
      portion of virpci.c that wasn't linux-only (in commit 72c029d8). The
      problem was that virPCIDeviceAddressParse had originally been defined
      inside #ifdef _linux (because it was only used by another function
      that was inside the same ifdef).
      
      The solution is to move it out to the part of virpci.c that is
      compiled on all platforms.
      
      (Because the portion that was "moved" was 40-50 lines, but only moved
      up by 15 lines, the diff for the patch is less than non-informative -
      rather than showing that part that I moved, it shows the bit that was
      previously before the moved part, and now sits *after* it.)
      a7578222
    • V
      conf: Swap order of AddImplicitControllers and DomainDefPostParse · b291a00a
      Viktor Mihajlovski 提交于
      Implicit controllers may be dependent on device definitions altered
      in a post-parse callback. Specifically, if a console device is
      defined without the target type, the type will be set in QEMU's
      callback. In the case of s390, this is virtio, which requires
      an implicit virtio-serial controller.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      b291a00a
    • V
      S390: Testcase for console default target type (virtio) · 38dc2122
      Viktor Mihajlovski 提交于
      For s390 the default console target type is virtio. This also requires
      that an implicit virtio-serial controller is instantiated.
      This testcase verifies that the target type of virtio is correctly set
      in the generated XML if no target element was given and that the
      corresponding virtio-serial element is generated too.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      38dc2122
  2. 27 6月, 2013 4 次提交
    • X
      virsh: Add parenthesis into virsh nodedev-detach help · f542a0de
      xuzhang 提交于
      f542a0de
    • J
      bridge: don't crash on bandwidth unplug with no bandwidth · 658c932a
      Ján Tomko 提交于
      If networkUnplugBandwidth is called on a network which has
      no bandwidth defined, print a warning instead of crashing.
      
      This can happen when destroying a domain with bandwidth if
      bandwidth was removed from the network after the domain was
      started.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=975359
      658c932a
    • L
      nodedev: add iommuGroup to node device object · 8807b285
      Laine Stump 提交于
      This includes adding it to the nodedev parser and formatter, docs, and
      test.
      
      An example of the new iommuGroup element that is a part of the output
      from "virsh nodedev-dumpxml" (virNodeDeviceGetXMLDesc()):
      
        <device>
          <name>pci_0000_02_00_1</name>
          <capability type='pci'>
          ...
            <iommuGroup number='12'>
              <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
              <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
            </iommuGroup>
          </capability>
        </device>
      8807b285
    • L
      pci: new iommu_group functions · 72c029d8
      Laine Stump 提交于
      Any device which belongs to an "IOMMU group" (used by vfio) will
      have links to all devices of its group listed in
      /sys/bus/pci/$device/iommu_group/devices;
      /sys/bus/pci/$device/iommu_group is actually a link to
      /sys/kernel/iommu_groups/$n, where $n is the group number (there
      will be a corresponding device node at /dev/vfio/$n once the
      devices are bound to the vfio-pci driver)
      
      The following functions are added:
      
      virPCIDeviceGetIOMMUGroupList
      
        Gets a virPCIDeviceList with one virPCIDeviceList for each device
        in the same IOMMU group as the provided virPCIDevice (a copy of the
        original device object is included in the list.
      
      virPCIDeviceAddressIOMMUGroupIterate
      
        Calls the function @actor once for each device in the group that
        contains the given virPCIDeviceAddress.
      
      virPCIDeviceAddressGetIOMMUGroupAddresses
      
        Fills in a virPCIDeviceAddressPtr * with an array of
        virPCIDeviceAddress, one for each device in the iommu group of the
        provided virPCIDeviceAddress (including a copy of the original).
      
      virPCIDeviceAddressGetIOMMUGroupNum
      
        Returns the group number as an int (a valid group number will always
        be 0 or greater).  If there is no iommu_group link in the device's
        directory (usually indicating that vfio isn't loaded), -2 will be
        returned. On any real error, -1 will be returned.
      72c029d8
  3. 26 6月, 2013 16 次提交
    • J
      Plug leak in virCgroupMoveTask · 5bc8ecb8
      Ján Tomko 提交于
      We only break out of the while loop if *content is an empty string.
      However the buffer has been allocated to BUFSIZ + 1 (8193 in my case),
      but it gets overwritten in the next for iteration.
      
      Move VIR_FREE right before we overwrite it to avoid the leak.
      
      ==5777== 16,386 bytes in 2 blocks are definitely lost in loss record 1,022 of 1,027
      ==5777==    by 0x5296E28: virReallocN (viralloc.c:184)
      ==5777==    by 0x52B0C66: virFileReadLimFD (virfile.c:1137)
      ==5777==    by 0x52B0E1A: virFileReadAll (virfile.c:1199)
      ==5777==    by 0x529B092: virCgroupGetValueStr (vircgroup.c:534)
      ==5777==    by 0x529AF64: virCgroupMoveTask (vircgroup.c:1079)
      
      Introduced by 83e4c775.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=978352
      5bc8ecb8
    • J
      Fix invalid read in virCgroupGetValueStr · 306c49ff
      Ján Tomko 提交于
      Don't check for '\n' at the end of file if zero bytes were read.
      
      Found by valgrind:
      ==404== Invalid read of size 1
      ==404==    at 0x529B09F: virCgroupGetValueStr (vircgroup.c:540)
      ==404==    by 0x529AF64: virCgroupMoveTask (vircgroup.c:1079)
      ==404==    by 0x1EB475: qemuSetupCgroupForEmulator (qemu_cgroup.c:1061)
      ==404==    by 0x1D9489: qemuProcessStart (qemu_process.c:3801)
      ==404==    by 0x18557E: qemuDomainObjStart (qemu_driver.c:5787)
      ==404==    by 0x190FA4: qemuDomainCreateWithFlags (qemu_driver.c:5839)
      
      Introduced by 0d0b4098.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=978356
      306c49ff
    • S
      Fix sample TPM XML · 7070a572
      Stefan Berger 提交于
      Fix an error in the sample TPM XML.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      7070a572
    • L
      network: allow <vlan> in type='hostdev' networks · 4b42e3b9
      Laine Stump 提交于
      Although SRIOV network cards support setting a vlan tag on their
      virtual functions, and although setting this vlan tag via a <vlan>
      element in a domain's <interface> works, setting a vlan tag for these
      devices in a <network> definition, or in a network <portgroup>
      definition is also supposed to work (and the comment that validates
      <vlan> usage even says that!). However, the check to allow it only
      checked for an openvswitch network, so attempts to add <vlan> to a
      network of type='hostdev' would fail.
      4b42e3b9
    • L
      docs: correct and update network vlan example · ab0c8df0
      Laine Stump 提交于
      Somehow I put an example of a domain interface with a <vlan> element
      into the network documentation.
      
      This patch replaces that with an example of a network definition that
      has a vlan element with trunk='yes', multiple tags, and even the new
      nativeMode attribute. It also includes a <portgroup> that has a vlan
      defined.
      ab0c8df0
    • L
      test: include qemuhotplugtest data files in source rpm · ec30f0f7
      Laine Stump 提交于
      commit 0fc12bca added a new test called qemuhotplugtest which has
      several data files in tests/qemuhotplugtestdata, but didn't add that
      directory to EXTRA_DIST in the tests Makefile.am, so the make check
      done during a make rpm was failing due to missing data files.
      ec30f0f7
    • L
      qemu: fix infinite loop in OOM error path · a47b9e87
      Laine Stump 提交于
      A loop in qemuPrepareHostdevPCIDevices() intended to cycle through all
      the objects on the list pcidevs was doing "while (listcount > 0)", but
      nothing in the body of the loop was reducing the size of the list - it
      was instead removing items from a *different* list. It has now been
      safely changed to a for() loop.
      a47b9e87
    • L
      pci: fix dangling pointer in qemuDomainReAttachHostdevDevices · b2a2d00f
      Laine Stump 提交于
      (This isn't as bad as it sounds - it's only a problem in case of an
      OOM error.)
      
      qemuGetActivePciHostDeviceList() had been creating a list that
      contained pointers to objects that were also on the activePciHostdevs
      list. In case of an OOM error, this newly created list would be
      virObjectUnref'ed, which would cause everything on the list to be
      freed. But all of those objects would still be on the
      activePciHostdevs list, which could have very bad consequences if that
      list was ever again accessed.
      
      The solution used here is to populate the new list with *copies* of
      the objects from the original list. It turns out that on return from
      qemuGetActivePciHostDeviceList(), the caller would almost immediately
      go through all the device objects and "steal" them (i.e. remove the
      pointer from the list but not delete it) all from either one list or
      the other; we now instead just *delete* (remove from the list and
      free) each device from one list or the other, so in the end we have
      the same state.
      b2a2d00f
    • L
      pci: eliminate leak in OOM condition · 2a2739a8
      Laine Stump 提交于
      The "fix" I pushed a few commits ago would still leak a virPCIDevice
      in case of an OOM error. Although it's inconsequential in practice,
      this patch satisfies my OCD.
      2a2739a8
    • L
      pci: virPCIDeviceListAddCopy API · 0e89a543
      Laine Stump 提交于
      Make a copy of the device and add the copy to the
      list. (virPCIDeviceListAdd() adds the original object to the list
      instead).
      0e89a543
    • L
      pci: update stubDriver name in virPCIDeviceBindToStub · 6e8003ad
      Laine Stump 提交于
      If the device is bound to a stub driver different from what is saved
      in the virPCIDevice's stubDriver attribute, update it.
      6e8003ad
    • L
      pci: eliminate repetitive path constructions in virPCIDeviceBindToStub · c13dddaf
      Laine Stump 提交于
      The same strings were being re-created multiple times just to save
      declaring a new variable. In the meantime, the use of the generic
      variable names led to confusion when trying to follow the code. This
      patch creates strings for:
      
       stubDriverName  (was called "driver" in original args)
       stubDriverPath  ("/sys/bus/pci/drivers/${stubDriverName}")
       driverLink      ("${device}/driver")
       oldDriverName   (the final component of path linked to by
                        "${device}/driver")
       oldDriverPath   ("/sys/bus/pci/drivers/${oldDriverName}")
      
      then re-uses them as necessary.
      c13dddaf
    • L
      pci: rename virPCIParseDeviceAddress and make it public · 31a4a679
      Laine Stump 提交于
      This function has utility outside of virpci.c, so make it public.
      
      Also the name didn't fit convention, so change it to
      virPCIDeviceAddressParse.
      31a4a679
    • L
      pci: rename virPCIDeviceGetVFIOGroupDev to virPCIDeviceGetIOMMUGroupDev · 1d829e13
      Laine Stump 提交于
      I realized after the fact that it's probably better in the long run to
      give this function a name that matches the name of the link used in
      sysfs to hold the group (iommu_group).
      
      I'm changing it now because I'm about to add several more functions
      that deal with iommu groups.
      1d829e13
    • L
      pci: eliminate unused driver arg from virPCIDeviceDetach · ee1d1f3b
      Laine Stump 提交于
      The driver arg to virPCIDeviceDetach is no longer used (the name of the stub driver is now set in the virPCIDevice object, and virPCIDeviceDetach retrieves it from there). Remove it.
      ee1d1f3b
    • L
      util: fix bug found by Coverity · 003118de
      Laine Stump 提交于
      Commit 861d4056 added code (my personal change to "clean up" the
      submitter's code, *not* the fault of the submitter) that dereferenced
      virtVlan without first checking for NULL. This patch fixes that and,
      as part of the fix, cleans up some unnecessary obtuseness.
      003118de
  4. 25 6月, 2013 16 次提交