1. 07 1月, 2017 1 次提交
  2. 05 1月, 2017 1 次提交
  3. 21 12月, 2016 1 次提交
  4. 24 11月, 2016 1 次提交
  5. 14 10月, 2016 1 次提交
    • J
      util: Alter return value of virReadFCHost and fix mem leak · f29b13f8
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1357416
      
      Rather than return a 0 or -1 and the *result string, return just the result
      string to the caller.  Alter all the callers to handle the different return.
      
      As a side effect or result of this, it's much clearer that we cannot just
      assign the returned string into the scsi_host wwnn, wwpn, and fabric_wwn
      fields - rather we should fetch a temporary string, then as long as our
      fetch was good, VIR_FREE what may have been there, and STEAL what we just got.
      This fixes a memory leak in the virNodeDeviceCreateXML code path through
      find_new_device and nodeDeviceLookupSCSIHostByWWN which will continually
      call nodeDeviceSysfsGetSCSIHostCaps until the expected wwnn/wwpn is found
      in the device object capabilities.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f29b13f8
  6. 13 10月, 2016 1 次提交
    • M
      src: Treat PID as signed · b7d2d4af
      Michal Privoznik 提交于
      This initially started as a fix of some debug printing in
      virCgroupDetect. However it turned out that other places suffer
      from the similar problem. While dealing with pids, esp. in cases
      where we cannot use pid_t for ABI stability reasons, we often
      chose an unsigned integer type. This makes no sense as pid_t is
      signed.
      Also, new syntax-check rule is introduced so we won't repeat this
      mistake.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b7d2d4af
  7. 06 9月, 2016 1 次提交
    • M
      Make sure sys/types.h is included after sys/sysmacros.h · f3f15cc2
      Michal Privoznik 提交于
      In the latest glibc, major() and minor() functions are marked as
      deprecated (glibc commit dbab6577):
      
        CC       util/libvirt_util_la-vircgroup.lo
      util/vircgroup.c: In function 'virCgroupGetBlockDevString':
      util/vircgroup.c:768:5: error: '__major_from_sys_types' is deprecated:
        In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
        For historical compatibility, it is currently defined by
        <sys/types.h> as well, but we plan to remove this soon.
        To use `major', include <sys/sysmacros.h> directly.
        If you did not intend to use a system-defined macro `major',
        you should #undef it after including <sys/types.h>.
        [-Werror=deprecated-declarations]
           if (virAsprintf(&ret, "%d:%d ", major(sb.st_rdev), minor(sb.st_rdev)) < 0)
           ^~
      In file included from /usr/include/features.h:397:0,
                       from /usr/include/bits/libc-header-start.h:33,
                       from /usr/include/stdio.h:28,
                       from ../gnulib/lib/stdio.h:43,
                       from util/vircgroup.c:26:
      /usr/include/sys/sysmacros.h:87:1: note: declared here
       __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL)
       ^
      
      Moreover, in the glibc commit, there's suggestion to keep
      ordering of including of header files as implemented here.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f3f15cc2
  8. 24 6月, 2016 3 次提交
    • J
      Use virDirOpen · e81de04c
      Ján Tomko 提交于
      Switch from opendir to virDirOpen everywhere we need to report an error.
      e81de04c
    • J
      Do not ignore hidden files in /sys and /proc · 70a033ab
      Ján Tomko 提交于
      The directories we iterate over are unlikely to contain any entries
      starting with a dot, other than '.' and '..' which is already skipped
      by virDirRead.
      70a033ab
    • J
      Introduce VIR_DIR_CLOSE · a4e6f1eb
      Ján Tomko 提交于
      Introduce a helper that only calls closedir if DIR* is non-NULL
      and sets it to NULL afterwards.
      a4e6f1eb
  9. 20 6月, 2016 2 次提交
    • P
      util: Make failure to get supplementary group list for a uid non-fatal · 832f1602
      Peter Krempa 提交于
      Since introduction of the DAC security driver we've documented that
      seclabels with a leading + can be used with numerical uid. This would
      not work though with the rest of libvirt if the uid was not actually
      used in the system as we'd fail when trying to get a list of
      supplementary groups for the given uid. Since a uid without entry in
      /etc/passwd (or other user database) will not have any supplementary
      groups we can treat the failure to obtain them as such.
      
      This patch modifies virGetGroupList to not report the error for missing
      users and makes it return an empty list or just the group specified in
      @gid.
      
      All callers will grant less permissions to a user in case of failure of
      this function and thus this change is safe.
      832f1602
    • P
      util: Add option not to report errors in virGetUserEnt · c674dccc
      Peter Krempa 提交于
      In some cases it will be necessary to ignore errors reported from this
      function. This allows suppressing them to avoid spamming logs.
      c674dccc
  10. 10 6月, 2016 1 次提交
  11. 19 4月, 2016 1 次提交
  12. 13 4月, 2016 1 次提交
  13. 12 4月, 2016 1 次提交
  14. 18 3月, 2016 1 次提交
    • M
      Drop paths.h include · 865764de
      Michal Privoznik 提交于
      We include the file in plenty of places. This is mostly due to
      historical reasons. The only place that needs something from the
      header file is storage_backend_fs which opens _PATH_MOUNTED. But
      it gets the file included indirectly via mntent.h. At no other
      place in our code we need _PATH_.*. Drop the include and
      configure check then.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      865764de
  15. 11 12月, 2015 2 次提交
    • P
      test: qemuxml2argv: Mock virMemoryMaxValue to remove 32/64 bit difference · ace1ee22
      Peter Krempa 提交于
      Always return LLONG_MAX even on 32 bit systems. The limitation
      originates from our use of "unsigned long" in several APIs. The internal
      data type is unsigned long long. Make the test suite deterministic by
      removing the architecture difference.
      
      Flaw was introduced in 64588113 where
      I've added a test that uses too large numbers.
      ace1ee22
    • D
      log: include hostname in initial log message · 1ce92960
      Daniel P. Berrange 提交于
      On the very first log message we send to any output, we include
      the libvirt version number and package string. In some bug reports
      we have been given libvirtd.log files that came from a different
      host than the corresponding /var/log/libvirt/qemu log files. So
      extend the initial log message to include the hostname too.
      
      eg on first log message we would now see:
      
       $ libvirtd
       2015-12-04 17:35:36.610+0000: 20917: info : libvirt version: 1.3.0
       2015-12-04 17:35:36.610+0000: 20917: info : hostname: dhcp-1-180.lcy.redhat.com
       2015-12-04 17:35:36.610+0000: 20917: error : qemuMonitorIO:687 : internal error: End of file from monitor
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1ce92960
  16. 19 11月, 2015 1 次提交
  17. 18 11月, 2015 1 次提交
  18. 08 6月, 2015 1 次提交
    • P
      util: Properly return error from virGetUserID and virGetGroupID stubs · 679576cf
      Peter Krempa 提交于
      The stubs for the two functions that are compiled on platforms that
      don't have HAVE_GETPWUID_R and friends defined do not return error but
      report an error message. The calling code then assumes that the @uid or
      @gid arguments were filled, which is not the case in the stubs.
      679576cf
  19. 21 5月, 2015 1 次提交
    • P
      util: Avoid shadow of 'ulong' in virMemoryMaxValue · a5c2d198
      Peter Krempa 提交于
      Old compilers whine:
      src/util/virutil.c: In function 'virMemoryMaxValue':
      src/util/virutil.c:2612: error: declaration of 'ulong' shadows a global declaration [-Wshadow]
      /usr/include/sys/types.h:151: error: shadowed declaration is here [-Wshadow]
      
      s/ulong/capped/ to work around the problem
      a5c2d198
  20. 14 5月, 2015 1 次提交
  21. 27 4月, 2015 1 次提交
  22. 02 4月, 2015 1 次提交
    • J
      Remove unused macros · a0482396
      Ján Tomko 提交于
      In the order of appearance:
      
      * MAX_LISTEN - never used
        added by 23ad665c (qemud) and addec57 (lock daemon)
      
      * NEXT_FREE_CLASS_ID - never used, added by 07d1b6b5
      
      * virLockError - never used, added by eb8268a4
      
      * OPENVZ_MAX_ARG, CMDBUF_LEN, CMDOP_LEN
        unused since the removal of ADD_ARG_LIT in d8b31306
      
      * QEMU_NB_PER_CPU_STAT_PARAM - unused since 897808e7
      
      * QEMU_CMD_PROMPT, QEMU_PASSWD_PROMPT - unused since 1dc10a7b
      
      * TEST_MODEL_WORDSIZE - unused since c25c18f7
      
      * TEMPDIR - never used, added by 714bef5b
      
      * NSIG - workaround around old headers
        added by commit 60ed1d2a
        unused since virExec was moved by commit 02e86910
      
      * DO_TEST_PARSE - never used, added by 9afa0060
      
      * DIFF_MSEC, GETTIMEOFDAY - unused since eee6eb66
      a0482396
  23. 06 3月, 2015 2 次提交
    • P
      memtune: change the way how we store unlimited value · cf521fc8
      Pavel Hrdina 提交于
      There was a mess in the way how we store unlimited value for memory
      limits and how we handled values provided by user.  Internally there
      were two possible ways how to store unlimited value: as 0 value or as
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED.  Because we chose to store memory
      limits as unsigned long long, we cannot use -1 to represent unlimited.
      It's much easier for us to say that everything greater than
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED means unlimited and leave 0 as valid
      value despite that it makes no sense to set limit to 0.
      
      Remove unnecessary function virCompareLimitUlong.  The update of test
      is to prevent the 0 to be miss-used as unlimited in future.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146539Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cf521fc8
    • P
      virutil: introduce helper functions for memory limits · a73395ae
      Pavel Hrdina 提交于
      The first one is to truncate the memory limit to
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED if the value is greater and the second
      one is to decide whether the memory limit is set or not, unlimited means
      that it's not set.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      a73395ae
  24. 03 2月, 2015 2 次提交
  25. 26 11月, 2014 1 次提交
  26. 19 11月, 2014 1 次提交
    • E
      maint: forbid 'int foo = true' · eb909376
      Eric Blake 提交于
      I noticed this while working on qemuDomainGetBlockInfo.  Assigning
      a bool value to an int variable compiles fine, but raises red flags
      on the maintenance front as it becomes too easy to assign -1 or 2
      or any other non-bool value to the same variable.
      
      * cfg.mk (sc_prohibit_int_assign_bool): New rule.
      * src/conf/snapshot_conf.c (virDomainSnapshotRedefinePrep): Fix
      offenders.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
      (qemuDomainSnapshotCreateXML): Likewise.
      * src/test/test_driver.c (testDomainSnapshotAlignDisks):
      Likewise.
      * src/util/vircgroup.c (virCgroupSupportsCpuBW): Likewise.
      * src/util/virpci.c (virPCIDeviceBindToStub): Likewise.
      * src/util/virutil.c (virIsCapableVport): Likewise.
      * tools/virsh-domain-monitor.c (cmdDomMemStat): Likewise.
      * tools/virsh-domain.c (cmdBlockResize, cmdScreenshot)
      (cmdInjectNMI, cmdSendKey, cmdSendProcessSignal)
      (cmdDetachInterface): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eb909376
  27. 15 11月, 2014 1 次提交
  28. 11 11月, 2014 1 次提交
    • H
      Fix invalid log, misused option types and a typo · 12bd207e
      Hao Liu 提交于
      This patch fixes the following issues.
      
      1)  When an invalid wwn is introduced, libvirt reports
          "Malformed wwn: %s". The template won't be replaced.
      
      2)  "target" option for dompmsuspend and "xml" option for
          save-image-define are required options and should use
          VSH_OT_DATA instead of VSH_OT_STRING as an option type.
      
      3)  A typo.
      Signed-off-by: NHao Liu <hliu@redhat.com>
      12bd207e
  29. 30 10月, 2014 1 次提交
  30. 29 10月, 2014 2 次提交
  31. 12 9月, 2014 1 次提交
    • J
      virutil: Resolve Coverity RESOURCE_LEAK · 52e90b22
      John Ferlan 提交于
      This ends up being a very bizarre false positive. With an assist from
      eblake, the claim is that mgetgroups() could return a -1 value, but yet
      still have a groups buffer allocated, yet the example shown doesn't
      seem to prove that.
      
      Rather than fret about it, by adding a well placed sa_assert() on the
      returned *list value we can "assure" ourselves that the mgetgroups()
      failure path won't signal this condition.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      52e90b22
  32. 09 9月, 2014 1 次提交
  33. 05 9月, 2014 1 次提交
    • E
      maint: use hanging curly braces · 625e04a8
      Eric Blake 提交于
      Our style overwhelmingly uses hanging braces (the open brace
      hangs at the end of the compound condition, rather than on
      its own line), with the primary exception of the top level function
      body.  Fix the few remaining outliers, before adding a syntax
      check in a later patch.
      
      * src/interface/interface_backend_netcf.c (netcfStateReload)
      (netcfInterfaceClose, netcf_to_vir_err): Correct use of { in
      compound statement.
      * src/conf/domain_conf.c (virDomainHostdevDefFormatSubsys)
      (virDomainHostdevDefFormatCaps): Likewise.
      * src/network/bridge_driver.c (networkAllocateActualDevice):
      Likewise.
      * src/util/virfile.c (virBuildPathInternal): Likewise.
      * src/util/virnetdev.c (virNetDevGetVirtualFunctions): Likewise.
      * src/util/virnetdevmacvlan.c
      (virNetDevMacVLanVPortProfileCallback): Likewise.
      * src/util/virtypedparam.c (virTypedParameterAssign): Likewise.
      * src/util/virutil.c (virGetWin32DirectoryRoot)
      (virFileWaitForDevices): Likewise.
      * src/vbox/vbox_common.c (vboxDumpNetwork): Likewise.
      * tests/seclabeltest.c (main): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      625e04a8