1. 19 2月, 2017 5 次提交
    • J
      util: Create a new virvhba module and move/rename API's · 16416816
      John Ferlan 提交于
      Rather than have them mixed in with the virutil apis, create a separate
      virvhba.c module and move the vHBA related calls into there. Soon there
      will be more added.
      
      Also modify the names of the functions and some arguments to be more
      indicative of what is really happening. Adjust the callers respectively.
      
      While I was changing fchosttest, rather than the non-descriptive names
      test1...test6, rename them to match what the test is doing.
      16416816
    • J
      tests: Create a more realistic vHBA · 8729ce56
      John Ferlan 提交于
      Modify the code to react more like a real HBA -> vHBA creation.
      
      Currently the code would just modify the input XML definition to
      set the name to a wwpn and then modify the scsi_host capability
      entry for the defintion to change the scsi_host# and unique_id
      before adding that into the node device.
      
      This patch does things a bit better. It finds and copies a known
      existing vHBA (scsi_host11) in the node_device database and modifies
      that definition to change the name to scsi_host12 and set the wwnn/
      wwpn to what the input XML would expect before adding the def to the
      node device object list.
      
      Then rather than create a returned "dev" using the (poorly) mocked
      name - perform the lookup using the new device name.
      8729ce56
    • J
      test: Add helper to create vHBA for testNodeDeviceCreateXML · 0869d9b3
      John Ferlan 提交于
      Rather than inline the dummy creation of a vHBA to add to the node
      devices - create a helper to do that work.
      
      Also just tidy up a couple of things while at it...
      0869d9b3
    • J
      test: Add new NPIV capable HBA and a vHBA · 5c2ff641
      John Ferlan 提交于
      Predefine a second NPIV capable HBA as well as a vHBA using the first
      NPIV capable HBA. This will allow for a mechanism to perform more
      realistic create vHBA testing.
      5c2ff641
    • J
      tests: Alter test_driver HBA name/data to be closer to reality · 779e4905
      John Ferlan 提交于
      Alter "test-scsi-host-vport" to be "scsi_host1" to match the real
      environment. This is the vport capable HBA - IOW the NPIV device.
      Add more fields to scsi_host1 as well.
      
      Alter the XML being used by the objecttest to create a vHBA in order
      to match the scsi_host1 parent name and to use validateable wwnn/wwpn.
      This will allow for realistic testing.
      779e4905
  2. 18 2月, 2017 1 次提交
    • R
      nodedev: fix build with clang · d3ffa0ec
      Roman Bogorodskiy 提交于
      Build fails with:
      
      conf/node_device_conf.c:825:62: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
          if ((data->drm.type = virNodeDevDRMTypeFromString(type)) < 0) {
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      conf/node_device_conf.c:1801:59: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
              if ((type = virNodeDevDevnodeTypeFromString(tmp)) < 0) {
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      2 errors generated.
      
      Fix by using intermediate variable to store the result similarly
      to how it's done for other FromString* calls.
      d3ffa0ec
  3. 17 2月, 2017 9 次提交
  4. 16 2月, 2017 5 次提交
  5. 15 2月, 2017 6 次提交
    • M
      qemu_conf: Properly check for retval of qemuDomainNamespaceAvailable · 27ac5f37
      Michal Privoznik 提交于
      This function is returning a boolean therefore check for '< 0'
      makes no sense. It should have been
      '!qemuDomainNamespaceAvailable'.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      27ac5f37
    • M
      qemu_conf: Check for namespaces availability more wisely · b57bd206
      Michal Privoznik 提交于
      The bare fact that mnt namespace is available is not enough for
      us to allow/enable qemu namespaces feature. There are other
      requirements: we must copy all the ACL & SELinux labels otherwise
      we might grant access that is administratively forbidden or vice
      versa.
      At the same time, the check for namespace prerequisites is moved
      from domain startup time to qemu.conf parser as it doesn't make
      much sense to allow users to start misconfigured libvirt just to
      find out they can't start a single domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b57bd206
    • J
      apparmor: don't fail on non-apparmor <seclabel> · ec94e14b
      Jim Fehlig 提交于
      If the apparmor security driver is loaded/enabled and domain config
      contains a <seclabel> element whose type attribute is not 'apparmor',
      starting the domain fails when attempting to label resources such
      as tap FDs.
      
      Many of the apparmor driver entry points attempt to retrieve the
      apparmor security label from the domain def, returning failure if
      not found. Functions such as AppArmorSetFDLabel fail even though
      domain config contains an explicit 'none' secuirty driver, e.g.
      
        <seclabel type='none' model='none'/>
      
      Change the entry points to succeed if the domain config <seclabel>
      is not apparmor. This matches the behavior of the selinux driver.
      ec94e14b
    • J
      apparmor: don't overwrite error from reload_profile · 5cdfc80b
      Jim Fehlig 提交于
      Like other callers of reload_profile, don't overwrite errors in
      AppArmorSetSecurityHostdevLabelHelper.
      5cdfc80b
    • J
      qemu_monitor_json: Properly check GetArray return value · 598b6d79
      Jiri Denemark 提交于
      Commit 2a8d40f4 refactored qemuMonitorJSONGetCPUx86Data and replaced
      virJSONValueObjectGet(reply, "return") with virJSONValueObjectGetArray.
      While the former is guaranteed to always return non-NULL pointer the
      latter may return NULL if the returned JSON object is not an array.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      598b6d79
    • A
      qemu: Call chmod() after mknod() · ee6ec782
      Andrea Bolognani 提交于
      mknod() is affected my the current umask, so we're not
      guaranteed the newly-created device node will have the
      right permissions.
      
      Call chmod(), which is not affected by the current umask,
      immediately afterwards to solve the issue.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1421036
      ee6ec782
  6. 14 2月, 2017 1 次提交
    • J
      util: fix off-by-one when expanding a bitmap · 4a41cf18
      Ján Tomko 提交于
      To make sure bit 'b' fits into the bitmap, we need to allocate b+1
      bits, since we number from 0.
      
      Adjust the bitmap test to set a bit at a multiple of 16.
      That way the test fails without this fix, because the VIR_REALLOC
      call clears the newly added memory even if the original pointer
      has not changed.
      4a41cf18
  7. 13 2月, 2017 4 次提交
  8. 11 2月, 2017 6 次提交
  9. 10 2月, 2017 3 次提交