1. 11 12月, 2015 1 次提交
    • 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
  2. 19 11月, 2015 1 次提交
  3. 18 11月, 2015 1 次提交
  4. 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
  5. 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
  6. 14 5月, 2015 1 次提交
  7. 27 4月, 2015 1 次提交
  8. 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
  9. 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
  10. 03 2月, 2015 2 次提交
  11. 26 11月, 2014 1 次提交
  12. 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
  13. 15 11月, 2014 1 次提交
  14. 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
  15. 30 10月, 2014 1 次提交
  16. 29 10月, 2014 2 次提交
  17. 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
  18. 09 9月, 2014 1 次提交
  19. 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
  20. 22 8月, 2014 2 次提交
  21. 23 7月, 2014 2 次提交
    • J
      Introduce virTristateSwitch enum · 3227e17d
      Ján Tomko 提交于
      For the values "default", "on", "off"
      
      Replaces
      virDeviceAddressPCIMulti
      virDomainFeatureState
      virDomainIoEventFd
      virDomainVirtioEventIdx
      virDomainDiskCopyOnRead
      virDomainMemDump
      virDomainPCIRombarMode
      virDomainGraphicsSpicePlaybackCompression
      3227e17d
    • J
      Introduce virTristateBool enum type · bb018ce6
      Ján Tomko 提交于
      Replace all three-state (default/yes/no) enums with it:
      virDomainBIOSUseserial
      virDomainBootMenu
      virDomainPMState
      virDomainGraphicsSpiceClipboardCopypaste
      virDomainGraphicsSpiceAgentFileTransfer
      virNetworkDNSForwardPlainNames
      bb018ce6
  22. 22 7月, 2014 3 次提交
    • R
      Fix build on non-Linux platforms · b5f57be2
      Roman Bogorodskiy 提交于
      Commit ef48a1b6 introduced virFindSCSIHostByPCI for Linux and
      a stub for other platforms that returns -1 while the function
      should return 'char *', so use 'return NULL' instead.
      
      Commit fbd91d49 introduced virReadSCSIUniqueId with the third
      argument 'int *result', however the stub for non-Linux patform
      uses 'unsigned int *result', so change it to 'int *result'.
      
      Pushed under the build breaker rule.
      b5f57be2
    • J
      scsi_host: Introduce virFindSCSIHostByPCI · ef48a1b6
      John Ferlan 提交于
      Introduce a new function to parse the provided scsi_host parent address
      and unique_id value in order to find the /sys/class/scsi_host directory
      which will allow a stable SCSI host address
      
      Add a test to scsihosttest to lookup the host# name by using the PCI address
      and unique_id value
      ef48a1b6
    • J
      virutil: Introduce virReadSCSIUniqueId · fbd91d49
      John Ferlan 提交于
      Introduce a new function to read the current scsi_host entry and return
      the value found in the 'unique_id' file.
      
      Add a 'scsihosttest' test (similar to the fchosttest, but incorporating some
      of the concepts of the mocked pci test library) in order to read the
      unique_id file like would be found in the /sys/class/scsi_host tree.
      fbd91d49
  23. 29 4月, 2014 2 次提交
    • D
      Don't use SO_REUSEADDR on Win32 platforms · 37697d82
      Daniel P. Berrange 提交于
      SO_REUSEADDR on Windows is actually akin to SO_REUSEPORT
      on Linux/BSD. ie it allows 2 apps to listen to the same
      port at once. Thus we must not set it on Win32 platforms
      
      See http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspxSigned-off-by: NDaniel P. Berrange <berrange@redhat.com>
      37697d82
    • E
      util: use virDirRead API · ac1d42ac
      Eric Blake 提交于
      In making the conversion to the new API, I fixed a couple bugs:
      virSCSIDeviceGetSgName would leak memory if a directory
      unexpectedly contained multiple entries;
      virNetDevTapGetRealDeviceName could report a spurious error
      from a stale errno inherited before starting the readdir search.
      
      The decision on whether to store the result of virDirRead into
      a variable is based on whether the end of the loop falls through
      to cleanup code automatically.  In some cases, we have loops that
      are documented to return NULL on failure, and which raise an
      error on most failure paths but not in the case where the directory
      was unexpectedly empty; it may be worth a followup patch to
      explicitly report an error if readdir was successful but the
      directory was empty, so that a NULL return always has an error set.
      
      * src/util/vircgroup.c (virCgroupRemoveRecursively): Use new
      interface.
      (virCgroupKillRecursiveInternal, virCgroupSetOwner): Report
      readdir failures.
      * src/util/virfile.c (virFileLoopDeviceOpenSearch)
      (virFileNBDDeviceFindUnused, virFileDeleteTree): Use new
      interface.
      * src/util/virnetdevtap.c (virNetDevTapGetRealDeviceName):
      Properly check readdir errors.
      * src/util/virpci.c (virPCIDeviceIterDevices)
      (virPCIDeviceFileIterate, virPCIGetNetName): Report readdir
      failures.
      (virPCIDeviceAddressIOMMUGroupIterate): Use new interface.
      * src/util/virscsi.c (virSCSIDeviceGetSgName): Report readdir
      failures, and avoid memory leak.
      (virSCSIDeviceGetDevName): Report readdir failures.
      * src/util/virusb.c (virUSBDeviceSearch): Report readdir
      failures.
      * src/util/virutil.c (virGetFCHostNameByWWN)
      (virFindFCHostCapableVport): Report readdir failures.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ac1d42ac
  24. 25 3月, 2014 1 次提交
  25. 21 3月, 2014 1 次提交
  26. 18 3月, 2014 1 次提交
  27. 11 3月, 2014 1 次提交
  28. 23 1月, 2014 1 次提交
    • O
      storage: Fix the memory leak · 88ae5dc7
      Osier Yang 提交于
      The return value of virGetFCHostNameByWWN is a strdup'ed string.
      Also add comments to declare that the caller should take care of
      freeing it.
      88ae5dc7
  29. 21 10月, 2013 3 次提交
  30. 11 10月, 2013 1 次提交
    • B
      util: fix two virCompareLimitUlong bugs · 19e7c04d
      Bing Bu Cao 提交于
      The helper function virCompareLimitUlong compares limit values,
      where value of 0 is equal to unlimited. If the latter parameter is 0,
      it should return -1 instead of 1, hence the user can only set hard_limit when
      swap_hard_limit currently is unlimited.
      
      Worse, all callers pass 2 64-bit values, but on 32-bit platforms,
      the second argument was silently truncated to 32 bits, which
      could lead to incorrect computations.
      Signed-off-by: NBing Bu Cao <mars@linux.vnet.ibm.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      19e7c04d