1. 08 3月, 2017 2 次提交
    • J
      util: Avoid possible NULL dereference in virSysinfoParsePPCProcessor · 15b88147
      John Ferlan 提交于
      Found by Coverity. Because there's an "if ((cur = strstr(base, "revision"))
       != NULL) {" followed by a "base = cur" coverity notes that 'base' could
      then be NULL causing the return to the top of the "while ((tmp_base =
      strstr(base, "processor")) != NULL) {" to have strstr deref a NULL 'base'
      pointer because the setting of base at the bottom of the loop is unconditional.
      
      Alter the code to set "base = cur" after processing each key. That will
      "ensure" that base doesn't get set to NULL if both "cpu" and "revision"
      do no follow a "processor".
      
      While a /proc/cpuinfo file that has a "processor" key but with neither
      a "cpu" nor a "revision" doesn't seem feasible, the code is written as if
      it could happen, so we have to account for it.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      15b88147
    • J
      util: Resource some resource leaks in virsysinfo code · 7744d994
      John Ferlan 提交于
      Calls to virFileReadAll after a VIR_ALLOC that return NULL all show
      a memory leak since 'ret' isn't virSysinfoDefFree'd and normal path
      "return ret" doesn't free outbuf.
      
      Reported by Coverity
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      7744d994
  2. 07 3月, 2017 12 次提交
  3. 06 3月, 2017 14 次提交
    • J
      Test virSystemd APIs twice to check the cache effects · 9b1bd138
      Ján Tomko 提交于
      Test virSystemd APIs twice to check the cache effects.
      9b1bd138
    • J
      Cache the presence of machine1 service · f10bd740
      Ján Tomko 提交于
      After the system has been booted, it should not change.
      
      Cache the return value of virSystemdHasMachined.
      Allow starting and terminating machines with just one
      DBus call, instead of three, reducing the chance of
      the call timing out.
      
      Also introduce a small function for resetting the cache
      to be used in tests.
      f10bd740
    • J
      Use macros for testing virSystemd APIs · 27cdbcb9
      Ján Tomko 提交于
      This hides the unused third parameter from every line
      and prepares for resetting the environment after each test
      case in the future.
      27cdbcb9
    • J
      Unify checking for machine1 systemd service · 18c145a0
      Ján Tomko 提交于
      Both virSystemdTerminateMachine and virSystemdCreateMachine
      propagate the error to tell between a non-systemd system
      and a hard error.
      
      In virSystemdGetMachineNameByPID both are treated the same,
      but an error is ignored by the callers.
      
      Split out the checks into a separate function.
      18c145a0
    • J
      test: Make common test*ObjFindByUUID helpers · 39df53b9
      John Ferlan 提交于
      Make common helpers testNetworkObjFindByUUID and testStoragePoolObjFindByUUID
      which will replace the repeated patter for each to find objects by UUID.
      
      As a bonus, the error message processing will also provide the failed uuidstr
      rather than a generic error message.
      39df53b9
    • J
      test: Make a common testNetworkObjFindByName · cf98d4e1
      John Ferlan 提交于
      Rather than have multiple places using the same pattern to find
      a network by name using virNetworkObjFindByName, create a common
      helper which will provide a consistent error message as well.
      cf98d4e1
    • J
      test: Make common test*ObjFindByName helpers · 865f479d
      John Ferlan 提交于
      Rather than have continued repeated sequences of :
      
          testDriverLock()
          xxx = vir*ObjFindByName()
          testDriverUnlock()
      
          if (xxx == NULL) {
              virReportError
              goto cleanup;
          }
      
      Make some common helpers which will use the pattern and make a single
      reference using a single common error message.
      
      Altered for Interfaces, Storage Pools, Storage Volumes, and Node Devices.
      
      For each the common error message can now also indicate which 'name' was
      not found. For Storage Volumes, the "new" error will be more specific
      rather than just invalid argument.
      865f479d
    • J
      conf: Alter coding style of interface function prototypes · 5adbbdc1
      John Ferlan 提交于
      In an effort to be consistent with the source module, alter the function
      prototypes to follow the similar style of source with the "type" on one
      line followed by the function name and arguments on subsequent lines with
      with argument getting it's own line.
      5adbbdc1
    • J
      conf: Use consistent function name prefixes for virinterfaceobj · e858232e
      John Ferlan 提交于
      Use "virInterfaceObj" as a prefix for any external API in virinterfaceobj
      e858232e
    • J
      conf: Adjust coding style for interface conf sources · 7e702a86
      John Ferlan 提交于
      Alter the format of the code to follow more recent style guidelines of
      two empty lines between functions, function decls with "[static] type"
      on one line followed by function name with arguments to functions each
      on one line.
      7e702a86
    • J
      conf: Introduce virinterfaceobj · eabeff8e
      John Ferlan 提交于
      Move all the InterfaceObj API's into their own module virinterfaceobj
      from the interface_conf
      
      Purely code motion at this point.
      eabeff8e
    • M
      qemu: Enforce qemuSecurity wrappers · 4da534c0
      Michal Privoznik 提交于
      Now that we have some qemuSecurity wrappers over
      virSecurityManager APIs, lets make sure everybody sticks with
      them. We have them for a reason and calling virSecurityManager
      API directly instead of wrapper may lead into accidentally
      labelling a file on the host instead of namespace.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4da534c0
    • J
      news: Fix typo · e489625e
      Jiri Denemark 提交于
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      e489625e
    • J
      qemu: Drop virQEMUCapsFreeStringList · f012386c
      Jiri Denemark 提交于
      The implementation matches virStringListFreeCount. The only difference
      between the two functions is the ordering of their parameters.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      f012386c
  4. 04 3月, 2017 12 次提交