1. 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
  2. 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
  3. 05 1月, 2017 1 次提交
  4. 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
  5. 20 12月, 2016 1 次提交
  6. 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
  7. 17 12月, 2016 1 次提交
  8. 15 12月, 2016 7 次提交
  9. 14 12月, 2016 1 次提交
    • V
      util: Allow to query the presence of host CPU bitmaps · 1be35910
      Viktor Mihajlovski 提交于
      The functions to retrieve online and present host CPU information
      are only supported on Linux for the time being.
      
      This leads to runtime errors if these function are used on other
      platforms. To avoid that, code in higher levels using the functions
      must replicate the conditional compilation in higher level which
      is error prone (and is plainly spoken ugly).
      
      Adding a function virHostCPUHasBitmap that can be used to check
      for host CPU bitmap support.
      
      NB: There are other functions including the host CPU count that
      are lacking support on all platforms, but they are too essential
      in order to be bypassed.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      1be35910
  10. 13 12月, 2016 3 次提交
    • J
      util: Introduce virStorageSourceUpdateCapacity · 9d734b60
      John Ferlan 提交于
      Instead of having duplicated code in qemuStorageLimitsRefresh and
      virStorageBackendUpdateVolTargetInfo to get capacity specific data
      about the storage backing source or volume -- create a common API
      to handle the details for both.
      
      As a side effect, virStorageFileProbeFormatFromBuf returns to being
      a local/static helper to virstoragefile.c
      
      For the QEMU code - if the probe is done, then the format is saved so
      as to avoid future such probes.
      
      For the storage backend code, there is no need to deal with the probe
      since we cannot call the new API if target->format == NONE.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      9d734b60
    • J
      util: Introduce virStorageSourceUpdateBackingSizes · 3039ec96
      John Ferlan 提交于
      Instead of having duplicated code in qemuStorageLimitsRefresh and
      virStorageBackendUpdateVolTargetInfoFD to fill in the storage backing
      source or volume allocation, capacity, and physical values - create a
      common API that will handle the details for both.
      
      The common API will fill in "default" capacity values as well - although
      those more than likely will be overridden by subsequent code. Having just
      one place to make the determination of what the values should be will
      make things be more consistent.
      
      For the QEMU code - the data filled in will be for inactive domains
      for the GetBlockInfo and DomainGetStatsOneBlock API's. For the storage
      backend code - the data will be filled in during the volume updates.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      3039ec96
    • J
      util: Introduce virStorageSourceUpdatePhysicalSize · c5f61513
      John Ferlan 提交于
      Commit id '8dc27259' introduced virStorageSourceUpdateBlockPhysicalSize
      in order to retrieve the physical size for a block backed source device
      for an active domain since commit id '15fa84ac' changed to use the
      qemuMonitorGetAllBlockStatsInfo and qemuMonitorBlockStatsUpdateCapacity
      API's to (essentially) retrieve the "actual-size" from a 'query-block'
      operation for the source device.
      
      However, the code only was made functional for a BLOCK backing type
      and it neglected to use qemuOpenFile, instead using just open. After
      the open the block lseek would find the end of the block and set the
      physical value, close the fd and return.
      
      Since the code would return 0 immediately if the source device wasn't
      a BLOCK backed device, the physical would be displayed incorrectly,
      such as follows in domblkinfo for a file backed source device:
      
      Capacity:       1073741824
      Allocation:     0
      Physical:       0
      
      This patch will modify the algorithm to get the physical size for other
      backing types and it will make use of the qemuDomainStorageOpenStat
      helper in order to open/stat the source file depending on its type.
      The qemuDomainGetStatsOneBlock will no longer inhibit printing errors,
      but it will still ignore them leaving the physical value set to 0.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      c5f61513
  11. 09 12月, 2016 3 次提交
    • M
      Move virstat.c code to virnetdevtap.c · e0d893e8
      Mehdi Abaakouk 提交于
      This is just a code move of virstat.c to virnetdevtap.c
      e0d893e8
    • M
      virstat: fix signature of virstat helper · 9b6de7c5
      Mehdi Abaakouk 提交于
      In preparation to the code move to virnetdevtap.c, this change:
      
      * renames virNetInterfaceStats to virNetDevTapInterfaceStats
      * changes 'path' to 'ifname', to use the same vocable as other
        method in virnetdevtap.c.
      * Add the attributes checker
      9b6de7c5
    • M
      Gathering vhostuser interface stats with ovs · 013df874
      Mehdi Abaakouk 提交于
      When vhostuser interfaces are used, the interface statistics
      are not available in /proc/net/dev.
      
      This change looks at the openvswitch interfaces statistics
      tables to provide this information for vhostuser interface.
      
      Note that in openvswitch world drop/error doesn't always make sense
      for some interface type. When these informations are not available we
      set them to 0 on the virDomainInterfaceStats.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      013df874
  12. 08 12月, 2016 1 次提交
  13. 06 12月, 2016 4 次提交
  14. 01 12月, 2016 2 次提交
    • L
      util: new function virPCIDeviceGetConfigPath() · bfdc1451
      Laine Stump 提交于
      The path to the config file for a PCI device is conventiently stored
      in a virPCIDevice object, but that object's contents aren't directly
      visible outside of virpci.c, so we need to have an accessor function
      for it if anyone needs to look at it.
      bfdc1451
    • L
      util: new function virFileLength() · e026563f
      Laine Stump 提交于
      This new function just calls fstat() (if provided with a valid fd) or
      stat() (if fd is -1) and returns st_size (or -1 if there is an
      error). We may decide we want this function to be more complex, and
      handle things like block devices - this is a placeholder (that works)
      for any more complicated function.
      e026563f
  15. 25 11月, 2016 2 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
    • E
      util: Management routines for scsi_host devices · 629544be
      Eric Farman 提交于
      For a new hostdev type='scsi_host' we have a number of
      required functions for managing, adding, and removing the
      host device to/from guests.  Provide the basic infrastructure
      for these tasks.
      
      The name "SCSIVHost" (and its variants) is chosen to avoid
      conflicts with existing code named "SCSIHost" to refer to
      a hostdev type='scsi' protcol='none'.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      629544be
  16. 22 11月, 2016 1 次提交
  17. 15 11月, 2016 5 次提交