1. 28 3月, 2013 2 次提交
  2. 27 3月, 2013 1 次提交
    • J
      log: Separate thread ID from timestemp in ring buffer · a1fe02f0
      Jiri Denemark 提交于
      When we write a log message into a log, we separate thread ID from
      timestamp using ": ". However, when storing the message into the ring
      buffer, we omitted the separator, e.g.:
      
          2013-02-27 11:49:11.852+00003745: ...
      a1fe02f0
  3. 25 3月, 2013 5 次提交
    • O
      util: Fix bug of managing vport · f90af691
      Osier Yang 提交于
      The string written to "vport_create" or "vport_delete" should
      be "wwnn:wwpn", but not "wwpn:wwnn".
      f90af691
    • O
      nodedev: Fix the improper logic when enumerating SRIOV VF · 9a3ff01d
      Osier Yang 提交于
      virPCIGetVirtualFunctions returns 0 even if there is no "virtfn"
      entry under the device sysfs path.
      
      And virPCIGetVirtualFunctions returns -1 when it fails to get
      the PCI config space of one VF, however, with keeping the
      the VFs already detected.
      
      That's why udevProcessPCI and gather_pci_cap use logic like:
      
      if (!virPCIGetVirtualFunctions(syspath,
                                     &data->pci_dev.virtual_functions,
                                     &data->pci_dev.num_virtual_functions) ||
          data->pci_dev.num_virtual_functions > 0)
          data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;
      
      to tag the PCI device with "virtual_function" cap.
      
      However, this results in a VF will aslo get "virtual_function" cap.
      
      This patch fixes it by:
        * Ignoring the VF which has failure of getting PCI config space
          (given that the successfully detected VFs are kept , it makes
          sense to not give up on the failure of one VF too) with a warning,
          so virPCIGetVirtualFunctions will not return -1 except out of memory.
      
        * Free the allocated *virtual_functions when out of memory
      
      And thus the logic can be changed to:
      
          /* Out of memory */
          int ret = virPCIGetVirtualFunctions(syspath,
                                              &data->pci_dev.virtual_functions,
                                              &data->pci_dev.num_virtual_functions);
      
          if (ret < 0 )
              goto out;
          if (data->pci_dev.num_virtual_functions > 0)
              data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;
      9a3ff01d
    • O
      nodedev: Abstract nodeDeviceVportCreateDelete as util function · 96d3086a
      Osier Yang 提交于
      This abstracts nodeDeviceVportCreateDelete as an util function
      virManageVport, which can be further used by later storage patches
      (to support persistent vHBA, I don't want to create the vHBA
      using the public API, which is not good).
      96d3086a
    • O
      nodedev: Refactor the helpers · 4360a098
      Osier Yang 提交于
      This adds two util functions (virIsCapableFCHost and virIsCapableVport),
      and rename helper check_fc_host_linux as detect_scsi_host_caps,
      check_capable_vport_linux is removed, as it's abstracted to the util
      function virIsCapableVport. detect_scsi_host_caps nows detect both
      the fc_host and vport_ops capabilities. "stat(2)" is replaced with
      "access(2)" for saving.
      
      * src/util/virutil.h:
        - Declare virIsCapableFCHost and virIsCapableVport
      * src/util/virutil.c:
        - Implement virIsCapableFCHost and virIsCapableVport
      * src/node_device/node_device_linux_sysfs.c:
        - Remove check_capable_vport_linux
        - Rename check_fc_host_linux as detect_scsi_host_caps, and refactor
          it a bit to detect both fc_host and vport_os capabilities
      * src/node_device/node_device_driver.h:
        - Change/remove the related declarations
      * src/node_device/node_device_udev.c: (Use detect_scsi_host_caps)
      * src/node_device/node_device_hal.c: (Likewise)
      * src/node_device/node_device_driver.c (Likewise)
      4360a098
    • O
      util: Add one helper virReadFCHost to read the value of fc_host entry · 244ce462
      Osier Yang 提交于
      "open_wwn_file" in node_device_linux_sysfs.c is redundant, on one
      hand it duplicates work of virFileReadAll, on the other hand, it's
      waste to use a function for it, as there is no other users of it.
      So I don't see why the file opening work cannot be done in
      "read_wwn_linux".
      
      "read_wwn_linux" can be abstracted as an util function. As what all
      it does is to read the sysfs entry.
      
      So this patch removes "open_wwn_file", and abstract "read_wwn_linux"
      as an util function "virReadFCHost" (a more general name, because
      after changes, it can read each of the fc_host entry now).
      
      * src/util/virutil.h: (Declare virReadFCHost)
      * src/util/virutil.c: (Implement virReadFCHost)
      * src/node_device/node_device_linux_sysfs.c: (Remove open_wwn_file,
        and read_wwn_linux)
      src/node_device/node_device_driver.h: (Remove the declaration of
        read_wwn_linux, and the related macros)
      src/libvirt_private.syms: (Export virReadFCHost)
      244ce462
  4. 22 3月, 2013 2 次提交
  5. 21 3月, 2013 2 次提交
  6. 20 3月, 2013 3 次提交
  7. 19 3月, 2013 3 次提交
  8. 16 3月, 2013 1 次提交
    • E
      util: portably check for unchanged uid · 7af86379
      Eric Blake 提交于
      We've already scrubbed for comparisons of 'uid_t == -1' (which fail
      on platforms where uid_t is a u16), but another one snuck in.
      
      * src/util/virutil.c (virSetUIDGIDWithCaps): Correct uid comparison.
      * cfg.mk (sc_prohibit_risky_id_promotion): New rule.
      7af86379
  9. 15 3月, 2013 1 次提交
    • L
      util: fix clear_emulator_capabilities=0 · 49fa91b3
      Laine Stump 提交于
      My commit 7a2e845a (and its
      prerequisites) managed to effectively ignore the
      clear_emulator_capabilities setting in qemu.conf (visible in the code
      as the VIR_EXEC_CLEAR_CAPS flag when qemu is being exec'ed), with the
      result that the capabilities are always cleared regardless of the
      qemu.conf setting. This patch fixes it by passing the flag through to
      virSetUIDGIDWithCaps(), which uses it to decide whether or not to
      clear existing capabilities before adding in those that were
      requested.
      
      Note that the existing capabilities are *always* cleared if the new
      process is going to run as non-root, since the whole point of running
      non-root is to have the capabilities removed (it's still possible to
      maintain individual capabilities as needed using the capBits argument
      though).
      49fa91b3
  10. 14 3月, 2013 2 次提交
  11. 13 3月, 2013 1 次提交
    • D
      Add API for thread cancellation · a2997142
      Daniel P. Berrange 提交于
      Add a virThreadCancel function. This functional is inherently
      dangerous and not something we want to use in general, but
      integration with SELinux requires that we provide this stub.
      We leave out any Win32 impl to discourage further use and
      because obviously SELinux isn't enabled on Win32
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a2997142
  12. 08 3月, 2013 4 次提交
  13. 07 3月, 2013 2 次提交
  14. 06 3月, 2013 1 次提交
    • G
      util: fix a integer boundary error · b38a040a
      Guannan Ren 提交于
      A value which is equal to a integer maximum such as LLONG_MAX is
      a valid integer value.
      
      The patch fix the following error:
      1, virsh memtune vm --swap-hard-limit -1
      2, virsh start vm
      In debug mode, it shows error like:
      virScaleInteger:1813 : numerical overflow:\
                             value too large: 9007199254740991KiB
      b38a040a
  15. 04 3月, 2013 1 次提交
    • G
      util: use string libvirt to prefix error message instead of libvir · b95c13cd
      Guannan Ren 提交于
      BZ:https://bugzilla.redhat.com/show_bug.cgi?id=912021
      Without error handler set, virDefaultErrorFunc will be called, the
      error message is prefixed with "libvir:". It become a little better
      by using prefix "libvirt:" when working with upper application.
      
      For example:
      1, stop libvirtd daemon
      2, run virt-top.
      libvir: XML-RPC error : Failed to connect \
              socket to '/var/run/libvirt/libvirt-sock-ro': \
              No such file or directory
      libvirt: VIR_ERR_SYSTEM_ERROR: VIR_FROM_RPC: \
              Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': \
              No such file or directory
      b95c13cd
  16. 01 3月, 2013 1 次提交
    • M
      virnetdevmacvlan.c: Introduce mutex for macvlan creation · 1cf97c87
      Michal Privoznik 提交于
      Currently, after we removed the qemu driver lock, it may happen
      that two or more threads will start up a machine with macvlan and
      race over virNetDevMacVLanCreateWithVPortProfile(). However,
      there's a racy section in which we are generating a sequence of
      possible device names and detecting if they exits. If we found
      one which doesn't we try to create a device with that name.
      However, the other thread is doing just the same. Assume it will
      succeed and we must therefore fail. If this happens more than 5
      times (which in massive parallel startup surely will) we return
      -1 without any error reported. This patch is a simple hack to
      both of these problems. It introduces a mutex, so only one thread
      will enter the section, and if it runs out of possibilities,
      error is reported. Moreover, the number of retries is raised to 20.
      1cf97c87
  17. 28 2月, 2013 1 次提交
    • D
      Avoid spamming logs with cgroups warnings · 279336c5
      Daniel P. Berrange 提交于
      The code for putting the emulator threads in a separate cgroup
      would spam the logs with warnings
      
      2013-02-27 16:08:26.731+0000: 29624: warning : virCgroupMoveTask:887 : no vm cgroup in controller 3
      2013-02-27 16:08:26.731+0000: 29624: warning : virCgroupMoveTask:887 : no vm cgroup in controller 4
      2013-02-27 16:08:26.732+0000: 29624: warning : virCgroupMoveTask:887 : no vm cgroup in controller 6
      
      This is because it has only created child cgroups for 3 of the
      controllers, but was trying to move the processes from all the
      controllers. The fix is to only try to move threads in the
      controllers we actually created. Also remove the warning and
      make it return a hard error to avoid such lazy callers in the
      future.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      279336c5
  18. 27 2月, 2013 1 次提交
  19. 25 2月, 2013 4 次提交
  20. 20 2月, 2013 2 次提交