1. 22 2月, 2017 1 次提交
  2. 19 2月, 2017 5 次提交
    • J
      nodedev: Rework virNodeDeviceGetParentHost · 7ad479d0
      John Ferlan 提交于
      Rework the code to perform the various searches by parent, parent_wwnn/
      parent_wwpn, parent_fabric_wwn, or vport capable in order to return the
      'parent_host' number that is vHBA capable.
      
      The former virNodeDeviceGetParentHost is renamed to add the ByParent
      on it fixes an issue where if no parent was supplied in the XML to
      create the vHBA, then virNodeDeviceFindByName was called with a NULL
      second parameter which had bad results.
      
      The reworked code will make the various calls to fetch the NPIV host
      by the passed parameter options or if none are provided find a vport
      capable NPIV HBA to perform the create. If the call is from the delete
      path, then this option won't be allowed.
      
      Each of virNodeDeviceGetParentHostBy* functions is now static, so
      remove them external definitions.
      
      A secondary benefit of this is the test_driver now can make use of
      the new API to add some new tests to test the various creation options.
      7ad479d0
    • J
      util: Move scsi_host specific functions from virutil · 03346def
      John Ferlan 提交于
      Create a virscsihost.c and place the functions there. That removes the
      last #ifdef __linux__ from virutil.c.
      
      Take the opporunity to also change the function names and in one case
      the parameters slightly
      03346def
    • J
      util: Replace virStoragePoolGetVhbaSCSIHostParent · d2d74a98
      John Ferlan 提交于
      Use the new virNodeDeviceGetParentName instead. Modify the callers to
      build the node device scsi_host# name string in order to call the new
      function so that proper lookup occurs.
      d2d74a98
    • J
      nodedev: Introduce virNodeDeviceGetParentName · aa6aa624
      John Ferlan 提交于
      Create a function which takes a node device "name" entry to lookup
      and returns a string containing the parent name for the node device.
      aa6aa624
    • 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
  3. 11 2月, 2017 1 次提交
    • E
      util: Introduce virFileComparePaths · 87589424
      Erik Skultety 提交于
      So rather than comparing 2 paths (strings) as they are, which can very
      easily lead to unnecessary errors (e.g. in storage driver) that the paths
      are not the same when in fact they'd be e.g. just symlinks to the same
      location, we should put our best effort into resolving any symlinks and
      canonicalizing the path and only then compare the 2 paths for equality.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      87589424
  4. 09 2月, 2017 1 次提交
  5. 07 2月, 2017 1 次提交
  6. 01 2月, 2017 1 次提交
  7. 20 1月, 2017 1 次提交
    • M
      qemu: set default vhost-user ifname · 57b5e27d
      Michal Privoznik 提交于
      Based on work of Mehdi Abaakouk <sileht@sileht.net>.
      
      When parsing vhost-user interface XML and no ifname is found we
      can try to fill it in in post parse callback. The way this works
      is we try to make up interface name from given socket path and
      then ask openvswitch whether it knows the interface.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      57b5e27d
  8. 18 1月, 2017 1 次提交
  9. 12 1月, 2017 2 次提交
    • M
      util: Introduce virFileMoveMount · 41816751
      Michal Privoznik 提交于
      This is a simple wrapper over mount(). However, not every system
      out there is capable of moving a mount point. Therefore, instead
      of having to deal with this fact in all the places of our code we
      can have a simple wrapper and deal with this fact at just one
      place.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      41816751
    • M
      lxc: Move lxcContainerAvailable to virprocess · 083fcd06
      Michal Privoznik 提交于
      Other drivers (like qemu) would like to know if the namespaces
      are available therefore it makes sense to move this function to
      a shared module.
      
      At the same time, this function had some default namespaces that
      are checked with every call. It is not necessary - let callers
      pass just those namespaces they are interested in.
      
      With the move the function is renamed to
      virProcessNamespaceAvailable.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      083fcd06
  10. 11 1月, 2017 5 次提交
    • L
      conf: eliminate virDomainPCIAddressReleaseSlot() in favor of ...Addr() · 5949b53a
      Laine Stump 提交于
      Surprisingly there was a virDomainPCIAddressReleaseAddr() function
      already, but it was completely unused. Since we don't reserve entire
      slots at once any more, there is no need to release entire slots
      either, so we just replace the single call to
      virDomainPCIAddressReleaseSlot() with a call to
      virDomainPCIAddressReleaseAddr() and remove the now unused function.
      
      The keen observer may be concerned that ...Addr() doesn't call
      virDomainPCIAddressValidate(), as ...Slot() did. But really the
      validation was pointless anyway - if the device hadn't been suitable
      to be connected at that address, it would have failed validation
      before every being reserved in the first place, so by definition it
      will pass validation when it is being unplugged. (And anyway, even if
      something "bad" happened and we managed to have a device incorrectly
      at the given address, we would still want to be able to free it up for
      use by a device that *did* validate properly).
      5949b53a
    • L
      conf: rename virDomainPCIAddressReserveSlot() to ...Addr() · 27b0f971
      Laine Stump 提交于
      This function doesn't actually reserve an entire slot any more, it
      reserves a single PCI address, so this name is more appropriate.
      27b0f971
    • L
      conf: make virDomainPCIAddressReserveAddr() a static function · 24c8c472
      Laine Stump 提交于
      It is now only used in domain_addr.c.
      24c8c472
    • L
      conf: eliminate virDomainPCIAddressReserveNextSlot() · 43f81477
      Laine Stump 提交于
      Since we don't actually reserve an entire slot at a time anymore, the
      name of this function is just confusing, and it's almost identical in
      operation to virDomainPCIAddressReserveNextAddr() anyway, so remove
      the *Slot() function and replace calls to it with calls to *Addr(...,
      -1).
      43f81477
    • L
      conf: new function virDomainPCIAddressSetAllMulti() · 3c1a0fc2
      Laine Stump 提交于
      This utility function iterates through all devices looking for any
      with a PCI address that has function != 0 (which implies that multiple
      functions are in use on that slot), then uses an inner iterator to
      find the device that's on function 0 of that same slot and sets the
      "multi" in its virDomainDeviceInfo (as long as it hasn't already been
      set explicitly by someone who presumably has better information than
      we do).
      
      It isn't yet called from anywhere, so will have no functional effect.
      3c1a0fc2
  11. 10 1月, 2017 3 次提交
    • J
      storage: Add overwrite flag checking for logical pool · f573f84e
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1373711
      
      Add support and documentation for the [NO_]OVERWRITE flags for the
      logical backend.
      
      Update virsh.pod with a description of the process for usage of
      the flags and building of the pool's volume group.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f573f84e
    • M
      security driver: Introduce transaction APIs · 95576b4d
      Michal Privoznik 提交于
      With our new qemu namespace code in place, the relabelling of
      devices is done not as good is it could: a child process is
      spawned, it enters the mount namespace of the qemu process and
      then runs desired API of the security driver.
      
      Problem with this approach is that internal state transition of
      the security driver done in the child process is not reflected in
      the parent process. While currently it wouldn't matter that much,
      it is fairly easy to forget about that. We should take the extra
      step now while this limitation is still fresh in our minds.
      
      Three new APIs are introduced here:
        virSecurityManagerTransactionStart()
        virSecurityManagerTransactionCommit()
        virSecurityManagerTransactionAbort()
      
      The Start() is going to be used to let security driver know that
      we are starting a new transaction. During a transaction no
      security labels are actually touched, but rather recorded and
      only at Commit() phase they are actually updated. Should
      something go wrong Abort() aborts the transaction freeing up all
      memory allocated by transaction.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      95576b4d
    • D
      secret: add support for value change events · 42241208
      Daniel P. Berrange 提交于
      Emit an event whenever a secret value changes
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      42241208
  12. 09 1月, 2017 4 次提交
    • D
      conf: simplify internal virSecretDef handling of usage · bd300b71
      Daniel P. Berrange 提交于
      The public virSecret object has a single "usage_id" field
      but the virSecretDef object has a different 'char *' field
      for each usage type, but the code all assumes every usage
      type has a corresponding single string. Get rid of the
      pointless union in virSecretDef and just use "usage_id"
      everywhere. This doesn't impact public XML format, only
      the internal handling.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      bd300b71
    • D
      conf: add secret event handling · df740caf
      Daniel P. Berrange 提交于
      Add helper APIs / objects for managing secret events
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      df740caf
    • D
      Add domain event for metadata changes · c5007017
      Daniel P. Berrange 提交于
      When changing the metadata via virDomainSetMetadata, we now
      emit an event to notify the app of changes. This is useful
      when co-ordinating different applications read/write of
      custom metadata.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c5007017
    • D
      lxc: ensure libvirt_lxc and qemu-nbd move into systemd machine slice · 44f79a0b
      Daniel P. Berrange 提交于
      Currently when spawning containers with systemd, the container PID 1
      will get moved into the systemd machine slice. Libvirt then manually
      moves the libvirt_lxc and qemu-nbd processes into the cgroups associated
      with the slice, but skips the systemd controller cgroup. This means that
      from systemd's POV, libvirt_lxc and qemu-nbd are still part of the
      libvirtd.service unit.
      
      On systemctl daemon-reload, it will notice that libvirt_lxc & qemu-nbd
      are in the libvirtd.service unit for the systemd controller, but in the
      machine cgroups for resources. Systemd will thus move them back into
      the libvirtd.service resource cgroups next time libvirtd is restarted.
      This causes libvirtd to kill off the container due to incorrect cgroup
      placement.
      
      The solution is to ensure that when moving libvirt_lxc & qemu-nbd, we
      also move the systemd cgroup controller placement. Normally this is
      not something we ever want todo, but this is a special case as we are
      intentionally wanting to move them to a different systemd unit.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      44f79a0b
  13. 07 1月, 2017 2 次提交
    • J
      util: Introduce virGetFCHostNameByFabricWWN · 8366cb0a
      John Ferlan 提交于
      Create a utility routine in order to read the scsi_host fabric_name files
      looking for a match to a passed fabric_name
      8366cb0a
    • J
      nodedev: Add the ability to create vHBA by parent wwnn/wwpn or fabric_wwn · 2b13361b
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1349696
      
      When creating a vHBA, the process is to feed XML to nodeDeviceCreateXML
      that lists the <parent> scsi_hostX to use to create the vHBA. However,
      between reboots, it's possible that the <parent> changes its scsi_hostX
      to scsi_hostY and saved XML to perform the creation will either fail or
      create a vHBA using the wrong parent.
      
      So add the ability to provide "wwnn" and "wwpn" or "fabric_wwn" to
      the <parent> instead of a name of the scsi_hostN that is the parent.
      The allowed XML will thus be:
      
        <parent>scsi_host3</parent>  (current)
      
      or
      
        <parent wwnn='$WWNN' wwpn='$WWPN'/>
      
      or
      
        <parent fabric_wwn='$WWNN'/>
      
      Using the wwnn/wwpn or fabric_wwn ensures the same 'scsi_hostN' is
      selected between hardware reconfigs or host reboots. The fabric_wwn
      Using the wwnn/wwpn pair will provide the most specific search option,
      while fabric_wwn will at least ensure usage of the same SAN, but maybe
      not the same scsi_hostN.
      
      This patch will add the new fields to the nodedev.rng for input purposes
      only since the input XML is essentially thrown away, no need to Format
      the values since they'd already be printed as part of the scsi_host
      data block.
      
      New API virNodeDeviceGetParentHostByWWNs will take the parent "wwnn" and
      "wwpn" in order to search the list of devices for matching capability
      data fields wwnn and wwpn.
      
      New API virNodeDeviceGetParentHostByFabricWWN will take the parent "fabric_wwn"
      in order to search the list of devices for matching capability data field
      fabric_wwn.
      2b13361b
  14. 05 1月, 2017 1 次提交
  15. 04 1月, 2017 1 次提交
    • A
      util: Turn virFirewallAddRule() into a macro · b9cc2483
      Andrea Bolognani 提交于
      Clang 3.9 refuses to compile the existing code with the
      following error:
      
        util/virfirewall.c:425:20: error: passing an object that undergoes
                                   default argument promotion to 'va_start'
                                   has undefined behavior [-Werror,-Wvarargs]
            va_start(args, layer);
                           ^
        util/virfirewall.c:420:37: note: parameter of type 'virFirewallLayer'
                                   is declared here
                           virFirewallLayer layer,
                                            ^
      
      This happens because 'layer' is of type virFirewallLayer, which
      is an enum type and not a standard type such as eg. void* or int.
      
      To solve the issue, turn virFirewallAddRule() from a very thin
      wrapper around virFirewallAddRuleFullV() to a macro that expands
      to a call to virFirewallAddRuleFull() - itself a very thin wrapper
      around the aforementioned virFirewallAddRuleFullV() - with no loss
      of functionality or type safety.
      b9cc2483
  16. 20 12月, 2016 1 次提交
  17. 19 12月, 2016 1 次提交
    • J
      util: Introduce virSocketAddrPTRDomain · acd547dc
      Jiri Denemark 提交于
      The API creates PTR domain which corresponds to a given addr/prefix.
      Both IPv4 and IPv6 addresses are supported, but the prefix must be
      divisible by 8 for IPv4 and divisible by 4 for IPv6.
      
      The generated PTR domain has the following format
      
      IPv4: 1.2.3.4.in-addr.arpa
      IPv6: 0.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.0.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.ip6.arpa
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      acd547dc
  18. 17 12月, 2016 1 次提交
  19. 15 12月, 2016 7 次提交