1. 16 2月, 2010 2 次提交
    • S
      macvtap support for libvirt -- parse new interface XML · 78d1ee29
      Stefan Berger 提交于
      This part adds support to domain_conf.{c|h} for parsing the new
      interface XML of type 'direct'. The parsed mode is now stored as
      an int.
      * src/conf/domain_conf.c src/conf/domain_conf.h: extend parsing code
      * src/util/macvtap.h: empty header to not break compilation
      78d1ee29
    • S
      macvtap support for libvirt -- build support · fd5091db
      Stefan Berger 提交于
      This patch adds build support for libvirt checking for certain contents
      of /usr/include/linux/if_link.h to see whether macvtap support is
      compilable on that system. One can disable macvtap support in libvirt
      via --without-macvtap passed to configure.
      * configure.ac src/Makefile.am: new build support
      * src/libvirt_macvtap.syms: list of exported symbols
      * src/util/macvtap.c: empty module to not break compilation
      fd5091db
  2. 13 2月, 2010 1 次提交
  3. 10 2月, 2010 3 次提交
    • D
      Remove virConnectPtr from USB/PCI device iterators · ce71b865
      Daniel P. Berrange 提交于
      All callers now pass a NULL virConnectPtr into the USB/PCi device
      iterator functions. Therefore the virConnectPtr arg can now be
      removed from these functions
      
      * src/util/hostusb.h, src/util/hostusb.c: Remove virConnectPtr
        from usbDeviceFileIterate
      * src/util/pci.c, src/util/pci.h: Remove virConnectPtr arg from
        pciDeviceFileIterate
      * src/qemu/qemu_security_dac.c, src/security/security_selinux.c: Update
        to drop redundant virConnectPtr arg
      ce71b865
    • J
      virAsprintf: remove its warn_unused_result attribute · 658952a3
      Jim Meyering 提交于
      * src/util/util.h (virAsprintf): Remove ATTRIBUTE_RETURN_CHECK, since
      it is perfectly fine to ignore the return value, now that the pointer
      is guaranteed to be set to NULL upon failure.
      * src/util/storage_file.c (absolutePathFromBaseFile): Remove now-
      unnecessary use of ignore_value.
      658952a3
    • J
      absolutePathFromBaseFile: avoid an unnecessary use of assert · e3042683
      Jim Meyering 提交于
      * src/util/storage_file.c (absolutePathFromBaseFile): While this use
      of virAsprintf is slightly cleaner than using stpncpy(stpcpy(...,
      it does impose an artificial limitation on the length of the base_file
      name.  Rather than asserting that it does not exceed INT_MAX, return
      NULL when it does.
      e3042683
  4. 09 2月, 2010 9 次提交
  5. 05 2月, 2010 5 次提交
  6. 04 2月, 2010 2 次提交
    • L
      Another fork() log locking cleanup in file creation · 730801d9
      Laine Stump 提交于
      Similar fix as previous one but for fork() usage when creating
      a file or directory
      
      * src/util/util.c: virLogLock() and virLogUnlock() around fork()
        in virFileCreate() and virDirCreateSimple()
      730801d9
    • C
      Fix log locking problem when using fork() in the library · cd0ef0e0
      Cole Robinson 提交于
      Ad pointed out by Dan Berrange:
      So if some thread in libvirtd is currently executing a logging call,
      while another thread calls virExec(), that other thread no longer
      exists in the child, but its lock is never released. So when the
      child then does virLogReset() it deadlocks.
      
      The only way I see to address this, is for the parent process to call
      virLogLock(), immediately before fork(), and then virLogUnlock()
      afterwards in both parent & child. This will ensure that no other
      thread
      can be holding the lock across fork().
      
      * src/util/logging.[ch] src/libvirt_private.syms: export virLogLock() and
        virLogUnlock()
      * src/util/util.c: lock just before forking and unlock just after - in
        both parent and child.
      cd0ef0e0
  7. 02 2月, 2010 2 次提交
  8. 01 2月, 2010 2 次提交
  9. 30 1月, 2010 1 次提交
  10. 27 1月, 2010 2 次提交
  11. 26 1月, 2010 4 次提交
    • J
      hostusb: closedir only if non-NULL; rename labels: s/error/cleanup/ · fb54230b
      Jim Meyering 提交于
      * src/util/hostusb.c (usbSysReadFile): Rename labels s/error/cleanup/
      (usbFindBusByVendor): Likewise.  And closedir only if non-NULL.
      fb54230b
    • L
      Cleanup of large buffer on stack in virFileMakePath · ba1d379c
      Laine Stump 提交于
      virFileMakePath is a recursive function that was creates a buffer
      PATH_MAX bytes long for each recursion (one recursion for each element
      in the path). This changes it to have no buffers on the stack, and to
      allocate just one buffer total, no matter how many elements are in the
      path. Because the modified algorithm requires a char* to be passed in
      rather than const char *, it is now 2 functions - a toplevel API
      function that remains identical in function, and a 2nd helper function
      called for the recursions, which 1) doesn't allocate anything, and 2)
      takes a char* arg, so it can modify the contents.
      * src/util/util.c: rewrite virFileMakePath
      ba1d379c
    • D
      Misc fixes to QMP monitor support for QEMU · 2c7f5ca6
      Daniel P. Berrange 提交于
      * src/util/json.c, src/util/json.h: Declare returned strings
        to be const
      * src/qemu/qemu_monitor.c: Wire up JSON mode for qemuMonitorGetPtyPaths
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Fix
        const correctness. Add missing error message in the function
        qemuMonitorJSONGetAllPCIAddresses. Add implementation of the
        qemuMonitorGetPtyPaths function calling 'query-chardev'.
      2c7f5ca6
    • J
      usbGetDevice: don't leak a "usbDevice" buffer on failure path · 3dc42686
      Jim Meyering 提交于
      * src/util/hostusb.c (usbGetDevice): Free "dev" when returning NULL.
      3dc42686
  12. 25 1月, 2010 1 次提交
  13. 23 1月, 2010 1 次提交
    • C
      qemu: Fix race between device rebind and kvm cleanup · be34c3c7
      Chris Lalancette 提交于
      Certain hypervisors (like qemu/kvm) map the PCI bar(s) on
      the host when doing device passthrough.  This can lead to a race
      condition where the hypervisor is still cleaning up the device while
      libvirt is trying to re-attach it to the host device driver.  To avoid
      this situation, we look through /proc/iomem, and if the hypervisor is
      still holding onto the bar (denoted by the string in the matcher variable),
      then we can wait around a bit for that to clear up.
      
      v2: Thanks to review by DV, make sure we wait the full timeout per-device
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      be34c3c7
  14. 22 1月, 2010 1 次提交
    • C
      Fix device assignment with root devices · 654dd290
      Chris Lalancette 提交于
      The patches to add ACS checking to PCI device passthrough
      introduced a bug.  With the current code, if you try to
      passthrough a device on the root bus (i.e. bus 0), then
      it denies the passthrough.  This is because the code in
      pciDeviceIsBehindSwitchLackingACS() to check for a parent
      device doesn't take into account the possibility of the
      root bus.  If we are on the root bus, it means we
      legitimately can't find a parent, and it also means that
      we don't have to worry about whether ACS is enabled.
      Therefore return 0 (indicating we don't lack ACS) from
      pciDeviceIsBehindSwitchLackingACS().
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      654dd290
  15. 21 1月, 2010 3 次提交
    • D
      Allow surrounding whitespace in uuid · ca18b710
      Dan Kenigsberg 提交于
      * src/util/uuid.c: extend virUUIDParse to allow leading and trailing
        spaces in UUIDs
      ca18b710
    • L
      New utility functions virFileCreate and virDirCreate · 98f6f381
      Laine Stump 提交于
      These functions create a new file or directory with the given
      uid/gid. If the flag VIR_FILE_CREATE_AS_UID is given, they do this by
      forking a new process, calling setuid/setgid in the new process, and
      then creating the file. This is better than simply calling open then
      fchown, because in the latter case, a root-squashing nfs server would
      create the new file as user nobody, then refuse to allow fchown.
      
      If VIR_FILE_CREATE_AS_UID is not specified, the simpler tactic of
      creating the file/dir, then chowning is is used. This gives better
      results in cases where the parent directory isn't on a root-squashing
      NFS server, but doesn't give permission for the specified uid/gid to
      create files. (Note that if the fork/setuid method fails to create the
      file due to access privileges, the parent process will make a second
      attempt using this simpler method.)
      
      If the bit VIR_FILE_CREATE_ALLOW_EXIST is set in the flags, an
      existing file/directory will not cause an error; in this case, the
      function will simply set the permissions of the file/directory to
      those requested. If VIR_FILE_CREATE_ALLOW_EXIST is not specified, an
      existing file/directory is considered (and reported as) an error.
      
      Return from both of these functions is 0 on success, or the value of
      errno if there was a failure.
      
      * src/util/util.[ch]: add the 2 new util functions
      98f6f381
    • L
      Add virRunWithHook util function · d2259ada
      Laine Stump 提交于
      * src/util/util.[ch]: similar to virExecWithHook, but waits for child to
        exit. Useful for doing things like setuid after the fork but before the
        exec.
      d2259ada
  16. 20 1月, 2010 1 次提交
    • J
      logging: confirm that we want to ignore a write error · eb895e74
      Jim Meyering 提交于
      * src/util/logging.c (virLogMessage): Include "ignore-value.h".
      Use it to ignore the return value of safewrite.
      Use STDERR_FILENO, rather than "2".
      * bootstrap (modules): Add ignore-value.
      * gnulib: Update to latest, for ignore-value that is now LGPLv2+.
      eb895e74